... filesystems other than 'cephfs'.
It is not required to set 'allow_new_snaps' to True to allow snapshot
to be created on a filesystem. Remove that setting.
Remove 'fs/snaps/snaptest-0.sh' that is racy when running in parallel on
an another client that mounted the same file system. Include a similar
test in qa/tasks/cephfs/test_snapshots.py
Signed-off-by: Ramana Raja <rraja@redhat.com>
+import errno
import logging
import signal
from textwrap import dedent
def _get_pending_snap_destroy(self, rank=0, status=None):
return self._get_snapserver_dump(rank,status=status)["pending_destroy"]
+ def test_allow_new_snaps_config(self):
+ """
+ Check whether 'allow_new_snaps' setting works
+ """
+ self.mount_a.run_shell(["mkdir", "test-allow-snaps"])
+
+ self.fs.set_allow_new_snaps(False);
+ try:
+ self.mount_a.run_shell(["mkdir", "test-allow-snaps/.snap/snap00"])
+ except CommandFailedError as ce:
+ self.assertEqual(ce.exitstatus, errno.EPERM, "expected EPERM")
+ else:
+ self.fail("expected snap creatiion to fail")
+
+ self.fs.set_allow_new_snaps(True);
+ self.mount_a.run_shell(["mkdir", "test-allow-snaps/.snap/snap00"])
+ self.mount_a.run_shell(["rmdir", "test-allow-snaps/.snap/snap00"])
+ self.mount_a.run_shell(["rmdir", "test-allow-snaps"])
+
def test_kill_mdstable(self):
"""
check snaptable transcation
#!/bin/sh -ex
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
wget -q http://download.ceph.com/qa/linux-2.6.33.tar.bz2
mkdir foo
cp linux* foo
+++ /dev/null
-#!/bin/sh -x
-
-expect_failure() {
- if "$@"; then return 1; else return 0; fi
-}
-set -e
-
-ceph fs set cephfs allow_new_snaps false
-expect_failure mkdir .snap/foo
-ceph fs set cephfs 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 fs set cephfs allow_new_snaps false
-expect_failure mkdir .snap/baz
-
-echo OK
set -ex
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
echo 1 > file1
echo 2 > file2
echo 3 > file3
#!/usr/bin/env bash
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
echo "Create dir 100 to 199 ..."
for i in $(seq 100 199); do
echo " create dir $i"
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
touch foo
chmod +x foo
mkdir .snap/s
rmdir .snap/s
rm foo
-echo OK
\ No newline at end of file
+echo OK
mkdir foo
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
# make sure mds handles it when the client does not send flushsnap
echo x > foo/x
sync
rm -r foo
-echo OK
\ No newline at end of file
+echo OK
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
#
# make sure we keep an existing dn's seq
#
stat .snap/bar/a
rmdir .snap/bar
-echo OK
\ No newline at end of file
+echo OK
set -e
-ceph fs set cephfs allow_new_snaps true --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.
#!/bin/sh -x
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
mkdir .snap/foo
echo "We want ENOENT, not ESTALE, here."
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
git clone git://git.ceph.com/ceph.git
cd ceph
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
mkdir 1 2
echo asdf >1/file1
echo asdf >1/file2
#!/bin/sh -ex
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
# this tests fix for #1399
mkdir foo
mkdir foo/.snap/one
rmdir foo/.snap/one
rm -r foo
-echo OK
\ No newline at end of file
+echo OK
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
echo asdf > a
mkdir .snap/1
chmod 777 a
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
echo "making directory tree and files"
mkdir -p 1/a/b/c/
echo "i'm file1" > 1/a/file1
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
mkdir -p 1/a
exec 3<> 1/a/file1
}
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
mkdir -p d1/d2
mkdir -p d1/d3
mkdir d1/.snap/foo
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
file=linux-2.6.33.tar.bz2
wget -q http://download.ceph.com/qa/$file
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
#
# verify that a snap update on a parent realm will induce
# snap cap writeback for inodes child realms
rmdir a/.snap/a2
rm -r a
-echo "OK"
\ No newline at end of file
+echo "OK"
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
echo "testing simple xattr wb"
touch x
setfattr -n user.foo x
rmdir a/.snap/s
rm -r a
-echo OK
\ No newline at end of file
+echo OK
set -e
-ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it
-
do_tarball() {
wget http://download.ceph.com/qa/$1
tar xvf$2 $1