From 38d6d166e024e499a269c2561e12a8f6e3d93254 Mon Sep 17 00:00:00 2001 From: LeeW Date: Mon, 17 Feb 2025 10:38:57 +0100 Subject: [PATCH] TMP: adds in-line test within the verify command --- verify/cmd_sops.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/verify/cmd_sops.sh b/verify/cmd_sops.sh index 4729e4c..1a75905 100755 --- a/verify/cmd_sops.sh +++ b/verify/cmd_sops.sh @@ -26,3 +26,24 @@ cat < .sops.yaml.tmp $( cat .sops.yaml ) EOM mv .sops.yaml.tmp .sops.yaml + +# TEST +# define "fixture" +repo_root="$(git rev-parse --show-toplevel)" +read -p "start testing?" __var +# --- +# create sops cfg in curdir +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 +# --- +# create sops cfg in default (repo root) +rm .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" +read -p "next test?" __var