summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2016-10-27 08:28:14 -0400
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-10-28 03:30:57 -0700
commitad9957af5ce8d351bebe494ba4fa474fac972c6b (patch)
treea431ec30952e8fb78bf61006148a1a60dfe86f82 /tests
parent29587a91716e1e55bd172d63340c40249fb343c9 (diff)
tests: fix cleanup in bug-1110262.t
The test wasn't cleaning up the user/group it had created if it terminated abnormally. We have a mechanism (push_trapfunc) to add cleanup actions in a way that ensures they'll be run when necessary, so I changed the test to use it. While I was there, I fixed it to use kill_brick instead of "ps|grep|kill" because that will be necessary for it to pass with brick multiplexing anyway. Change-Id: Ia515bd2420050f922970d28c5856c55df9b5247b Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/15744 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/bug-1110262.t15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/bugs/bug-1110262.t b/tests/bugs/bug-1110262.t
index 9c6e4f973a1..be785f4f3f7 100644
--- a/tests/bugs/bug-1110262.t
+++ b/tests/bugs/bug-1110262.t
@@ -2,6 +2,7 @@
. $(dirname $0)/../include.rc
. $(dirname $0)/../volume.rc
+. $(dirname $0)/../traps.rc
cleanup;
@@ -17,15 +18,19 @@ TEST $CLI volume set $V0 nfs.disable false
## Verify volume is created
EXPECT "$V0" volinfo_field $V0 'Volume Name';
EXPECT 'Created' volinfo_field $V0 'Status';
-TEST $CLI volume set $V0 client-log-level TRACE
-TEST $CLI volume set $V0 brick-log-level TRACE
## Start volume and verify
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
TEST glusterfs -s $H0 --volfile-id=$V0 $M0
#kill one of the brick process
-TEST kill -9 `ps aux | grep glusterfsd | grep $B0/${V0}2 | awk '{print $2}'`;
+TEST kill_brick $V0 $H0 $B0/${V0}2
+
+cleanup_user_group () {
+ userdel --force dev
+ groupdel QA
+}
+push_trapfunc cleanup_user_group
#create a user and group
TEST useradd dev
@@ -58,8 +63,4 @@ gid=`ls -l $B0/${V0}2 | grep dironedown | awk '{print $4}'`
TEST echo $gid
TEST [ $gid = QA ]
-#cleanup
-TEST userdel --force dev
-TEST groupdel QA
-
cleanup