From d0fc0f1423caf3e8162c1a60dbf110b479b5b62b Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 23 Jan 2020 22:49:12 +0000 Subject: [PATCH] Rename tests so they run in sequence, slight cleanup --- ...imple-http01.bats => 1-simple-http01.bats} | 1 + ...{simple-dns01.bats => 2-simple-dns01.bats} | 1 + ...l-rsa-ecdsa.bats => 3-dual-rsa-ecdsa.bats} | 6 ++-- ...0-hosts.bats => 4-more-than-10-hosts.bats} | 3 +- test/run-test-10-hosts.sh | 28 ------------------- test/test_helper.bash | 1 - 6 files changed, 8 insertions(+), 32 deletions(-) rename test/{simple-http01.bats => 1-simple-http01.bats} (96%) rename test/{simple-dns01.bats => 2-simple-dns01.bats} (96%) rename test/{dual-rsa-ecdsa.bats => 3-dual-rsa-ecdsa.bats} (82%) rename test/{more-than-10-hosts.bats => 4-more-than-10-hosts.bats} (89%) delete mode 100644 test/run-test-10-hosts.sh diff --git a/test/simple-http01.bats b/test/1-simple-http01.bats similarity index 96% rename from test/simple-http01.bats rename to test/1-simple-http01.bats index 2d15172..0870348 100644 --- a/test/simple-http01.bats +++ b/test/1-simple-http01.bats @@ -16,6 +16,7 @@ setup() { setup_environment init_getssl create_certificate + assert_success } diff --git a/test/simple-dns01.bats b/test/2-simple-dns01.bats similarity index 96% rename from test/simple-dns01.bats rename to test/2-simple-dns01.bats index 12ba6e0..ce366bc 100644 --- a/test/simple-dns01.bats +++ b/test/2-simple-dns01.bats @@ -16,6 +16,7 @@ setup() { setup_environment init_getssl create_certificate + assert_success } diff --git a/test/dual-rsa-ecdsa.bats b/test/3-dual-rsa-ecdsa.bats similarity index 82% rename from test/dual-rsa-ecdsa.bats rename to test/3-dual-rsa-ecdsa.bats index b340f04..94212bc 100644 --- a/test/dual-rsa-ecdsa.bats +++ b/test/3-dual-rsa-ecdsa.bats @@ -11,11 +11,12 @@ setup() { } -@test "Create creating dual certificates using HTTP-01 verification" { +@test "Create dual certificates using HTTP-01 verification" { CONFIG_FILE="getssl-http01-dual-rsa-ecdsa.cfg" setup_environment init_getssl create_certificate + assert_success } @@ -25,11 +26,12 @@ setup() { assert_success } -@test "Create creating dual certificates using DNS-01 verification" { +@test "Create dual certificates using DNS-01 verification" { CONFIG_FILE="getssl-dns01-dual-rsa-ecdsa.cfg" setup_environment init_getssl create_certificate + assert_success } diff --git a/test/more-than-10-hosts.bats b/test/4-more-than-10-hosts.bats similarity index 89% rename from test/more-than-10-hosts.bats rename to test/4-more-than-10-hosts.bats index 47fb54d..ec92a3f 100644 --- a/test/more-than-10-hosts.bats +++ b/test/4-more-than-10-hosts.bats @@ -22,10 +22,11 @@ setup() { init_getssl create_certificate + assert_success } -@test "Force renewal of all certificates using HTTP-01" { +@test "Force renewal of more than 10 certificates using HTTP-01" { #!FIXME test certificate has been updated run ${CODE_DIR}/getssl -f $HOST assert_success diff --git a/test/run-test-10-hosts.sh b/test/run-test-10-hosts.sh deleted file mode 100644 index 8749186..0000000 --- a/test/run-test-10-hosts.sh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/bash - -set -e - -# Test setup -if [[ -d /root/.getssl ]]; then - rm -r /root/.getssl -fi - -HOST=getssl.test - -wget --no-clobber https://raw.githubusercontent.com/letsencrypt/pebble/master/test/certs/pebble.minica.pem -# cat /etc/pki/tls/certs/ca-bundle.crt /root/pebble.minica.pem > /root/pebble-ca-bundle.crt -cat /etc/ssl/certs/ca-certificates.crt /root/pebble.minica.pem > /root/pebble-ca-bundle.crt -export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt - -for prefix in a b c d e f g h i j k; do - curl -X POST -d '{"host":"'$prefix.$HOST'", "addresses":["10.30.50.4"]}' http://10.30.50.3:8055/add-a -done - -# Test #1 - http-01 verification -echo Test \#1 - http-01 verification - -cp /getssl/test/test-config/nginx-ubuntu-no-ssl /etc/nginx/sites-enabled/default -service nginx restart -/getssl/getssl -c $HOST -cp /getssl/test/test-config/getssl-http01-10-hosts.cfg /root/.getssl/${HOST}/getssl.cfg -/getssl/getssl -f $HOST diff --git a/test/test_helper.bash b/test/test_helper.bash index 5b9ce07..0a9c38f 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -32,6 +32,5 @@ create_certificate() { # Create certificate cp ${CODE_DIR}/test/test-config/${CONFIG_FILE} ${INSTALL_DIR}/.getssl/${HOST}/getssl.cfg run ${CODE_DIR}/getssl $HOST - assert_success #!FIXME test certificate has been placed in the expected location }