ceph/qa/workunits/snaps/snaptest-0.sh
Yan, Zheng a464558ff7 qa/workunits/snaps: don't assume snapshot is disabled
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-02-05 22:40:39 +08:00

31 lines
462 B
Bash
Executable File

#!/bin/sh -x
expect_failure() {
if [ `"$@"` -e 0 ]; then
return 1
fi
return 0
}
set -e
ceph mds set allow_new_snaps false
expect_failure mkdir .snap/foo
ceph mds set allow_new_snaps true --yes-i-really-mean-it
echo asdf > foo
mkdir .snap/foo
grep asdf .snap/foo/foo
rmdir .snap/foo
echo asdf > bar
mkdir .snap/bar
rm bar
grep asdf .snap/bar/bar
rmdir .snap/bar
rm foo
ceph mds set allow_new_snaps false
expect_failure mkdir .snap/baz
echo OK