Skip to content

Commit

Permalink
test: Fix osd-scrub-scaps.sh to handle DB format change
Browse files Browse the repository at this point in the history
Caused by: f9c95fa

Fixes: https://tracker.ceph.com/issues/48789

Signed-off-by: David Zafman <[email protected]>
  • Loading branch information
dzafman committed Jan 15, 2021
1 parent edd6d3d commit af9befb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions qa/standalone/scrub/osd-scrub-snaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ function create_scenario() {
OBJ5SAVE="$JSON"
# Starts with a snapmap
ceph-kvstore-tool bluestore-kv $dir/${osd} list 2> /dev/null > $dir/drk.log
grep "^m.*SNA_.*[.]1[.]obj5[.][.]$" $dir/drk.log || return 1
grep SNA_ $dir/drk.log
grep "^[pm].*SNA_.*[.]1[.]obj5[.][.]$" $dir/drk.log || return 1
ceph-objectstore-tool --data-path $dir/${osd} --rmtype nosnapmap "$JSON" remove || return 1
# Check that snapmap is stil there
ceph-kvstore-tool bluestore-kv $dir/${osd} list 2> /dev/null > $dir/drk.log
grep "^m.*SNA_.*[.]1[.]obj5[.][.]$" $dir/drk.log || return 1
grep SNA_ $dir/drk.log
grep "^[pm].*SNA_.*[.]1[.]obj5[.][.]$" $dir/drk.log || return 1
rm -f $dir/drk.log

JSON="$(ceph-objectstore-tool --data-path $dir/${osd} --op list obj5 | grep \"snapid\":4)"
Expand All @@ -121,12 +123,14 @@ function create_scenario() {

# Starts with a snapmap
ceph-kvstore-tool bluestore-kv $dir/${osd} list 2> /dev/null > $dir/drk.log
grep "^m.*SNA_.*[.]7[.]obj16[.][.]$" $dir/drk.log || return 1
grep SNA_ $dir/drk.log
grep "^[pm].*SNA_.*[.]7[.]obj16[.][.]$" $dir/drk.log || return 1
JSON="$(ceph-objectstore-tool --data-path $dir/${osd} --op list obj16 | grep \"snapid\":7)"
ceph-objectstore-tool --data-path $dir/${osd} --rmtype snapmap "$JSON" remove || return 1
# Check that snapmap is now removed
ceph-kvstore-tool bluestore-kv $dir/${osd} list 2> /dev/null > $dir/drk.log
! grep "^m.*SNA_.*[.]7[.]obj16[.][.]$" $dir/drk.log || return 1
grep SNA_ $dir/drk.log
! grep "^[pm].*SNA_.*[.]7[.]obj16[.][.]$" $dir/drk.log || return 1
rm -f $dir/drk.log

JSON="$(ceph-objectstore-tool --data-path $dir/${osd} --head --op list obj2)"
Expand Down

0 comments on commit af9befb

Please sign in to comment.