From c1346a1be8c078b62464dc4b5f0b913dfd7dd240 Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 10 Sep 2020 09:45:27 +0100 Subject: [PATCH] Merge staging server tests into normal tests --- test/10-mixed-case-staging.bats | 22 --------------- test/10-mixed-case.bats | 6 ++-- test/2-simple-dns01-nslookup.bats | 2 +- test/7-staging-dns01-dig.bats | 32 --------------------- test/7-staging-dns01-nslookup.bats | 45 ------------------------------ 5 files changed, 5 insertions(+), 102 deletions(-) delete mode 100644 test/10-mixed-case-staging.bats delete mode 100644 test/7-staging-dns01-dig.bats delete mode 100644 test/7-staging-dns01-nslookup.bats diff --git a/test/10-mixed-case-staging.bats b/test/10-mixed-case-staging.bats deleted file mode 100644 index ea622f7..0000000 --- a/test/10-mixed-case-staging.bats +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env bats - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -load '/getssl/test/test_helper.bash' - - -@test "Check can create certificate if domain is not lowercase using staging server and DuckDNS" { - if [ -z "$STAGING" ]; then - skip "Running internal tests, skipping external test" - fi - - CONFIG_FILE="getssl-staging-dns01.cfg" - GETSSL_CMD_HOST=$(echo $GETSSL_HOST | tr a-z A-Z) - - setup_environment - init_getssl - create_certificate - - assert_success - check_output_for_errors -} diff --git a/test/10-mixed-case.bats b/test/10-mixed-case.bats index b1d8f07..12b787c 100644 --- a/test/10-mixed-case.bats +++ b/test/10-mixed-case.bats @@ -28,9 +28,11 @@ setup() { @test "Check that DNS-01 verification works if the domain is not lowercase" { if [ -n "$STAGING" ]; then - skip "Using staging server, skipping internal test" + CONFIG_FILE="getssl-staging-dns01.cfg" + else + CONFIG_FILE="getssl-dns01.cfg" fi - CONFIG_FILE="getssl-dns01.cfg" + GETSSL_CMD_HOST=$(echo $GETSSL_HOST | tr a-z A-Z) setup_environment diff --git a/test/2-simple-dns01-nslookup.bats b/test/2-simple-dns01-nslookup.bats index 39c8bae..d13b318 100644 --- a/test/2-simple-dns01-nslookup.bats +++ b/test/2-simple-dns01-nslookup.bats @@ -30,7 +30,7 @@ teardown() { @test "Create new certificate using DNS-01 verification (nslookup)" { CONFIG_FILE="getssl-dns01.cfg" if [ -n "$STAGING" ]; then - CONFIG_FILE="getssl-dns01.cfg" + CONFIG_FILE="getssl-staging-dns01.cfg" fi setup_environment diff --git a/test/7-staging-dns01-dig.bats b/test/7-staging-dns01-dig.bats deleted file mode 100644 index 3d70ce5..0000000 --- a/test/7-staging-dns01-dig.bats +++ /dev/null @@ -1,32 +0,0 @@ -#! /usr/bin/env bats - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -load '/getssl/test/test_helper.bash' - - - -@test "Create new certificate using staging server, dig and DuckDNS" { - skip - if [ -z "$STAGING" ]; then - skip "Running internal tests, skipping external test" - fi - CONFIG_FILE="getssl-staging-dns01.cfg" - - setup_environment - init_getssl - create_certificate - assert_success - check_output_for_errors -} - -@test "Force renewal of certificate using staging server, dig and DuckDNS" { - skip - if [ -z "$STAGING" ]; then - skip "Running internal tests, skipping external test" - fi - run ${CODE_DIR}/getssl -f $GETSSL_HOST - assert_success - check_output_for_errors - cleanup_environment -} diff --git a/test/7-staging-dns01-nslookup.bats b/test/7-staging-dns01-nslookup.bats deleted file mode 100644 index bd8d9da..0000000 --- a/test/7-staging-dns01-nslookup.bats +++ /dev/null @@ -1,45 +0,0 @@ -#! /usr/bin/env bats - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -load '/getssl/test/test_helper.bash' - -# This is run for every test -setup() { - export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt - if [ -f /usr/bin/dig ]; then - mv /usr/bin/dig /usr/bin/dig.getssl.bak - fi -} - - -teardown() { - if [ -f /usr/bin/dig.getssl.bak ]; then - mv /usr/bin/dig.getssl.bak /usr/bin/dig - fi -} - - -@test "Create new certificate using staging server, nslookup and DuckDNS" { - if [ -z "$STAGING" ]; then - skip "Running internal tests, skipping external test" - fi - CONFIG_FILE="getssl-staging-dns01.cfg" - - setup_environment - init_getssl - create_certificate - assert_success - check_output_for_errors "debug" -} - - -@test "Force renewal of certificate using staging server, nslookup and DuckDNS" { - if [ -z "$STAGING" ]; then - skip "Running internal tests, skipping external test" - fi - run ${CODE_DIR}/getssl -f $GETSSL_HOST - assert_success - check_output_for_errors "debug" - cleanup_environment -}