summaryrefslogtreecommitdiff
path: root/secrets/test/buckets.sh
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-11-18 17:34:25 +0000
committerIgor Soarez <igor@soarez.org>2026-11-18 17:34:25 +0000
commit9249082857d407dde4e22e672b615631a294279e (patch)
treec5f8ce2e90b5172dbe3dab557e03d9ba6dbc4971 /secrets/test/buckets.sh
parentbb723d867c380ef56917dc4c7836d33b940c6a69 (diff)
szecret get-local/put-local: find the store's key in a bucket too, not only in the old store
Diffstat (limited to 'secrets/test/buckets.sh')
-rwxr-xr-xsecrets/test/buckets.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/secrets/test/buckets.sh b/secrets/test/buckets.sh
index b021c3c..2703952 100755
--- a/secrets/test/buckets.sh
+++ b/secrets/test/buckets.sh
@@ -245,6 +245,18 @@ test_check_missing_plugin() {
pass "check: flags a key type this machine can't encrypt to"
}
+test_local_store_key_in_bucket() {
+ local d="${TEST_DIR}/repo-store"
+ mkdir -p "${d}"
+ SZECRET_BUCKETS="" szecret create-local inrepo "${d}" >/dev/null 2>&1 || fail "create-local"
+ echo "local1" | szecret put-local "${d}/v.age" 2>/dev/null || fail "put-local before the move"
+ szecret mv local-key-inrepo mine 2>/dev/null || fail "mv local-key-inrepo"
+ assert_equals "local1" "$(szecret get-local "${d}/v.age")" "get-local with its key in a bucket"
+ echo "local2" | szecret put-local "${d}/v.age" 2>/dev/null || fail "put-local after the move"
+ assert_equals "local2" "$(szecret get-local "${d}/v.age")" "put-local with its key in a bucket"
+ pass "get-local/put-local: an old-style repository store whose key moved to a bucket"
+}
+
test_ready() {
szecret ready || fail "ready with an identity"
SZECRET_STORE="" SZECRET_PRIVATE_KEY="${TEST_DIR}/none" szecret ready || fail "ready with only buckets and an identity"
@@ -269,6 +281,7 @@ test_no_admins
test_admin_change_needs_rekey
test_list
test_check_ok
+test_local_store_key_in_bucket
test_check_stanza_types
test_check_missing_plugin
test_ready