From 0035c48900f3805aa58df1e6931f8438d5b6c021 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Mon, 22 May 2023 12:39:00 -0600 Subject: [PATCH] Add test for deploy port command --- .gitea/workflows/test-deploy.yml | 2 +- .github/workflows/test-deploy.yml | 2 +- tests/deploy/run-deploy-test.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test-deploy.yml b/.gitea/workflows/test-deploy.yml index 70f0d727..72b5a892 100644 --- a/.gitea/workflows/test-deploy.yml +++ b/.gitea/workflows/test-deploy.yml @@ -35,5 +35,5 @@ jobs: run: | dockerd -H $DOCKER_HOST --userland-proxy=false & sleep 5 - - name: "Run smoke tests" + - name: "Run deploy tests" run: ./tests/deploy/run-deploy-test.sh diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 8686e9e4..8e8fc66b 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -25,5 +25,5 @@ jobs: run: ./scripts/create_build_tag_file.sh - name: "Build local shiv package" run: ./scripts/build_shiv_package.sh - - name: "Run smoke tests" + - name: "Run deploy tests" run: ./tests/deploy/run-deploy-test.sh diff --git a/tests/deploy/run-deploy-test.sh b/tests/deploy/run-deploy-test.sh index 291799a4..8e84a6b5 100755 --- a/tests/deploy/run-deploy-test.sh +++ b/tests/deploy/run-deploy-test.sh @@ -24,6 +24,14 @@ mkdir -p $CERC_REPO_BASE_DIR $TEST_TARGET_SO --stack test setup-repositories $TEST_TARGET_SO --stack test build-containers $TEST_TARGET_SO --stack test deploy up +# Test deploy port command +deploy_port_output=$( $TEST_TARGET_SO --stack test deploy port test 80 ) +if [[ "$deploy_port_output" =~ ^0.0.0.0:[1-9][0-9]* ]]; then + echo "Deploy port test: passed" +else + echo "Deploy port test: FAILED" + exit 1 +fi $TEST_TARGET_SO --stack test deploy down # The next time we bring the container up the volume will be old (from the previous run above) $TEST_TARGET_SO --stack test deploy up