From e127ce17bd97b8964f760dd001c74bfa92eac01a Mon Sep 17 00:00:00 2001 From: Tomas Kral Date: Mon, 5 Sep 2016 10:40:50 +0200 Subject: [PATCH] test for entrypoint and command --- script/test/cmd/tests.sh | 9 ++++ .../entrypoint-command/docker-compose.yml | 7 +++ .../entrypoint-command/output-k8s.json | 44 +++++++++++++++ .../entrypoint-command/output-os.json | 54 +++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 script/test/fixtures/entrypoint-command/docker-compose.yml create mode 100644 script/test/fixtures/entrypoint-command/output-k8s.json create mode 100644 script/test/fixtures/entrypoint-command/output-os.json diff --git a/script/test/cmd/tests.sh b/script/test/cmd/tests.sh index 144d73d5..0d4bbc06 100755 --- a/script/test/cmd/tests.sh +++ b/script/test/cmd/tests.sh @@ -34,5 +34,14 @@ convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/s # openshift test convert::expect_success_and_warning "kompose convert --stdout --dc -f $KOMPOSE_ROOT/script/test/fixtures/ngnix-node-redis/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/ngnix-node-redis/output-os.json" "Unsupported key build - ignoring" + +###### +# Tests related to docker-compose file in /script/test/fixtures/entrypoint-command +# kubernetes test +convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/output-k8s.json" "Service cannot be created because of missing port." +# openshift test +convert::expect_success_and_warning "kompose convert --stdout --dc -f $KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/entrypoint-command/output-os.json" "Service cannot be created because of missing port." + + exit $EXIT_STATUS diff --git a/script/test/fixtures/entrypoint-command/docker-compose.yml b/script/test/fixtures/entrypoint-command/docker-compose.yml new file mode 100644 index 00000000..7a6c3366 --- /dev/null +++ b/script/test/fixtures/entrypoint-command/docker-compose.yml @@ -0,0 +1,7 @@ +version: '2' + +services: + base: + image: busybox + entrypoint: echo + command: foo diff --git a/script/test/fixtures/entrypoint-command/output-k8s.json b/script/test/fixtures/entrypoint-command/output-k8s.json new file mode 100644 index 00000000..f74f0546 --- /dev/null +++ b/script/test/fixtures/entrypoint-command/output-k8s.json @@ -0,0 +1,44 @@ +{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "Deployment", + "apiVersion": "extensions/v1beta1", + "metadata": { + "name": "base", + "creationTimestamp": null + }, + "spec": { + "replicas": 1, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "service": "base" + } + }, + "spec": { + "containers": [ + { + "name": "base", + "image": "busybox", + "command": [ + "echo" + ], + "args": [ + "foo" + ], + "resources": {} + } + ], + "restartPolicy": "Always" + } + }, + "strategy": {} + }, + "status": {} + } + ] +} diff --git a/script/test/fixtures/entrypoint-command/output-os.json b/script/test/fixtures/entrypoint-command/output-os.json new file mode 100644 index 00000000..df1122a1 --- /dev/null +++ b/script/test/fixtures/entrypoint-command/output-os.json @@ -0,0 +1,54 @@ +{ + "kind": "List", + "apiVersion": "v1", + "metadata": {}, + "items": [ + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "base", + "creationTimestamp": null, + "labels": { + "service": "base" + } + }, + "spec": { + "strategy": { + "resources": {} + }, + "triggers": null, + "replicas": 1, + "test": false, + "selector": { + "service": "base" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "service": "base" + } + }, + "spec": { + "containers": [ + { + "name": "base", + "image": "busybox", + "command": [ + "echo" + ], + "args": [ + "foo" + ], + "resources": {} + } + ], + "restartPolicy": "Always" + } + } + }, + "status": {} + } + ] +}