diff --git a/tests/fixtures/gencerts.sh b/tests/fixtures/gencerts.sh index e4226fca0..b2364cb79 100755 --- a/tests/fixtures/gencerts.sh +++ b/tests/fixtures/gencerts.sh @@ -1,15 +1,21 @@ #!/bin/bash -set -e +set -euo pipefail if ! [[ "$0" =~ "./gencerts.sh" ]]; then echo "must be run from 'fixtures'" exit 255 fi -if ! which cfssl; then +if ! command -v cfssl; then echo "cfssl is not installed" - echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssl github.com/cloudflare/cfssl/cmd/cfssljson" + echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssl" + exit 255 +fi + +if ! command -v cfssljson; then + echo "cfssljson is not installed" + echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssljson" exit 255 fi diff --git a/tests/integration/fixtures-expired/gencerts.sh b/tests/integration/fixtures-expired/gencerts.sh index aecdd423b..b15ae25c6 100755 --- a/tests/integration/fixtures-expired/gencerts.sh +++ b/tests/integration/fixtures-expired/gencerts.sh @@ -1,12 +1,21 @@ #!/bin/bash +set -euo pipefail + if ! [[ "$0" =~ "./gencerts.sh" ]]; then echo "must be run from 'fixtures'" exit 255 fi -if ! which cfssl; then +if ! command -v cfssl; then echo "cfssl is not installed" + echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssl" + exit 255 +fi + +if ! command -v cfssljson; then + echo "cfssljson is not installed" + echo "use: go install -mod mod github.com/cloudflare/cfssl/cmd/cfssljson" exit 255 fi