From d7e30393084b99a697d18bc0e9640235b36637af Mon Sep 17 00:00:00 2001 From: Timothe Litt Date: Tue, 10 Aug 2021 08:15:15 -0400 Subject: [PATCH] Add a test for unified directories Verify that a unified directory, API V2 is selected. --- test/u6-test-combined-directory.bats | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/u6-test-combined-directory.bats diff --git a/test/u6-test-combined-directory.bats b/test/u6-test-combined-directory.bats new file mode 100644 index 00000000..4ef0d1f4 --- /dev/null +++ b/test/u6-test-combined-directory.bats @@ -0,0 +1,34 @@ +#! /usr/bin/env bats + +load '/bats-support/load.bash' +load '/bats-assert/load.bash' +load '/getssl/test/test_helper.bash' + +# CA with a unified directory (both ACME V1 and V2 at the same URI) +CA="https://api.test4.buypass.no/acme" + +# This is run for every test +setup() { + [ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure" + + . /getssl/getssl --source + + requires curl + _NOMETER="--silent" + + _RUNNING_TEST=1 + _USE_DEBUG=1 +} + + +teardown() { + [ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip +} + + +@test "Check that API V2 is selected in a unified ACME directory." { + obtain_ca_resource_locations + + [ "$API" -eq 2 ] +} +