|
|
|
|
@ -19,6 +19,7 @@ set -x
|
|
|
|
|
# ../bin/update_sops.sh -k "${keys_dir}" -c "${sops_cfg_dir}" -s "${secrets_file}" "${secrets_file}"
|
|
|
|
|
# TEST: induce error: invalid file
|
|
|
|
|
# ../bin/update_sops.sh "${secrets_file}" -s non_existing_secrets.yaml
|
|
|
|
|
set +x
|
|
|
|
|
|
|
|
|
|
# Special Case: Add caveat header
|
|
|
|
|
cat <<EOM > .sops.yaml.tmp
|
|
|
|
|
@ -31,20 +32,25 @@ mv .sops.yaml.tmp .sops.yaml
|
|
|
|
|
# TEST
|
|
|
|
|
# define "fixture"
|
|
|
|
|
repo_root="$(git rev-parse --show-toplevel)"
|
|
|
|
|
read -p "start testing?" __var
|
|
|
|
|
# ---
|
|
|
|
|
>&2 echo "# create sops cfg in curdir: ${PWD}"
|
|
|
|
|
rm .sops.yaml
|
|
|
|
|
../bin/update_sops.sh -c "${PWD}" -s "${secrets_file}"
|
|
|
|
|
test -e "${PWD}/.sops.yaml"
|
|
|
|
|
test ! -e "${repo_root}/.sops.yaml"
|
|
|
|
|
read -p "next test?" __var
|
|
|
|
|
# ---
|
|
|
|
|
>&2 echo "# create sops cfg in default dir: ${repo_root}"
|
|
|
|
|
rm .sops.yaml
|
|
|
|
|
rm "${PWD}/.sops.yaml"
|
|
|
|
|
# note: fail if for any reason sops config defined at top level; this repo should not have this!
|
|
|
|
|
test -e "${repo_root}/.sops.yaml"
|
|
|
|
|
../bin/update_sops.sh -s "${secrets_file}"
|
|
|
|
|
test ! -e "${PWD}/.sops.yaml"
|
|
|
|
|
test -e "${repo_root}/.sops.yaml"
|
|
|
|
|
# teardown
|
|
|
|
|
# enmesh: restore, since this particular one is checked in
|
|
|
|
|
git checkout "${PWD}/.sops.yaml"
|
|
|
|
|
rm "${repo_root}/.sops.yaml"
|
|
|
|
|
echo "WARNING: skipping remaining tests, failing right now"
|
|
|
|
|
exit
|
|
|
|
|
read -p "next test?" __var
|
|
|
|
|
# ---
|
|
|
|
|
>&2 echo "# create sops cfg in curdir: ${PWD}"
|
|
|
|
|
rm .sops.yaml
|
|
|
|
|
../bin/update_sops.sh -c "${PWD}" -s "${secrets_file}"
|
|
|
|
|
test -e "${PWD}/.sops.yaml"
|
|
|
|
|
test ! -e "${repo_root}/.sops.yaml"
|
|
|
|
|
read -p "next test?" __var
|
|
|
|
|
|