Skip to content

Commit 03e1a33

Browse files
authored
Merge pull request #707 from srvrco/temp-revert-upgrade-with-make
Temporarily revert changes to upgrade using `make`
2 parents d807ad0 + d013dc5 commit 03e1a33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+383
-417
lines changed

getssl

+54-124
Large diffs are not rendered by default.

test/1-simple-http01-dig.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
setup() {
10-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
10+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1111
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1212
if [ -f /usr/bin/host ]; then
1313
mv /usr/bin/host /usr/bin/host.getssl.bak
@@ -19,7 +19,7 @@ setup() {
1919

2020

2121
teardown() {
22-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
22+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
2323
if [ -f /usr/bin/host.getssl.bak ]; then
2424
mv /usr/bin/host.getssl.bak /usr/bin/host
2525
fi

test/1-simple-http01-nslookup.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
setup() {
10-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
10+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1111
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1212
if [ -f /usr/bin/dig ]; then
1313
mv /usr/bin/dig /usr/bin/dig.getssl.bak
@@ -19,7 +19,7 @@ setup() {
1919

2020

2121
teardown() {
22-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
22+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
2323
if [ -f /usr/bin/dig.getssl.bak ]; then
2424
mv /usr/bin/dig.getssl.bak /usr/bin/dig
2525
fi

test/1-simple-http01-two-acl.bats

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1616
}
1717

@@ -23,9 +23,9 @@ setup() {
2323
CONFIG_FILE="getssl-http01-two-acl.cfg"
2424
setup_environment
2525
init_getssl
26-
create_certificate -d
26+
create_certificate
2727
assert_success
2828
assert_output --partial "to /var/www/html/.well-known/acme-challenge"
2929
assert_output --partial "to /var/webroot/html/.well-known/acme-challenge"
30-
check_output_for_errors "debug"
30+
check_output_for_errors
3131
}

test/1-simple-http01.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1616
}
1717

test/10-mixed-case.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
if [ -z "$STAGING" ]; then
1616
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1717
fi

test/11-test--install.bats

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1616
}
1717

@@ -38,8 +38,8 @@ setup() {
3838

3939
assert_success
4040
check_output_for_errors
41-
assert_line 'Verification completed, obtaining certificate.'
42-
assert_line 'Requesting certificate'
41+
assert_line --partial 'Verification completed, obtaining certificate.'
42+
assert_line --partial 'Requesting certificate'
4343
refute [ -d '$HOME/.getssl' ]
4444
}
4545

@@ -57,8 +57,8 @@ setup() {
5757

5858
assert_success
5959
check_output_for_errors
60-
refute_line 'Verification completed, obtaining certificate.'
61-
refute_line 'Requesting certificate'
60+
refute_line --partial 'Verification completed, obtaining certificate.'
61+
refute_line --partial 'Requesting certificate'
6262
assert_line --partial 'copying domain certificate to'
6363
assert_line --partial 'copying private key to'
6464
assert_line --partial 'copying CA certificate to'

test/11-test-no-domain-storage.bats

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ load '/getssl/test/test_helper.bash'
66

77

88
setup() {
9-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
9+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1010
}
1111
teardown() {
12-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
12+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1313
}
1414

1515
@test "Check that if domain storage isn't set getssl doesn't try to delete /tmp" {
@@ -23,5 +23,5 @@ teardown() {
2323
run ${CODE_DIR}/getssl -U -d -a
2424
assert_success
2525
check_output_for_errors
26-
assert_line 'Not going to delete TEMP_DIR ///tmp as it appears to be /tmp'
26+
assert_line --partial 'Not going to delete TEMP_DIR ///tmp as it appears to be /tmp'
2727
}

test/12-auto-upgrade-v1.bats

+10-35
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ load '/getssl/test/test_helper.bash'
66

77

88
setup() {
9-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
9+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1010
}
11+
12+
1113
teardown() {
12-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
14+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1315
}
1416

17+
1518
@test "Check that auto upgrade to v2 doesn't change pebble url" {
1619
if [ -n "$STAGING" ]; then
1720
skip "Using staging server, skipping internal test"
@@ -22,17 +25,10 @@ teardown() {
2225
cp "${CODE_DIR}/test/test-config/${CONFIG_FILE}" "${INSTALL_DIR}/.getssl/getssl.cfg"
2326
run ${CODE_DIR}/getssl -U -d --check-config "$GETSSL_CMD_HOST"
2427
assert_success
25-
assert_line 'Using certificate issuer: https://pebble:14000/dir'
28+
assert_line --partial 'Using certificate issuer: https://pebble:14000/dir'
2629
}
2730

2831

29-
setup() {
30-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
31-
}
32-
teardown() {
33-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
34-
}
35-
3632
@test "Check that auto upgrade to v2 doesn't change v2 staging url" {
3733
if [ -n "$STAGING" ]; then
3834
skip "Using staging server, skipping internal test"
@@ -43,17 +39,10 @@ teardown() {
4339
cp "${CODE_DIR}/test/test-config/${CONFIG_FILE}" "${INSTALL_DIR}/.getssl/getssl.cfg"
4440
run ${CODE_DIR}/getssl -U -d --check-config "$GETSSL_CMD_HOST"
4541
assert_success
46-
assert_line 'Using certificate issuer: https://acme-staging-v02.api.letsencrypt.org/directory'
42+
assert_line --partial 'Using certificate issuer: https://acme-staging-v02.api.letsencrypt.org/directory'
4743
}
4844

4945

50-
setup() {
51-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
52-
}
53-
teardown() {
54-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
55-
}
56-
5746
@test "Check that auto upgrade to v2 doesn't change v2 prod url" {
5847
if [ -n "$STAGING" ]; then
5948
skip "Using staging server, skipping internal test"
@@ -64,17 +53,10 @@ teardown() {
6453
cp "${CODE_DIR}/test/test-config/${CONFIG_FILE}" "${INSTALL_DIR}/.getssl/getssl.cfg"
6554
run ${CODE_DIR}/getssl -U -d --check-config "$GETSSL_CMD_HOST"
6655
assert_success
67-
assert_line 'Using certificate issuer: https://acme-v02.api.letsencrypt.org/directory'
56+
assert_line --partial 'Using certificate issuer: https://acme-v02.api.letsencrypt.org/directory'
6857
}
6958

7059

71-
setup() {
72-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
73-
}
74-
teardown() {
75-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
76-
}
77-
7860
@test "Check that auto upgrade to v2 changes v1 staging to v2 staging url" {
7961
if [ -n "$STAGING" ]; then
8062
skip "Using staging server, skipping internal test"
@@ -85,17 +67,10 @@ teardown() {
8567
cp "${CODE_DIR}/test/test-config/${CONFIG_FILE}" "${INSTALL_DIR}/.getssl/getssl.cfg"
8668
run ${CODE_DIR}/getssl -U -d --check-config "$GETSSL_CMD_HOST"
8769
assert_success
88-
assert_line 'Using certificate issuer: https://acme-staging-v02.api.letsencrypt.org/directory'
70+
assert_line --partial 'Using certificate issuer: https://acme-staging-v02.api.letsencrypt.org/directory'
8971
}
9072

9173

92-
setup() {
93-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
94-
}
95-
teardown() {
96-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
97-
}
98-
9974
@test "Check that auto upgrade to v2 changes v1 prod to v2 prod url" {
10075
if [ -n "$STAGING" ]; then
10176
skip "Using staging server, skipping internal test"
@@ -106,5 +81,5 @@ teardown() {
10681
cp "${CODE_DIR}/test/test-config/${CONFIG_FILE}" "${INSTALL_DIR}/.getssl/getssl.cfg"
10782
run ${CODE_DIR}/getssl -U -d --check-config "$GETSSL_CMD_HOST"
10883
assert_success
109-
assert_line 'Using certificate issuer: https://acme-v02.api.letsencrypt.org/directory'
84+
assert_line --partial 'Using certificate issuer: https://acme-v02.api.letsencrypt.org/directory'
11085
}

test/13-notify-valid.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1616
}
1717

test/14-test-revoke.bats

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
if [ -z "$STAGING" ]; then
1616
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1717
fi
@@ -45,5 +45,5 @@ setup() {
4545

4646
run ${CODE_DIR}/getssl -U -d --revoke $CERT $KEY $CA
4747
assert_success
48-
check_output_for_errors "debug"
48+
check_output_for_errors
4949
}

test/15-test-revoke-no-suffix.bats

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
if [ -z "$STAGING" ]; then
1616
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1717
fi
@@ -51,5 +51,5 @@ setup() {
5151

5252
run ${CODE_DIR}/getssl -U -d --revoke $CERT $KEY $CA
5353
assert_success
54-
check_output_for_errors "debug"
54+
check_output_for_errors
5555
}

test/16-test-bad-acl.bats

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ load '/getssl/test/test_helper.bash'
77

88
# This is run for every test
99
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
10+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1111
}
1212

1313
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
14+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
1515
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
1616
}
1717

test/17-test-spaces-in-sans-dns01.bats

+21-12
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,32 @@ load '/getssl/test/test_helper.bash'
66

77

88
# This is run for every test
9+
setup() {
10+
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
11+
}
12+
13+
914
teardown() {
10-
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_TMPDIR/failed.skip
15+
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
1116
}
1217

13-
setup() {
14-
[ ! -f $BATS_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
18+
19+
setup_file() {
20+
# Add hosts to DNS (also need to be added as aliases in docker-compose.yml)
1521
if [ -z "$STAGING" ]; then
1622
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
23+
for prefix in a b c; do
24+
curl --silent -X POST -d '{"host":"'$prefix.$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/add-a
25+
done
26+
fi
27+
}
28+
29+
30+
teardown_file() {
31+
if [ -z "$STAGING" ]; then
32+
for prefix in a b c; do
33+
curl --silent -X POST -d '{"host":"'$prefix.$GETSSL_HOST'"}' http://10.30.50.3:8055/clear-a
34+
done
1735
fi
1836
}
1937

@@ -25,11 +43,6 @@ setup() {
2543
CONFIG_FILE="getssl-dns01-spaces-sans.cfg"
2644
setup_environment
2745

28-
# Add hosts to DNS (also need to be added as aliases in docker-compose.yml)
29-
for prefix in a b c; do
30-
curl --silent -X POST -d '{"host":"'$prefix.$GETSSL_HOST'", "addresses":["'$GETSSL_IP'"]}' http://10.30.50.3:8055/add-a
31-
done
32-
3346
init_getssl
3447
create_certificate
3548
assert_success
@@ -85,8 +98,4 @@ setup() {
8598
assert_success
8699
check_output_for_errors
87100
cleanup_environment
88-
89-
for prefix in a b c; do
90-
curl --silent -X POST -d '{"host":"'$prefix.$GETSSL_HOST'"}' http://10.30.50.3:8055/clear-a
91-
done
92101
}

0 commit comments

Comments
 (0)