Support reading from snapshots encrypted with different keys

This commit is contained in:
Vitaliy Filippov
2026-03-20 21:00:32 +03:00
parent e6c3f4c6f4
commit de7edfd31d
13 changed files with 322 additions and 140 deletions
+1
View File
@@ -57,6 +57,7 @@ OLD=1 ./test_move_reappear.sh
./test_snapshot_chain.sh
SCHEME=ec ./test_snapshot_chain.sh
ENCRYPTED=1 ./test_snapshot_chain.sh
OLD=1 ./test_snapshot_chain.sh
OLD=1 SCHEME=ec ./test_snapshot_chain.sh
+8
View File
@@ -1,11 +1,15 @@
#!/bin/bash -ex
ENCRYPTED=${ENCRYPTED:-}
. `dirname $0`/run_3osds.sh
check_qemu
# Test multiple snapshots
$VITASTOR_CLI create -s 32M testchain
if [[ -n "$ENCRYPTED" ]]; then
$ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testchain","size":33554432,"enc_key":"'$(openssl rand -hex 64)'"}'
fi
$VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \
-image=testchain -mirror_file=./testdata/bin/mirror.bin
@@ -13,6 +17,10 @@ $VITASTOR_FIO -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \
for i in {1..10}; do
# Create a snapshot
$VITASTOR_CLI snap-create testchain@$i
if [[ -n "$ENCRYPTED" ]]; then
# Generate different keys for each layer
$ETCDCTL put /vitastor/config/inode/1/$((i+1)) '{"name":"testchain","parent_id":'$((i))',"size":33554432,"enc_key":"'$(openssl rand -hex 64)'"}'
fi
# Check that the new snapshot is see-through
qemu-img convert -p \
-f raw "vitastor:config_path=$VITASTOR_CFG:image=testchain" \