]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rbd/read-flags.sh
4 # create a snapshot, then export it and check that setting read flags works
5 # by looking at --debug-ms output
9 rbd snap remove
test@snap || true
13 function test_read_flags
{
16 local SET_LOCALIZED
=$3
17 local EXPECT_BALANCED
=$4
18 local EXPECT_LOCALIZED
=$5
20 local EXTRA_ARGS
="--log-file test.log --debug-ms 1 --no-log-to-stderr"
21 if [ "$SET_BALANCED" = 'y' ]; then
22 EXTRA_ARGS
="$EXTRA_ARGS --rbd-balance-snap-reads"
23 elif [ "$SET_LOCALIZED" = 'y' ]; then
24 EXTRA_ARGS
="$EXTRA_ARGS --rbd-localize-snap-reads"
27 rbd
export $IMAGE - $EXTRA_ARGS > /dev
/null
28 if [ "$EXPECT_BALANCED" = 'y' ]; then
29 grep -q balance_reads
test.log
31 grep -L balance_reads
test.log |
grep -q test.log
33 if [ "$EXPECT_LOCALIZED" = 'y' ]; then
34 grep -q localize_reads
test.log
36 grep -L localize_reads
test.log |
grep -q test.log
44 trap clean_up INT TERM EXIT
46 rbd create
--image-feature layering
-s 10 test
47 rbd snap create
test@snap
49 # export from non snapshot with or without settings should not have flags
50 test_read_flags
test n n n n
51 test_read_flags
test y y n n
53 # export from snapshot should have read flags in log if they are set
54 test_read_flags
test@snap n n n n
55 test_read_flags
test@snap y n y n
56 test_read_flags
test@snap n y n y
58 # balanced_reads happens to take priority over localize_reads
59 test_read_flags
test@snap y y y n