|
Packit Service |
e080da |
#!/bin/bash
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
. $(dirname $0)/../include.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../volume.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../snapshot.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../fileio.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../nfs.rc
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
function check_readonly()
|
|
Packit Service |
e080da |
{
|
|
Packit Service |
e080da |
$@ 2>&1 | grep -q 'Read-only file system'
|
|
Packit Service |
e080da |
return $?
|
|
Packit Service |
e080da |
}
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
function lookup()
|
|
Packit Service |
e080da |
{
|
|
Packit Service |
e080da |
ls $1
|
|
Packit Service |
e080da |
if [ "$?" == "0" ]
|
|
Packit Service |
e080da |
then
|
|
Packit Service |
e080da |
echo "Y"
|
|
Packit Service |
e080da |
else
|
|
Packit Service |
e080da |
echo "N"
|
|
Packit Service |
e080da |
fi
|
|
Packit Service |
e080da |
}
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
cleanup;
|
|
Packit Service |
e080da |
TESTS_EXPECTED_IN_LOOP=10
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST init_n_bricks 3;
|
|
Packit Service |
e080da |
TEST setup_lvm 3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST glusterd;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST pidof glusterd;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI volume create $V0 $H0:$L1 $H0:$L2 $H0:$L3;
|
|
Packit Service |
e080da |
TEST $CLI volume set $V0 nfs.disable false
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI volume start $V0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
for i in {1..10} ; do echo "file" > $M0/file$i ; done
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Create file and hard-links
|
|
Packit Service |
e080da |
TEST touch $M0/f1
|
|
Packit Service |
e080da |
TEST mkdir $M0/dir
|
|
Packit Service |
e080da |
TEST ln $M0/f1 $M0/f2
|
|
Packit Service |
e080da |
TEST ln $M0/f1 $M0/dir/f3
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot config activate-on-create enable
|
|
Packit Service |
e080da |
TEST $CLI volume set $V0 features.uss enable;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ! $CLI snapshot create snap1 $V0 no-timestamp description "";
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap1 $V0 no-timestamp;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
for i in {11..20} ; do echo "file" > $M0/file$i ; done
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap2 $V0 no-timestamp;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
########### Test inode numbers ###########
|
|
Packit Service |
e080da |
s1_f1_ino=$(STAT_INO $M0/.snaps/snap1/f1)
|
|
Packit Service |
e080da |
TEST [ $s1_f1_ino != 0 ]
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Inode number of f1 should be same as f2 f3 within snapshot
|
|
Packit Service |
e080da |
EXPECT $s1_f1_ino STAT_INO $M0/.snaps/snap1/f2
|
|
Packit Service |
e080da |
EXPECT $s1_f1_ino STAT_INO $M0/.snaps/snap1/dir/f3
|
|
Packit Service |
e080da |
EXPECT $s1_f1_ino STAT_INO $M0/dir/.snaps/snap1/f3
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Inode number of f1 in snap1 should be different from f1 in snap2
|
|
Packit Service |
e080da |
tmp_ino=$(STAT_INO $M0/.snaps/snap2/f1)
|
|
Packit Service |
e080da |
TEST [ $s1_f1_ino != $tmp_ino ]
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Inode number of f1 in snap1 should be different from f1 in regular volume
|
|
Packit Service |
e080da |
tmp_ino=$(STAT_INO $M0/f1)
|
|
Packit Service |
e080da |
TEST [ $s1_f1_ino != $tmp_ino ]
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Directory inode of snap1 should be different in each sub-dir
|
|
Packit Service |
e080da |
s1_ino=$(STAT_INO $M0/.snaps/snap1)
|
|
Packit Service |
e080da |
tmp_ino=$(STAT_INO $M0/dir/.snaps/snap1)
|
|
Packit Service |
e080da |
TEST [ $s1_ino != $tmp_ino ]
|
|
Packit Service |
e080da |
##########################################
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
mkdir $M0/dir1;
|
|
Packit Service |
e080da |
mkdir $M0/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
for i in {1..10} ; do echo "foo" > $M0/dir1/foo$i ; done
|
|
Packit Service |
e080da |
for i in {1..10} ; do echo "foo" > $M0/dir2/foo$i ; done
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap3 $V0 no-timestamp;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
for i in {11..20} ; do echo "foo" > $M0/dir1/foo$i ; done
|
|
Packit Service |
e080da |
for i in {11..20} ; do echo "foo" > $M0/dir2/foo$i ; done
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap4 $V0 no-timestamp;
|
|
Packit Service |
e080da |
## Test that features.uss takes only options enable/disable and throw error for
|
|
Packit Service |
e080da |
## any other argument.
|
|
Packit Service |
e080da |
for i in {1..10}; do
|
|
Packit Service |
e080da |
RANDOM_STRING=$(uuidgen | tr -dc 'a-zA-Z' | head -c 8)
|
|
Packit Service |
e080da |
TEST_IN_LOOP ! $CLI volume set $V0 features.uss $RANDOM_STRING
|
|
Packit Service |
e080da |
done
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
## Test that features.snapshot-directory:
|
|
Packit Service |
e080da |
## contains only '0-9a-z-_'
|
|
Packit Service |
e080da |
# starts with dot (.)
|
|
Packit Service |
e080da |
# value cannot exceed 255 characters
|
|
Packit Service |
e080da |
## and throws error for any other argument.
|
|
Packit Service |
e080da |
TEST ! $CLI volume set $V0 features.snapshot-directory a/b
|
|
Packit Service |
e080da |
TEST ! $CLI volume set $V0 features.snapshot-directory snaps
|
|
Packit Service |
e080da |
TEST ! $CLI volume set $V0 features.snapshot-directory -a
|
|
Packit Service |
e080da |
TEST ! $CLI volume set $V0 features.snapshot-directory .
|
|
Packit Service |
e080da |
TEST ! $CLI volume set $V0 features.snapshot-directory ..
|
|
Packit Service |
e080da |
TEST ! $CLI volume set $V0 features.snapshot-directory .123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# test 15
|
|
Packit Service |
e080da |
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "4" count_snaps $M0
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
NUM_SNAPS=$(ls $M0/.snaps | wc -l);
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST [ $NUM_SNAPS == 4 ]
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap1;
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap2;
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap3;
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap3/dir1;
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap3/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap4/dir1;
|
|
Packit Service |
e080da |
TEST ls $M0/.snaps/snap4/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/dir1/.snaps/
|
|
Packit Service |
e080da |
TEST ! ls $M0/dir1/.snaps/snap1;
|
|
Packit Service |
e080da |
TEST ! ls $M0/dir2/.snaps/snap2;
|
|
Packit Service |
e080da |
TEST ls $M0/dir1/.snaps/snap3;
|
|
Packit Service |
e080da |
TEST ls $M0/dir2/.snaps/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd1=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd1 'r' $M0/.snaps/snap1/file1;
|
|
Packit Service |
e080da |
TEST fd_cat $fd1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# opening fd with in write mode for snapshot files should fail
|
|
Packit Service |
e080da |
TEST fd2=`fd_available`
|
|
Packit Service |
e080da |
TEST ! fd_open $fd1 'w' $M0/.snaps/snap1/file2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# lookup on .snaps in the snapshot world should fail
|
|
Packit Service |
e080da |
TEST ! stat $M0/.snaps/snap1/.snaps
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# creating new entries in snapshots should fail
|
|
Packit Service |
e080da |
TEST check_readonly mkdir $M0/.snaps/new
|
|
Packit Service |
e080da |
TEST check_readonly touch $M0/.snaps/snap2/other;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd3=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd3 'r' $M0/dir1/.snaps/snap3/foo1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_cat $fd3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_close $fd1;
|
|
Packit Service |
e080da |
TEST fd_close $fd2;
|
|
Packit Service |
e080da |
TEST fd_close $fd3
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# similar tests on nfs mount
|
|
Packit Service |
e080da |
##Wait for connection establishment between nfs server and brick process
|
|
Packit Service |
e080da |
EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;
|
|
Packit Service |
e080da |
#test 44
|
|
Packit Service |
e080da |
TEST mount_nfs $H0:/$V0 $N0 nolock;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
NUM_SNAPS=$(ls $N0/.snaps | wc -l);
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST [ $NUM_SNAPS == 4 ];
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST stat $N0/.snaps/snap1;
|
|
Packit Service |
e080da |
TEST stat $N0/.snaps/snap2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# readdir + lookup on each entry
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps/snap1;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps/snap2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# readdir + access each entry by doing stat. If snapview-server has not
|
|
Packit Service |
e080da |
# filled the fs instance and handle in the inode context of the entry as
|
|
Packit Service |
e080da |
# part of readdirp, then when stat comes (i.e fop comes directly without
|
|
Packit Service |
e080da |
# a previous lookup), snapview-server should do a lookup of the entry via
|
|
Packit Service |
e080da |
# gfapi call and fill in the fs instance + handle information in the inode
|
|
Packit Service |
e080da |
# context
|
|
Packit Service |
e080da |
TEST ls $N0/.snaps/snap3/;
|
|
Packit Service |
e080da |
TEST stat $N0/.snaps/snap3/dir1;
|
|
Packit Service |
e080da |
TEST stat $N0/.snaps/snap3/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps/snap3/dir1;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps/snap3/dir2;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps/snap4/dir1;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.snaps/snap4/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ! ls -l $N0/dir1/.snaps/snap1;
|
|
Packit Service |
e080da |
TEST ! ls -l $N0/dir2/.snaps/snap2;
|
|
Packit Service |
e080da |
TEST ls -l $N0/dir1/.snaps/snap3;
|
|
Packit Service |
e080da |
TEST ls -l $N0/dir2/.snaps/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd1=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd1 'r' $N0/.snaps/snap1/file1;
|
|
Packit Service |
e080da |
TEST fd_cat $fd1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd2=`fd_available`
|
|
Packit Service |
e080da |
TEST ! fd_open $fd1 'w' $N0/.snaps/snap1/file2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ! stat $N0/.snaps/snap1/.stat
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST check_readonly mkdir $N0/.snaps/new
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST check_readonly touch $N0/.snaps/snap2/other;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd3=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd3 'r' $N0/dir1/.snaps/snap3/foo1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_cat $fd3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_close $fd1;
|
|
Packit Service |
e080da |
TEST fd_close $fd2;
|
|
Packit Service |
e080da |
TEST fd_close $fd3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# test 73
|
|
Packit Service |
e080da |
TEST $CLI volume set $V0 "features.snapshot-directory" .history
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
#snapd client might take fraction of time to compare the volfile from glusterd
|
|
Packit Service |
e080da |
#hence a EXPECT_WITHIN is a better choice here
|
|
Packit Service |
e080da |
EXPECT_WITHIN 2 "Y" lookup "$M0/.history";
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
NUM_SNAPS=$(ls $M0/.history | wc -l);
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST [ $NUM_SNAPS == 4 ]
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap1;
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap2;
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap3;
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap3/dir1;
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap3/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap4/dir1;
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap4/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/dir1/.history/
|
|
Packit Service |
e080da |
TEST ! ls $M0/dir1/.history/snap1;
|
|
Packit Service |
e080da |
TEST ! ls $M0/dir2/.history/snap2;
|
|
Packit Service |
e080da |
TEST ls $M0/dir1/.history/snap3;
|
|
Packit Service |
e080da |
TEST ls $M0/dir2/.history/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd1=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd1 'r' $M0/.history/snap1/file1;
|
|
Packit Service |
e080da |
TEST fd_cat $fd1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# opening fd with in write mode for snapshot files should fail
|
|
Packit Service |
e080da |
TEST fd2=`fd_available`
|
|
Packit Service |
e080da |
TEST ! fd_open $fd1 'w' $M0/.history/snap1/file2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# lookup on .history in the snapshot world should fail
|
|
Packit Service |
e080da |
TEST ! stat $M0/.history/snap1/.history
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# creating new entries in snapshots should fail
|
|
Packit Service |
e080da |
TEST check_readonly mkdir $M0/.history/new
|
|
Packit Service |
e080da |
TEST check_readonly touch $M0/.history/snap2/other;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd3=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd3 'r' $M0/dir1/.history/snap3/foo1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_cat $fd3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_close $fd1;
|
|
Packit Service |
e080da |
TEST fd_close $fd2;
|
|
Packit Service |
e080da |
TEST fd_close $fd3
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# similar tests on nfs mount
|
|
Packit Service |
e080da |
# test 103
|
|
Packit Service |
e080da |
TEST ls $N0/.history;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
NUM_SNAPS=$(ls $N0/.history | wc -l);
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST [ $NUM_SNAPS == 4 ];
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap1;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap2;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap3;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap3/dir1;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap3/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap4/dir1;
|
|
Packit Service |
e080da |
TEST ls -l $N0/.history/snap4/dir2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ! ls -l $N0/dir1/.history/snap1;
|
|
Packit Service |
e080da |
TEST ! ls -l $N0/dir2/.history/snap2;
|
|
Packit Service |
e080da |
TEST ls -l $N0/dir1/.history/snap3;
|
|
Packit Service |
e080da |
TEST ls -l $N0/dir2/.history/snap4;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd1=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd1 'r' $N0/.history/snap1/file1;
|
|
Packit Service |
e080da |
TEST fd_cat $fd1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd2=`fd_available`
|
|
Packit Service |
e080da |
TEST ! fd_open $fd1 'w' $N0/.history/snap1/file2;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ! stat $N0/.history/snap1/.stat
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST check_readonly mkdir $N0/.history/new
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST check_readonly touch $N0/.history/snap2/other;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd3=`fd_available`
|
|
Packit Service |
e080da |
TEST fd_open $fd3 'r' $N0/dir1/.history/snap3/foo1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_cat $fd3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST fd_close $fd1;
|
|
Packit Service |
e080da |
TEST fd_close $fd2;
|
|
Packit Service |
e080da |
TEST fd_close $fd3;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
## Before killing daemon to avoid deadlocks
|
|
Packit Service |
e080da |
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" umount_nfs $N0
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
#test 131
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap5 $V0 no-timestamp
|
|
Packit Service |
e080da |
TEST ls $M0/.history;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
function count_snaps
|
|
Packit Service |
e080da |
{
|
|
Packit Service |
e080da |
local mount_point=$1;
|
|
Packit Service |
e080da |
local num_snaps;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
num_snaps=$(ls $mount_point/.history | wc -l);
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
echo $num_snaps;
|
|
Packit Service |
e080da |
}
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
EXPECT_WITHIN 30 "5" count_snaps $M0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# deletion of a snapshot and creation of a new snapshot with same name
|
|
Packit Service |
e080da |
# should not create problems. The data that was supposed to be present
|
|
Packit Service |
e080da |
# in the deleted snapshot need not be present in the new snapshot just
|
|
Packit Service |
e080da |
# because the name is same. Ex:
|
|
Packit Service |
e080da |
# 1) Create a file "aaa"
|
|
Packit Service |
e080da |
# 2) Create a snapshot snap6
|
|
Packit Service |
e080da |
# 3) stat the file "aaa" in snap6 and it should succeed
|
|
Packit Service |
e080da |
# 4) delete the file "aaa"
|
|
Packit Service |
e080da |
# 5) Delete the snapshot snap6
|
|
Packit Service |
e080da |
# 6) Create a snapshot snap6
|
|
Packit Service |
e080da |
# 7) stat the file "aaa" in snap6 and it should fail now
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
echo "aaa" > $M0/aaa;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap6 $V0 no-timestamp
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.history;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
EXPECT_WITHIN 30 "6" count_snaps $M0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
EXPECT_WITHIN 10 "Y" lookup $M0/.history/snap6/aaa
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST rm -f $M0/aaa;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot delete snap6;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST $CLI snapshot create snap6 $V0 no-timestamp
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.history;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
EXPECT_WITHIN 30 "6" count_snaps $M0;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ls $M0/.history/snap6/;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
TEST ! stat $M0/.history/snap6/aaa;
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
cleanup;
|