From: Greg Farnum Date: Wed, 25 Sep 2013 23:02:02 +0000 (-0700) Subject: qa: update snaps workunits for allow_new_snaps flag X-Git-Tag: v0.71~71^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca97fae81f2992113d2fc97121d4ddedb2ecbe57;p=ceph.git qa: update snaps workunits for allow_new_snaps flag Test that it works in snaptest-0.sh, and set the flag in all the snap workunits so they continue to function. Signed-off-by: Greg Farnum Reviewed-by: Loic Dachary --- diff --git a/qa/workunits/snaps/snap-rm-diff.sh b/qa/workunits/snaps/snap-rm-diff.sh index 8dff54f58b8b..3d30dc7937a5 100755 --- a/qa/workunits/snaps/snap-rm-diff.sh +++ b/qa/workunits/snaps/snap-rm-diff.sh @@ -1,5 +1,6 @@ #!/bin/sh -ex +ceph mds set allow_new_snaps --yes-i-really-mean-it wget -q http://ceph.com/qa/linux-2.6.33.tar.bz2 mkdir foo cp linux* foo diff --git a/qa/workunits/snaps/snaptest-0.sh b/qa/workunits/snaps/snaptest-0.sh index 93e747af7dd0..366249e7d254 100755 --- a/qa/workunits/snaps/snaptest-0.sh +++ b/qa/workunits/snaps/snaptest-0.sh @@ -1,7 +1,16 @@ #!/bin/sh -x +expect_failure() { + if [ `"$@"` -e 0 ]; then + return 1 + fi + return 0 +} set -e +expect_failure mkdir .snap/foo +ceph mds set allow_new_snaps --yes-i-really-mean-it + echo asdf > foo mkdir .snap/foo grep asdf .snap/foo/foo @@ -14,4 +23,7 @@ grep asdf .snap/bar/bar rmdir .snap/bar rm foo +ceph mds unset allow_new_snaps --yes-i-really-mean-it +expect_failure mkdir .snap/baz + echo OK \ No newline at end of file diff --git a/qa/workunits/snaps/snaptest-1.sh b/qa/workunits/snaps/snaptest-1.sh index 59d41ef688f4..7c528dd432a0 100755 --- a/qa/workunits/snaps/snaptest-1.sh +++ b/qa/workunits/snaps/snaptest-1.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + echo 1 > file1 echo 2 > file2 echo 3 > file3 diff --git a/qa/workunits/snaps/snaptest-2.sh b/qa/workunits/snaps/snaptest-2.sh index 4b67999921c9..b73bf9cb97f2 100755 --- a/qa/workunits/snaps/snaptest-2.sh +++ b/qa/workunits/snaps/snaptest-2.sh @@ -1,5 +1,7 @@ #!/bin/bash +ceph mds set allow_new_snaps --yes-i-really-mean-it + echo "Create dir 100 to 199 ..." for i in $(seq 100 199); do echo " create dir $i" diff --git a/qa/workunits/snaps/snaptest-authwb.sh b/qa/workunits/snaps/snaptest-authwb.sh index 128efb70d19c..acbb599bda97 100755 --- a/qa/workunits/snaps/snaptest-authwb.sh +++ b/qa/workunits/snaps/snaptest-authwb.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + touch foo chmod +x foo mkdir .snap/s diff --git a/qa/workunits/snaps/snaptest-capwb.sh b/qa/workunits/snaps/snaptest-capwb.sh index 8c5a1333b691..9d0568cb6dbe 100755 --- a/qa/workunits/snaps/snaptest-capwb.sh +++ b/qa/workunits/snaps/snaptest-capwb.sh @@ -4,6 +4,8 @@ set -e mkdir foo +ceph mds set allow_new_snaps --yes-i-really-mean-it + # make sure mds handles it when the client does not send flushsnap echo x > foo/x sync diff --git a/qa/workunits/snaps/snaptest-dir-rename.sh b/qa/workunits/snaps/snaptest-dir-rename.sh index e81edf9c47f5..6995f537a476 100755 --- a/qa/workunits/snaps/snaptest-dir-rename.sh +++ b/qa/workunits/snaps/snaptest-dir-rename.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + # # make sure we keep an existing dn's seq # diff --git a/qa/workunits/snaps/snaptest-double-null.sh b/qa/workunits/snaps/snaptest-double-null.sh index cdf32e4f0ef6..5a673ff9c0df 100755 --- a/qa/workunits/snaps/snaptest-double-null.sh +++ b/qa/workunits/snaps/snaptest-double-null.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + # multiple intervening snapshots with no modifications, and thus no # snapflush client_caps messages. make sure the mds can handle this. diff --git a/qa/workunits/snaps/snaptest-estale.sh b/qa/workunits/snaps/snaptest-estale.sh index a4fb94368d4c..31ba5a876592 100755 --- a/qa/workunits/snaps/snaptest-estale.sh +++ b/qa/workunits/snaps/snaptest-estale.sh @@ -1,5 +1,7 @@ #!/bin/sh -x +ceph mds set allow_new_snaps --yes-i-really-mean-it + mkdir .snap/foo echo "We want ENOENT, not ESTALE, here." diff --git a/qa/workunits/snaps/snaptest-git-ceph.sh b/qa/workunits/snaps/snaptest-git-ceph.sh index 11532d8b14b4..71a71e1d4696 100755 --- a/qa/workunits/snaps/snaptest-git-ceph.sh +++ b/qa/workunits/snaps/snaptest-git-ceph.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + git clone git://ceph.com/git/ceph.git cd ceph diff --git a/qa/workunits/snaps/snaptest-intodir.sh b/qa/workunits/snaps/snaptest-intodir.sh index 3cbbe01718e5..d022cfd479e2 100755 --- a/qa/workunits/snaps/snaptest-intodir.sh +++ b/qa/workunits/snaps/snaptest-intodir.sh @@ -1,5 +1,7 @@ #!/bin/sh -ex +ceph mds set allow_new_snaps --yes-i-really-mean-it + # this tests fix for #1399 mkdir foo mkdir foo/.snap/one diff --git a/qa/workunits/snaps/snaptest-multiple-capsnaps.sh b/qa/workunits/snaps/snaptest-multiple-capsnaps.sh index 5ebc852cf6c7..d88722bde090 100755 --- a/qa/workunits/snaps/snaptest-multiple-capsnaps.sh +++ b/qa/workunits/snaps/snaptest-multiple-capsnaps.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + echo asdf > a mkdir .snap/1 chmod 777 a diff --git a/qa/workunits/snaps/snaptest-parents.sh b/qa/workunits/snaps/snaptest-parents.sh index 7e5241a27c03..8963f628dc86 100644 --- a/qa/workunits/snaps/snaptest-parents.sh +++ b/qa/workunits/snaps/snaptest-parents.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + echo "making directory tree and files" mkdir -p 1/a/b/c/ echo "i'm file1" > 1/a/file1 diff --git a/qa/workunits/snaps/snaptest-snap-rm-cmp.sh b/qa/workunits/snaps/snaptest-snap-rm-cmp.sh index aa094e70789f..68ecf37b73e6 100755 --- a/qa/workunits/snaps/snaptest-snap-rm-cmp.sh +++ b/qa/workunits/snaps/snaptest-snap-rm-cmp.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + file=linux-2.6.33.tar.bz2 wget -q http://ceph.com/qa/$file diff --git a/qa/workunits/snaps/snaptest-upchildrealms.sh b/qa/workunits/snaps/snaptest-upchildrealms.sh index 63b7167b42d3..b5b8830e9f02 100755 --- a/qa/workunits/snaps/snaptest-upchildrealms.sh +++ b/qa/workunits/snaps/snaptest-upchildrealms.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + # # verify that a snap update on a parent realm will induce # snap cap writeback for inodes child realms diff --git a/qa/workunits/snaps/snaptest-xattrwb.sh b/qa/workunits/snaps/snaptest-xattrwb.sh index b2dd7bc748af..c36e25758455 100755 --- a/qa/workunits/snaps/snaptest-xattrwb.sh +++ b/qa/workunits/snaps/snaptest-xattrwb.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + echo "testing simple xattr wb" touch x setfattr -n user.foo x diff --git a/qa/workunits/snaps/untar_snap_rm.sh b/qa/workunits/snaps/untar_snap_rm.sh index 5c71212df75a..89e2db0cd101 100755 --- a/qa/workunits/snaps/untar_snap_rm.sh +++ b/qa/workunits/snaps/untar_snap_rm.sh @@ -2,6 +2,8 @@ set -e +ceph mds set allow_new_snaps --yes-i-really-mean-it + do_tarball() { wget http://ceph.com/qa/$1 tar xvf$2 $1