diff options
author | Brad Warren <bmw@eff.org> | 2017-01-05 00:12:50 +0300 |
---|---|---|
committer | Brad Warren <bmw@eff.org> | 2017-01-05 00:12:50 +0300 |
commit | 7fb4e6627c4d8be956628f88c0f49f0f981a24dd (patch) | |
tree | 1a6577ac53eee6e1319f7487aa37f36d8be16fe8 /tests/boulder-integration.sh | |
parent | beb5db805b6d66344672dc484f7f503683bf677d (diff) |
HOOK_TEST++
Diffstat (limited to 'tests/boulder-integration.sh')
-rwxr-xr-x | tests/boulder-integration.sh | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/boulder-integration.sh b/tests/boulder-integration.sh index 38448bbf6..55d3d2fe4 100755 --- a/tests/boulder-integration.sh +++ b/tests/boulder-integration.sh @@ -33,21 +33,30 @@ common() { "$@" } +export HOOK_TEST="/tmp/hook$$" CheckHooks() { EXPECTED="/tmp/expected$$" - echo "wtf.pre" > "$EXPECTED" - echo "wtf2.pre" >> "$EXPECTED" - echo "renew" >> "$EXPECTED" - echo "renew" >> "$EXPECTED" - echo "wtf.post" > "$EXPECTED" - echo "wtf2.post" >> "$EXPECTED" + if [ $(head -n1 $HOOK_TEST) = "wtf.pre" ]; then + echo "wtf2.pre" >> "$EXPECTED" + echo "renew" >> "$EXPECTED" + echo "renew" >> "$EXPECTED" + echo "wtf.post" >> "$EXPECTED" + echo "wtf2.post" >> "$EXPECTED" + else + echo "wtf.pre" >> "$EXPECTED" + echo "renew" >> "$EXPECTED" + echo "renew" >> "$EXPECTED" + echo "wtf2.post" >> "$EXPECTED" + echo "wtf.post" >> "$EXPECTED" + fi + if cmp --quiet "$EXPECTED" "$HOOK_TEST" ; then echo Hooks did not run as expected\; got cat "$HOOK_TEST" echo Expected cat "$EXPECTED" fi - [ -f "$HOOK_TEST" ] && rm -f "$HOOK_TEST" + rm "$HOOK_TEST" } # We start a server listening on the port for the @@ -55,7 +64,6 @@ CheckHooks() { python -m SimpleHTTPServer $http_01_port & python_server_pid=$! -export HOOK_TEST="/tmp/hook$$" common --domains le1.wtf --preferred-challenges tls-sni-01 auth \ --pre-hook 'echo wtf.pre >> "$HOOK_TEST"' \ --post-hook 'echo wtf.post >> "$HOOK_TEST"'\ @@ -70,8 +78,8 @@ common --domains le2.wtf --preferred-challenges http-01 run \ kill $python_server_pid common certonly -a manual -d le.wtf --rsa-key-size 4096 \ - --manual-auth-hook ./tests/manual-http-auth.sh \ - --manual-cleanup-hook ./tests/manual-http-cleanup.sh + --manual-auth-hook 'echo wtf2.auth >> "$HOOK_TEST" && ./tests/manual-http-auth.sh' \ + --manual-cleanup-hook 'echo wtf2.cleanup >> "$HOOK_TEST" && ./tests/manual-http-cleanup.sh' \ --pre-hook 'echo wtf2.pre >> "$HOOK_TEST"' \ --post-hook 'echo wtf2.post >> "$HOOK_TEST"' |