File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,24 @@ setup() {
15
15
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
16
16
}
17
17
18
+ setup_file () {
19
+ # Fail if not running in docker and /etc/getssl already exists
20
+ TEST_FAILED=0
21
+ if [ -d /etc/getssl ]; then
22
+ echo " Test failed: /etc/getssl already exists" >&3
23
+ TEST_FAILED=1
24
+ touch $BATS_RUN_TMPDIR /failed.skip
25
+ return 1
26
+ fi
27
+ }
28
+
29
+ teardown_file () {
30
+ # Cleanup after tests
31
+ if [ ${TEST_FAILED} == 0 ] && [ -d /etc/getssl ]; then
32
+ rm -rf /etc/getssl
33
+ fi
34
+ }
35
+
18
36
@test " Check that config files in /etc/getssl works" {
19
37
if [ -n " $STAGING " ]; then
20
38
skip " Using staging server, skipping internal test"
@@ -23,9 +41,6 @@ setup() {
23
41
CONFIG_FILE=" getssl-http01.cfg"
24
42
setup_environment
25
43
26
- # Fail if not running in docker and /etc/getssl already exists
27
- refute [ -d /etc/getssl ]
28
-
29
44
# Create /etc/getssl/$DOMAIN
30
45
mkdir -p /etc/getssl/${GETSSL_CMD_HOST}
31
46
@@ -62,7 +77,4 @@ setup() {
62
77
assert_line --partial ' copying domain certificate to'
63
78
assert_line --partial ' copying private key to'
64
79
assert_line --partial ' copying CA certificate to'
65
-
66
- # Cleanup previous test
67
- rm -rf /etc/getssl
68
80
}
You can’t perform that action at this time.
0 commit comments