From ea831390aa9740b7c0813456301eff36e54dd679 Mon Sep 17 00:00:00 2001 From: Timothe Litt Date: Sat, 31 Jul 2021 08:22:59 -0400 Subject: [PATCH] Skip all tests after first failure From https://github.com/sstephenson/bats/issues/135 via @timkimber --- test/1-simple-http01-dig.bats | 2 ++ test/1-simple-http01-nslookup.bats | 2 ++ test/1-simple-http01-two-acl.bats | 5 +++ test/1-simple-http01.bats | 5 +++ test/10-mixed-case.bats | 5 +++ test/11-test--install.bats | 5 +++ test/11-test-no-domain-storage.bats | 7 ++++ test/12-auto-upgrade-v1.bats | 35 +++++++++++++++++++ test/13-notify-valid.bats | 5 +++ test/14-test-revoke.bats | 5 +++ test/15-test-revoke-no-suffix.bats | 5 +++ test/16-test-bad-acl.bats | 5 +++ test/17-test-spaces-in-sans-dns01.bats | 5 +++ test/17-test-spaces-in-sans-http01.bats | 5 +++ test/18-retry-dns-add.bats | 5 +++ test/19-test-add-to-sans.bats | 2 ++ test/2-simple-dns01-dig.bats | 14 ++++++++ test/2-simple-dns01-nslookup.bats | 2 ++ test/20-wildcard-simple.bats | 5 +++ test/21-wildcard-dual-rsa.bats | 5 +++ ...dcard-dual-rsa-ecdsa-copy-2-locations.bats | 5 +++ test/23-wildcard-check-globbing.bats | 5 +++ test/24-wildcard-sans.bats | 2 ++ test/25-wildcard-all.bats | 5 +++ test/26-wildcard-revoke.bats | 5 +++ test/27-wildcard-existing-cert.bats | 5 +++ test/28-wildcard-error-http01-validation.bats | 5 +++ test/29-check-mktemp-failure.bats | 5 +++ test/3-dual-rsa-ecdsa.bats | 5 +++ test/30-handle-dig-failure.bats | 2 ++ test/31-test-posix-error.bats | 5 +++ test/32-test-upgrade.bats | 2 ++ test/33-ftp.bats | 2 ++ test/34-ftp-passive.bats | 2 ++ test/35-preferred-chain.bats | 5 +++ test/36-full-chain-inc-root.bats | 5 +++ test/37-idn.bats | 2 ++ test/38-idn-http01-check-noidnout.bats | 5 +++ test/4-more-than-10-hosts.bats | 5 +++ test/5-secp384-http01.bats | 5 +++ test/6-dual-rsa-ecdsa-copy-2-locations.bats | 2 ++ test/7-test-renewal.bats | 2 ++ test/8-staging-ecdsa.bats | 28 +++++++++++++++ test/9-multiple-domains-dns01.bats | 5 +++ test/9-test--all.bats | 5 +++ test/u1-test-get_auth_dns-dig.bats | 2 ++ test/u2-test-get_auth_dns-drill.bats | 2 ++ test/u3-mktemp-template.bats | 7 ++++ test/u4-create-csr-and-ifs.bats | 5 +++ .../u5-test-get_auth_dns-no-root-servers.bats | 2 ++ 50 files changed, 271 insertions(+) diff --git a/test/1-simple-http01-dig.bats b/test/1-simple-http01-dig.bats index be01f27..b3c36cc 100644 --- a/test/1-simple-http01-dig.bats +++ b/test/1-simple-http01-dig.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt if [ -f /usr/bin/host ]; then mv /usr/bin/host /usr/bin/host.getssl.bak @@ -18,6 +19,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -f /usr/bin/host.getssl.bak ]; then mv /usr/bin/host.getssl.bak /usr/bin/host fi diff --git a/test/1-simple-http01-nslookup.bats b/test/1-simple-http01-nslookup.bats index 78d175a..65c3669 100644 --- a/test/1-simple-http01-nslookup.bats +++ b/test/1-simple-http01-nslookup.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt if [ -f /usr/bin/dig ]; then mv /usr/bin/dig /usr/bin/dig.getssl.bak @@ -18,6 +19,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -f /usr/bin/dig.getssl.bak ]; then mv /usr/bin/dig.getssl.bak /usr/bin/dig fi diff --git a/test/1-simple-http01-two-acl.bats b/test/1-simple-http01-two-acl.bats index 0169bd0..5a09f60 100644 --- a/test/1-simple-http01-two-acl.bats +++ b/test/1-simple-http01-two-acl.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/1-simple-http01.bats b/test/1-simple-http01.bats index a57010b..543d29b 100644 --- a/test/1-simple-http01.bats +++ b/test/1-simple-http01.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/10-mixed-case.bats b/test/10-mixed-case.bats index 974f669..9ec0e35 100644 --- a/test/10-mixed-case.bats +++ b/test/10-mixed-case.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/11-test--install.bats b/test/11-test--install.bats index e034326..0d015ee 100644 --- a/test/11-test--install.bats +++ b/test/11-test--install.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/11-test-no-domain-storage.bats b/test/11-test-no-domain-storage.bats index 3be0be5..92cade4 100644 --- a/test/11-test-no-domain-storage.bats +++ b/test/11-test-no-domain-storage.bats @@ -5,6 +5,13 @@ load '/bats-assert/load.bash' load '/getssl/test/test_helper.bash' +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check that if domain storage isn't set getssl doesn't try to delete /tmp" { if [ -n "$STAGING" ]; then skip "Using staging server, skipping internal test" diff --git a/test/12-auto-upgrade-v1.bats b/test/12-auto-upgrade-v1.bats index 4165cd3..b63acfb 100644 --- a/test/12-auto-upgrade-v1.bats +++ b/test/12-auto-upgrade-v1.bats @@ -5,6 +5,13 @@ load '/bats-assert/load.bash' load '/getssl/test/test_helper.bash' +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check that auto upgrade to v2 doesn't change pebble url" { if [ -n "$STAGING" ]; then skip "Using staging server, skipping internal test" @@ -19,6 +26,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check that auto upgrade to v2 doesn't change v2 staging url" { if [ -n "$STAGING" ]; then skip "Using staging server, skipping internal test" @@ -33,6 +47,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check that auto upgrade to v2 doesn't change v2 prod url" { if [ -n "$STAGING" ]; then skip "Using staging server, skipping internal test" @@ -47,6 +68,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check that auto upgrade to v2 changes v1 staging to v2 staging url" { if [ -n "$STAGING" ]; then skip "Using staging server, skipping internal test" @@ -61,6 +89,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check that auto upgrade to v2 changes v1 prod to v2 prod url" { if [ -n "$STAGING" ]; then skip "Using staging server, skipping internal test" diff --git a/test/13-notify-valid.bats b/test/13-notify-valid.bats index ac1a50c..199f165 100644 --- a/test/13-notify-valid.bats +++ b/test/13-notify-valid.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/14-test-revoke.bats b/test/14-test-revoke.bats index d31e832..86be2e2 100644 --- a/test/14-test-revoke.bats +++ b/test/14-test-revoke.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/15-test-revoke-no-suffix.bats b/test/15-test-revoke-no-suffix.bats index 30802d8..d2272fc 100644 --- a/test/15-test-revoke-no-suffix.bats +++ b/test/15-test-revoke-no-suffix.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/16-test-bad-acl.bats b/test/16-test-bad-acl.bats index d953951..abf365c 100644 --- a/test/16-test-bad-acl.bats +++ b/test/16-test-bad-acl.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/17-test-spaces-in-sans-dns01.bats b/test/17-test-spaces-in-sans-dns01.bats index 9d425af..9eb2c32 100644 --- a/test/17-test-spaces-in-sans-dns01.bats +++ b/test/17-test-spaces-in-sans-dns01.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/17-test-spaces-in-sans-http01.bats b/test/17-test-spaces-in-sans-http01.bats index 1730e99..5fc4eb4 100644 --- a/test/17-test-spaces-in-sans-http01.bats +++ b/test/17-test-spaces-in-sans-http01.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/18-retry-dns-add.bats b/test/18-retry-dns-add.bats index 25318de..68e508f 100644 --- a/test/18-retry-dns-add.bats +++ b/test/18-retry-dns-add.bats @@ -5,7 +5,12 @@ load '/bats-assert/load.bash' load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/19-test-add-to-sans.bats b/test/19-test-add-to-sans.bats index a0a6d71..7f96929 100644 --- a/test/19-test-add-to-sans.bats +++ b/test/19-test-add-to-sans.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt curl --silent -X POST -d '{"host":"a.'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/add-a @@ -14,6 +15,7 @@ setup() { } teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -z "$STAGING" ]; then curl --silent -X POST -d '{"host":"a.'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/clear-a fi diff --git a/test/2-simple-dns01-dig.bats b/test/2-simple-dns01-dig.bats index a0d70a2..e62e903 100644 --- a/test/2-simple-dns01-dig.bats +++ b/test/2-simple-dns01-dig.bats @@ -28,6 +28,13 @@ teardown_file() { } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Create new certificate using DNS-01 verification (dig)" { CONFIG_FILE="getssl-dns01.cfg" @@ -40,6 +47,13 @@ teardown_file() { } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Force renewal of certificate using DNS-01 (dig)" { run ${CODE_DIR}/getssl -d -f $GETSSL_HOST assert_success diff --git a/test/2-simple-dns01-nslookup.bats b/test/2-simple-dns01-nslookup.bats index f97b5dc..8ff465d 100644 --- a/test/2-simple-dns01-nslookup.bats +++ b/test/2-simple-dns01-nslookup.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi @@ -20,6 +21,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -f /usr/bin/dig.getssl.bak ]; then mv /usr/bin/dig.getssl.bak /usr/bin/dig fi diff --git a/test/20-wildcard-simple.bats b/test/20-wildcard-simple.bats index b56a876..e68810b 100644 --- a/test/20-wildcard-simple.bats +++ b/test/20-wildcard-simple.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/21-wildcard-dual-rsa.bats b/test/21-wildcard-dual-rsa.bats index 550bbe0..16a8d97 100644 --- a/test/21-wildcard-dual-rsa.bats +++ b/test/21-wildcard-dual-rsa.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/22-wildcard-dual-rsa-ecdsa-copy-2-locations.bats b/test/22-wildcard-dual-rsa-ecdsa-copy-2-locations.bats index b005af5..e397ac8 100644 --- a/test/22-wildcard-dual-rsa-ecdsa-copy-2-locations.bats +++ b/test/22-wildcard-dual-rsa-ecdsa-copy-2-locations.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # These are run for every test, not once per file +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/23-wildcard-check-globbing.bats b/test/23-wildcard-check-globbing.bats index 1c812b1..8566b88 100644 --- a/test/23-wildcard-check-globbing.bats +++ b/test/23-wildcard-check-globbing.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/24-wildcard-sans.bats b/test/24-wildcard-sans.bats index a9ca2a5..74a1e5e 100644 --- a/test/24-wildcard-sans.bats +++ b/test/24-wildcard-sans.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt curl --silent -X POST -d '{"host":"wild-'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/add-a @@ -15,6 +16,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -z "$STAGING" ]; then curl --silent -X POST -d '{"host":"wild-'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/clear-a fi diff --git a/test/25-wildcard-all.bats b/test/25-wildcard-all.bats index 8e428ab..a9b0380 100644 --- a/test/25-wildcard-all.bats +++ b/test/25-wildcard-all.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/26-wildcard-revoke.bats b/test/26-wildcard-revoke.bats index 37f8f10..3be9bcd 100644 --- a/test/26-wildcard-revoke.bats +++ b/test/26-wildcard-revoke.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/27-wildcard-existing-cert.bats b/test/27-wildcard-existing-cert.bats index 76f2aa7..0c69389 100644 --- a/test/27-wildcard-existing-cert.bats +++ b/test/27-wildcard-existing-cert.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/28-wildcard-error-http01-validation.bats b/test/28-wildcard-error-http01-validation.bats index dbb64b7..bf8a7f2 100644 --- a/test/28-wildcard-error-http01-validation.bats +++ b/test/28-wildcard-error-http01-validation.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/29-check-mktemp-failure.bats b/test/29-check-mktemp-failure.bats index 782dc64..9fcd710 100644 --- a/test/29-check-mktemp-failure.bats +++ b/test/29-check-mktemp-failure.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/3-dual-rsa-ecdsa.bats b/test/3-dual-rsa-ecdsa.bats index 87527c2..c4c06e8 100644 --- a/test/3-dual-rsa-ecdsa.bats +++ b/test/3-dual-rsa-ecdsa.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/30-handle-dig-failure.bats b/test/30-handle-dig-failure.bats index 1102745..6ea5803 100644 --- a/test/30-handle-dig-failure.bats +++ b/test/30-handle-dig-failure.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt if [ -f /usr/bin/drill ]; then mv /usr/bin/drill /usr/bin/drill.getssl.bak @@ -18,6 +19,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -f /usr/bin/drill.getssl.bak ]; then mv /usr/bin/drill.getssl.bak /usr/bin/drill fi diff --git a/test/31-test-posix-error.bats b/test/31-test-posix-error.bats index e9950fd..37d7074 100644 --- a/test/31-test-posix-error.bats +++ b/test/31-test-posix-error.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/32-test-upgrade.bats b/test/32-test-upgrade.bats index 48edf85..77ad362 100644 --- a/test/32-test-upgrade.bats +++ b/test/32-test-upgrade.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt # Turn off warning about detached head @@ -32,6 +33,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip rm -r "$INSTALL_DIR/upgrade-getssl" } diff --git a/test/33-ftp.bats b/test/33-ftp.bats index 9c2e387..1131967 100644 --- a/test/33-ftp.bats +++ b/test/33-ftp.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt if [ -n "${VSFTPD_CONF}" ]; then cp $VSFTPD_CONF ${VSFTPD_CONF}.getssl @@ -23,6 +24,7 @@ _FTP teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -n "${VSFTPD_CONF}" ]; then cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF ${CODE_DIR}/test/restart-ftpd diff --git a/test/34-ftp-passive.bats b/test/34-ftp-passive.bats index 0d16574..b53223d 100644 --- a/test/34-ftp-passive.bats +++ b/test/34-ftp-passive.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt if [ -n "${VSFTPD_CONF}" ]; then cp $VSFTPD_CONF ${VSFTPD_CONF}.getssl @@ -26,6 +27,7 @@ _FTP teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -n "${VSFTPD_CONF}" ]; then cp ${VSFTPD_CONF}.getssl $VSFTPD_CONF ${CODE_DIR}/test/restart-ftpd diff --git a/test/35-preferred-chain.bats b/test/35-preferred-chain.bats index 9c3fc6b..6995925 100644 --- a/test/35-preferred-chain.bats +++ b/test/35-preferred-chain.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/36-full-chain-inc-root.bats b/test/36-full-chain-inc-root.bats index 5b29d0b..1fed1ba 100644 --- a/test/36-full-chain-inc-root.bats +++ b/test/36-full-chain-inc-root.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt fi diff --git a/test/37-idn.bats b/test/37-idn.bats index be624de..04e26fd 100644 --- a/test/37-idn.bats +++ b/test/37-idn.bats @@ -13,6 +13,7 @@ setup_file() { # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" GETSSL_CMD_HOST=${GETSSL_IDN_HOST} # use the test description to move tools we don't want to test out of the way @@ -26,6 +27,7 @@ setup() { } teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip # use the test description to move tools we didn't want to test back DNS_TOOL=${BATS_TEST_DESCRIPTION##*-} for tool in dig drill host nslookup diff --git a/test/38-idn-http01-check-noidnout.bats b/test/38-idn-http01-check-noidnout.bats index fde4fe6..032bc2d 100644 --- a/test/38-idn-http01-check-noidnout.bats +++ b/test/38-idn-http01-check-noidnout.bats @@ -11,7 +11,12 @@ setup_file() { fi } +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" GETSSL_CMD_HOST=$GETSSL_IDN_HOST } diff --git a/test/4-more-than-10-hosts.bats b/test/4-more-than-10-hosts.bats index f4eb95c..2343cc4 100644 --- a/test/4-more-than-10-hosts.bats +++ b/test/4-more-than-10-hosts.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/5-secp384-http01.bats b/test/5-secp384-http01.bats index 3d05159..7e478dc 100644 --- a/test/5-secp384-http01.bats +++ b/test/5-secp384-http01.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/6-dual-rsa-ecdsa-copy-2-locations.bats b/test/6-dual-rsa-ecdsa-copy-2-locations.bats index 6f75f25..93c3349 100644 --- a/test/6-dual-rsa-ecdsa-copy-2-locations.bats +++ b/test/6-dual-rsa-ecdsa-copy-2-locations.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # These are run for every test, not once per file setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt curl --silent -X POST -d '{"host":"'a.$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/add-a @@ -15,6 +16,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -z "$STAGING" ]; then curl --silent -X POST -d '{"host":"'a.$GETSSL_HOST'"}' http://10.30.50.3:8055/clear-a fi diff --git a/test/7-test-renewal.bats b/test/7-test-renewal.bats index 074f882..ceb2966 100644 --- a/test/7-test-renewal.bats +++ b/test/7-test-renewal.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" if [ -z "$STAGING" ]; then export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt curl --silent -X POST -d '{"host":"a.'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/add-a @@ -15,6 +16,7 @@ setup() { } teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip if [ -z "$STAGING" ]; then curl --silent -X POST -d '{"host":"a.'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/clear-a curl --silent -X POST -d '{"host":"b.'$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/clear-a diff --git a/test/8-staging-ecdsa.bats b/test/8-staging-ecdsa.bats index 6aebd60..f3cf611 100644 --- a/test/8-staging-ecdsa.bats +++ b/test/8-staging-ecdsa.bats @@ -7,6 +7,13 @@ load '/getssl/test/test_helper.bash' +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Create new certificate using staging server and prime256v1" { if [ -z "$STAGING" ]; then skip "Running external tests, skipping internal testing" @@ -22,6 +29,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Force renewal of certificate using staging server and prime256v1" { if [ -z "$STAGING" ]; then skip "Running internal tests, skipping external test" @@ -33,6 +47,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Create new certificate using staging server and secp384r1" { if [ -z "$STAGING" ]; then skip "Running external tests, skipping internal testing" @@ -48,6 +69,13 @@ load '/getssl/test/test_helper.bash' } +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Force renewal of certificate using staging server and secp384r1" { if [ -z "$STAGING" ]; then skip "Running internal tests, skipping external test" diff --git a/test/9-multiple-domains-dns01.bats b/test/9-multiple-domains-dns01.bats index 65eab09..af6e059 100644 --- a/test/9-multiple-domains-dns01.bats +++ b/test/9-multiple-domains-dns01.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt } diff --git a/test/9-test--all.bats b/test/9-test--all.bats index cb043a5..f3520c0 100644 --- a/test/9-test--all.bats +++ b/test/9-test--all.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt export PATH=$PATH:/getssl } diff --git a/test/u1-test-get_auth_dns-dig.bats b/test/u1-test-get_auth_dns-dig.bats index ac11c1d..05ec0b7 100644 --- a/test/u1-test-get_auth_dns-dig.bats +++ b/test/u1-test-get_auth_dns-dig.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" for app in drill host nslookup do if [ -f /usr/bin/${app} ]; then @@ -22,6 +23,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip for app in drill host nslookup do if [ -f /usr/bin/${app}.getssl.bak ]; then diff --git a/test/u2-test-get_auth_dns-drill.bats b/test/u2-test-get_auth_dns-drill.bats index d20079c..ce0fe88 100644 --- a/test/u2-test-get_auth_dns-drill.bats +++ b/test/u2-test-get_auth_dns-drill.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" for app in dig host nslookup do if [ -f /usr/bin/${app} ]; then @@ -22,6 +23,7 @@ setup() { teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip for app in dig host nslookup do if [ -f /usr/bin/${app}.getssl.bak ]; then diff --git a/test/u3-mktemp-template.bats b/test/u3-mktemp-template.bats index 2cb8040..968e0db 100644 --- a/test/u3-mktemp-template.bats +++ b/test/u3-mktemp-template.bats @@ -5,6 +5,13 @@ load '/bats-assert/load.bash' load '/getssl/test/test_helper.bash' +setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" +} +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + @test "Check mktemp -t getssl.XXXXXX works on all platforms" { run mktemp -t getssl.XXXXXX assert_success diff --git a/test/u4-create-csr-and-ifs.bats b/test/u4-create-csr-and-ifs.bats index 344a536..528394d 100644 --- a/test/u4-create-csr-and-ifs.bats +++ b/test/u4-create-csr-and-ifs.bats @@ -6,7 +6,12 @@ load '/getssl/test/test_helper.bash' # This is run for every test +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip +} + setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" . /getssl/getssl --source find_dns_utils _RUNNING_TEST=1 diff --git a/test/u5-test-get_auth_dns-no-root-servers.bats b/test/u5-test-get_auth_dns-no-root-servers.bats index d218eb9..ab0f846 100644 --- a/test/u5-test-get_auth_dns-no-root-servers.bats +++ b/test/u5-test-get_auth_dns-no-root-servers.bats @@ -7,6 +7,7 @@ load '/getssl/test/test_helper.bash' # This is run for every test setup() { + [ ! -f ${BATS_PARENT_TMPNAME}.skip ] || skip "skip remaining tests" cp /etc/resolv.conf /etc/resolv.conf.getssl cat <<- EOF > /etc/resolv.conf nameserver 8.8.8.8 @@ -28,6 +29,7 @@ EOF teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch ${BATS_PARENT_TMPNAME}.skip cat /etc/resolv.conf.getssl > /etc/resolv.conf for app in drill host nslookup do