diff --git a/script/test/cmd/tests.sh b/script/test/cmd/tests.sh index b6c05092..5adc7ef7 100755 --- a/script/test/cmd/tests.sh +++ b/script/test/cmd/tests.sh @@ -880,18 +880,17 @@ cmd="kompose convert --stdout -j -f -" sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/stdin/output-k8s.json > /tmp/output-k8s.json cat $KOMPOSE_ROOT/script/test/fixtures/stdin/docker-compose.yaml | $cmd | diff /tmp/output-k8s.json - +# Network Translation compose +cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/network/docker-compose-v3.yaml convert --stdout -j" +sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/network/output-k8s.json > /tmp/output-k8s.json +convert::expect_success_and_warning "$cmd" "/tmp/output-k8s.json" +# OpenShift test +cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/network/docker-compose-v3.yaml convert --stdout -j" +sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/network/output-os.json > /tmp/output-os.json +convert::expect_success_and_warning "$cmd" "/tmp/output-os.json" + echo -e "\n" go test -v github.com/kubernetes/kompose/script/test/cmd rm /tmp/output-k8s.json /tmp/output-os.json exit $EXIT_STATUS - -# Network Translation compose v3 -cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/network/docker-compose-v3.yaml convert --stdout -j" -sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/network/output-k8s.json > /tmp/output-k8s.json -convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/network/docker-compose-v3.yaml convert --stdout -j" -# OpenShift test -cmd="kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/network/docker-compose-v3.yaml convert --stdout -j" -sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/network/output-os.json > /tmp/output-os.json -convert::expect_success "kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/network/docker-compose-v3.yaml convert --stdout -j" - diff --git a/script/test/fixtures/network/output-k8s.json b/script/test/fixtures/network/output-k8s.json index caade4ac..a2919a5b 100644 --- a/script/test/fixtures/network/output-k8s.json +++ b/script/test/fixtures/network/output-k8s.json @@ -13,7 +13,7 @@ "io.kompose.service": "appfoo" }, "annotations": { - "kompose.cmd": "%CMD%" + "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" } }, @@ -28,7 +28,7 @@ "io.kompose.service": "appfoo" }, "annotations": { - "kompose.cmd": "%CMD%" + "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" } }, diff --git a/script/test/fixtures/network/output-os.json b/script/test/fixtures/network/output-os.json index aff59ce3..570ed045 100644 --- a/script/test/fixtures/network/output-os.json +++ b/script/test/fixtures/network/output-os.json @@ -13,7 +13,7 @@ "io.kompose.service": "appfoo" }, "annotations": { - "kompose.cmd": "%CMD%" + "kompose.cmd": "%CMD%", "kompose.version": "%VERSION%" } },