diff options
Diffstat (limited to 'tests/bugs/glusterfs-server')
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-852147.t | 6 | ||||
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-861542.t | 2 | ||||
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-864222.t | 2 | ||||
| -rw-r--r-- | tests/bugs/glusterfs-server/bug-873549.t | 2 | ||||
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-877992.t | 4 | ||||
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-887145.t | 16 | ||||
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-904300.t | 2 | ||||
| -rw-r--r-- | tests/bugs/glusterfs-server/bug-905864.c | 99 | ||||
| -rwxr-xr-x | tests/bugs/glusterfs-server/bug-912297.t | 2 |
9 files changed, 76 insertions, 59 deletions
diff --git a/tests/bugs/glusterfs-server/bug-852147.t b/tests/bugs/glusterfs-server/bug-852147.t index 8cb5fd13f85..75db2a26e05 100755 --- a/tests/bugs/glusterfs-server/bug-852147.t +++ b/tests/bugs/glusterfs-server/bug-852147.t @@ -11,7 +11,7 @@ TEST glusterd; TEST pidof glusterd; TEST $CLI volume info; -TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3,4,5,6}; ## Verify volume is is created EXPECT "$V0" volinfo_field $V0 'Volume Name'; @@ -42,7 +42,7 @@ function vol_prof_info() { $CLI volume profile $V0 info | grep Brick | wc -l } -EXPECT "8" vol_prof_info +EXPECT "6" vol_prof_info EXPECT "Stopping volume profile on $V0 has been successful " $CLI volume profile $V0 stop @@ -66,7 +66,7 @@ ren_file=$log_file".*" rm -rf $ren_file #Initiating log rotate -TEST $CLI volume log rotate $V0 +TEST $CLI volume log $V0 rotate #Capturing new log file's size new_file_size=`file-size $log_file` diff --git a/tests/bugs/glusterfs-server/bug-861542.t b/tests/bugs/glusterfs-server/bug-861542.t index d33593257b9..60d1b132fb4 100755 --- a/tests/bugs/glusterfs-server/bug-861542.t +++ b/tests/bugs/glusterfs-server/bug-861542.t @@ -39,7 +39,7 @@ TEST $CLI --xml volume status $V0; TEST $CLI --xml volume status $V0 detail; # Kill the brick process. After this, port number for the killed (in this case brick) process must be "N/A". -kill `cat $GLUSTERD_WORKDIR/vols/$V0/run/$H0-d-backends-brick0.pid` +kill `cat $GLUSTERD_PIDFILEDIR/vols/$V0/$H0-d-backends-brick0.pid` EXPECT "N/A" port_field $V0 '0'; # volume status EXPECT "N/A" port_field $V0 '1'; # volume status detail diff --git a/tests/bugs/glusterfs-server/bug-864222.t b/tests/bugs/glusterfs-server/bug-864222.t index 3a46c283599..01a7a4e3afd 100755 --- a/tests/bugs/glusterfs-server/bug-864222.t +++ b/tests/bugs/glusterfs-server/bug-864222.t @@ -4,6 +4,8 @@ . $(dirname $0)/../../nfs.rc . $(dirname $0)/../../volume.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; TEST glusterd diff --git a/tests/bugs/glusterfs-server/bug-873549.t b/tests/bugs/glusterfs-server/bug-873549.t index a3b2f9c9bf7..8b5534728fd 100644 --- a/tests/bugs/glusterfs-server/bug-873549.t +++ b/tests/bugs/glusterfs-server/bug-873549.t @@ -10,7 +10,7 @@ TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; -TEST $CLI volume set $V0 performance.cache-size 512MB +TEST $CLI volume set $V0 performance.quick-read-cache-size 512MB TEST $CLI volume start $V0 TEST $CLI volume statedump $V0 all diff --git a/tests/bugs/glusterfs-server/bug-877992.t b/tests/bugs/glusterfs-server/bug-877992.t index aeb73ed94dd..300000bcf2c 100755 --- a/tests/bugs/glusterfs-server/bug-877992.t +++ b/tests/bugs/glusterfs-server/bug-877992.t @@ -46,7 +46,9 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}1; EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT 'createPre' cat /tmp/pre.out; -EXPECT 'createPost' cat /tmp/post.out; +# Spost.sh comes after S10selinux-label-brick.sh under create post hook script +# list. So consider the delay in setting SELinux context on bricks +EXPECT_WITHIN 5 'createPost' cat /tmp/post.out; hooks_cleanup 'create' diff --git a/tests/bugs/glusterfs-server/bug-887145.t b/tests/bugs/glusterfs-server/bug-887145.t index 9b940259f55..db2cf3c050b 100755 --- a/tests/bugs/glusterfs-server/bug-887145.t +++ b/tests/bugs/glusterfs-server/bug-887145.t @@ -3,6 +3,8 @@ . $(dirname $0)/../../include.rc . $(dirname $0)/../../nfs.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; TEST glusterd @@ -27,7 +29,15 @@ chmod 600 $M0/file; TEST mount_nfs $H0:/$V0 $N0 nolock; -chown -R nfsnobody:nfsnobody $M0/dir; +grep nfsnobody /etc/passwd > /dev/null +if [ $? -eq 1 ]; then +usr=nobody +grp=nobody +else +usr=nfsnobody +grp=nfsnobody +fi +chown -R $usr:$grp $M0/dir; chown -R tmp_user:tmp_user $M0/other; TEST $CLI volume set $V0 server.root-squash on; @@ -36,7 +46,7 @@ EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; # create files and directories in the root of the glusterfs and nfs mount # which is owned by root and hence the right behavior is getting EACCESS -# as the fops are executed as nfsnobody. +# as the fops are executed as nfsnobody/nobody. touch $M0/foo 2>/dev/null; TEST [ $? -ne 0 ] touch $N0/foo 2>/dev/null; @@ -59,7 +69,7 @@ cat $N0/passwd 1>/dev/null; TEST [ $? -eq 0 ] # create files and directories should succeed as the fops are being executed -# inside the directory owned by nfsnobody +# inside the directory owned by nfsnobody/nobody TEST touch $M0/dir/file; TEST touch $N0/dir/foo; TEST mkdir $M0/dir/new; diff --git a/tests/bugs/glusterfs-server/bug-904300.t b/tests/bugs/glusterfs-server/bug-904300.t index eea1c5b5463..95d5d381c8b 100755 --- a/tests/bugs/glusterfs-server/bug-904300.t +++ b/tests/bugs/glusterfs-server/bug-904300.t @@ -4,6 +4,8 @@ . $(dirname $0)/../../nfs.rc . $(dirname $0)/../../volume.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; # 1-8 diff --git a/tests/bugs/glusterfs-server/bug-905864.c b/tests/bugs/glusterfs-server/bug-905864.c index 3cc4cc5d232..f70003736e7 100644 --- a/tests/bugs/glusterfs-server/bug-905864.c +++ b/tests/bugs/glusterfs-server/bug-905864.c @@ -4,10 +4,9 @@ #include <fcntl.h> #include <pthread.h> - -pthread_t th[5] = {0}; +pthread_t th[5] = {0}; void -flock_init (struct flock *f, short int type, off_t start, off_t len) +flock_init(struct flock *f, short int type, off_t start, off_t len) { f->l_type = type; f->l_start = start; @@ -15,68 +14,70 @@ flock_init (struct flock *f, short int type, off_t start, off_t len) } int -flock_range_in_steps (int fd, int is_set, short l_type, - int start, int end, int step) +flock_range_in_steps(int fd, int is_set, short l_type, int start, int end, + int step) { - int ret = 0; - int i = 0; - struct flock f = {0,}; + int ret = 0; + int i = 0; + struct flock f = { + 0, + }; - for (i = start; i+step < end; i += step) { - flock_init (&f, l_type, i, step); - ret = fcntl (fd, (is_set) ? F_SETLKW : F_GETLK, &f); - if (ret) { - perror ("fcntl"); - goto out; - } + for (i = start; i + step < end; i += step) { + flock_init(&f, l_type, i, step); + ret = fcntl(fd, (is_set) ? F_SETLKW : F_GETLK, &f); + if (ret) { + perror("fcntl"); + goto out; } + } out: - return ret; + return ret; } void * -random_locker (void *arg) +random_locker(void *arg) { - int fd = *(int *)arg; - int i = 0; - int is_set = 0; + int fd = *(int *)arg; + int i = 0; + int is_set = 0; - /* use thread id to choose GETLK or SETLK operation*/ - is_set = pthread_self () % 2; - (void)flock_range_in_steps (fd, is_set, F_WRLCK, 0, 400, 1); + /* use thread id to choose GETLK or SETLK operation*/ + is_set = pthread_self() % 2; + (void)flock_range_in_steps(fd, is_set, F_WRLCK, 0, 400, 1); - return NULL; + return NULL; } - -int main (int argc, char **argv) +int +main(int argc, char **argv) { - int fd = -1; - int ret = 1; - int i = 0; - char *fname = NULL; + int fd = -1; + int ret = 1; + int i = 0; + char *fname = NULL; - if (argc < 2) - goto out; + if (argc < 2) + goto out; - fname = argv[1]; - fd = open (fname, O_RDWR); - if (fd == -1) { - perror ("open"); - goto out; - } + fname = argv[1]; + fd = open(fname, O_RDWR); + if (fd == -1) { + perror("open"); + goto out; + } - ret = flock_range_in_steps (fd, 1, F_WRLCK, 0, 2000, 2); - for (i = 0; i < 5; i++) { - pthread_create (&th[i], NULL, random_locker, (void *) &fd); - } - ret = flock_range_in_steps (fd, 1, F_WRLCK, 0, 2000, 2); - for (i = 0; i < 5; i++) { - pthread_join (th[i], NULL); - } + ret = flock_range_in_steps(fd, 1, F_WRLCK, 0, 2000, 2); + for (i = 0; i < 5; i++) { + pthread_create(&th[i], NULL, random_locker, (void *)&fd); + } + ret = flock_range_in_steps(fd, 1, F_WRLCK, 0, 2000, 2); + for (i = 0; i < 5; i++) { + pthread_join(th[i], NULL); + } out: - if (fd != -1) - close (fd); + if (fd != -1) + close(fd); - return ret; + return ret; } diff --git a/tests/bugs/glusterfs-server/bug-912297.t b/tests/bugs/glusterfs-server/bug-912297.t index f1f4147e6aa..08f5dcea9b9 100755 --- a/tests/bugs/glusterfs-server/bug-912297.t +++ b/tests/bugs/glusterfs-server/bug-912297.t @@ -8,7 +8,7 @@ cleanup; ## Start and create a volume TEST glusterd; TEST pidof glusterd; -TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3,4,5,6}; ## Verify volume is is created EXPECT "$V0" volinfo_field $V0 'Volume Name'; |
