-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #565 from srvrco/revoke-error
- Loading branch information
Showing
3 changed files
with
167 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#! /usr/bin/env bats | ||
|
||
load '/bats-support/load.bash' | ||
load '/bats-assert/load.bash' | ||
load '/getssl/test/test_helper.bash' | ||
|
||
|
||
# This is run for every test | ||
setup() { | ||
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt | ||
} | ||
|
||
|
||
@test "Create certificate to check valid exit code" { | ||
if [ -n "$STAGING" ]; then | ||
skip "Using staging server, skipping internal test" | ||
fi | ||
CONFIG_FILE="getssl-http01.cfg" | ||
setup_environment | ||
init_getssl | ||
create_certificate | ||
assert_success | ||
check_output_for_errors | ||
} | ||
|
||
|
||
@test "Check no-renewal needed exits with normal exit code" { | ||
if [ -n "$STAGING" ]; then | ||
skip "Using staging server, skipping internal test" | ||
fi | ||
run ${CODE_DIR}/getssl $GETSSL_HOST | ||
assert_success | ||
check_output_for_errors | ||
} | ||
|
||
|
||
@test "Check no-renewal needed returns 2 if requested" { | ||
if [ -n "$STAGING" ]; then | ||
skip "Using staging server, skipping internal test" | ||
fi | ||
run ${CODE_DIR}/getssl --notify-valid $GETSSL_HOST | ||
assert [ $status == 2 ] | ||
check_output_for_errors | ||
cleanup_environment | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env bats | ||
|
||
load '/bats-support/load.bash' | ||
load '/bats-assert/load.bash' | ||
load '/getssl/test/test_helper.bash' | ||
|
||
|
||
# This is run for every test | ||
setup() { | ||
export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt | ||
} | ||
|
||
|
||
@test "Create certificate to check revoke" { | ||
if [ -n "$STAGING" ]; then | ||
CONFIG_FILE="getssl-staging-dns01.cfg" | ||
else | ||
CONFIG_FILE="getssl-http01.cfg" | ||
fi | ||
. "${CODE_DIR}/test/test-config/${CONFIG_FILE}" | ||
setup_environment | ||
init_getssl | ||
create_certificate | ||
assert_success | ||
check_output_for_errors | ||
} | ||
|
||
|
||
@test "Check we can revoke a certificate" { | ||
if [ -n "$STAGING" ]; then | ||
CONFIG_FILE="getssl-staging-dns01.cfg" | ||
else | ||
CONFIG_FILE="getssl-http01.cfg" | ||
fi | ||
. "${CODE_DIR}/test/test-config/${CONFIG_FILE}" | ||
CERT=${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/${GETSSL_CMD_HOST}.crt | ||
KEY=${INSTALL_DIR}/.getssl/${GETSSL_CMD_HOST}/${GETSSL_CMD_HOST}.key | ||
|
||
run ${CODE_DIR}/getssl -d --revoke $CERT $KEY $CA | ||
assert_success | ||
check_output_for_errors | ||
} |