Browse Source

Add usage tests (test #722 fix)

release2.46
Tim Kimber 4 years ago
parent
commit
dffa8578d9
No known key found for this signature in database GPG Key ID: 3E1804964E76BD18
1 changed files with 46 additions and 0 deletions
  1. +46
    -0
      test/0-test-usage.bats

+ 46
- 0
test/0-test-usage.bats View File

@ -0,0 +1,46 @@
#! /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
teardown() {
[ -n "$BATS_TEST_COMPLETED" ] || touch $BATS_RUN_TMPDIR/failed.skip
}
setup() {
[ ! -f $BATS_RUN_TMPDIR/failed.skip ] || skip "skipping tests after first failure"
#export CURL_CA_BUNDLE=/root/pebble-ca-bundle.crt
}
@test "Run getssl without any arguments to verify the usage message is shown" {
if [ -n "$STAGING" ]; then
skip "Using staging server, skipping internal test"
fi
run ${CODE_DIR}/getssl
assert_line --partial "Usage: getssl"
assert_success
}
@test "Run getssl with --nocheck and verify the usage message is shown" {
if [ -n "$STAGING" ]; then
skip "Using staging server, skipping internal test"
fi
run ${CODE_DIR}/getssl --nocheck
assert_line --partial "Usage: getssl"
assert_success
}
@test "Run getssl with --upgrade and verify the usage message is NOT shown" {
if [ -n "$STAGING" ]; then
skip "Using staging server, skipping internal test"
fi
run ${CODE_DIR}/getssl --upgrade
refute_output
assert_success
}

Loading…
Cancel
Save