|
|
|
|
@ -15,8 +15,6 @@ test -e "${secrets_file}" || (yq -n '.demo.credentials.secret = "hunter2"' > "${
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
# SAMPLE COMMANDS - manually uncomment to try out
|
|
|
|
|
# TEST: induce error: invalid file
|
|
|
|
|
# ../bin/update_sops.sh "${secrets_file}" -s non_existing_secrets.yaml
|
|
|
|
|
set +x
|
|
|
|
|
|
|
|
|
|
# Special Case: Add caveat header
|
|
|
|
|
@ -83,6 +81,21 @@ else
|
|
|
|
|
>&2 echo "# INFO: skipping ...."
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
|
if [[ 1 -eq 1 ]]; then
|
|
|
|
|
>&2 echo -e "# ---\n# TEST: induce error: invalid file"
|
|
|
|
|
# dev note: ':' is a noop operator; could also just temporarily disable strict errors
|
|
|
|
|
set -x
|
|
|
|
|
../bin/update_sops.sh "${secrets_file}" -s non_existing_secrets.yaml > /dev/null 2>&1 || :
|
|
|
|
|
set +x
|
|
|
|
|
# teardown
|
|
|
|
|
# not necessary, all tracked in git
|
|
|
|
|
# enmesh: restore, since this particular one is checked in
|
|
|
|
|
git checkout "${PWD}/.sops.yaml" > /dev/null 2>&1
|
|
|
|
|
else
|
|
|
|
|
>&2 echo "# INFO: skipping ...."
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
|
echo "TESTCASES PASSED"
|
|
|
|
|
|