summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-08-02 02:23:34 +0200
committerHarshavardhana <harsha@harshavardhana.net>2014-08-01 22:26:01 -0700
commit61e2ed9d178910fdf7d0499b54601a4191f9cb75 (patch)
tree3705002e32017e48026bfac21b6dcbae936f546d /tests/include.rc
parentd09f69e76f86e727ea9a3487f57a0d7fd7b5bcd7 (diff)
Regression test portability: system-specific cleanup
Add NetBSD system-specific cleanup code Define killall as pkill when it is missing. BUG: 764655 Change-Id: I3a1cfa3029fd60ede334a670fc115c211700063d Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8290 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc42
1 files changed, 37 insertions, 5 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 7463f5277c8..7f1dda8c53c 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -226,13 +226,20 @@ function _TEST_IN_LOOP()
_TEST $@
}
+which killall > /dev/null || {
+ killall() {
+ pkill $@
+ }
+}
function cleanup()
{
killall -15 glusterfs glusterfsd glusterd 2>/dev/null || true;
+ test "x`uname -s` = "xNetBSD" && pkill -15 perfused || true
# allow completion of signal handlers for SIGTERM before issue SIGKILL
sleep 1
killall -9 glusterfs glusterfsd glusterd 2>/dev/null || true;
+ test "x`uname -s` = "xNetBSD" && pkill -9 perfused || true
MOUNTPOINTS=`mount | grep "$B0/" | awk '{print $3}'`
for m in $MOUNTPOINTS;
@@ -254,11 +261,36 @@ function cleanup()
type cleanup_lvm &>/dev/null && cleanup_lvm
- LOOPDEVICES=`losetup -a | grep "$B0/" | awk '{print $1}' | tr -d :`
- for l in $LOOPDEVICES;
- do
- losetup -d $l
- done
+ case `uname -s` in
+ Linux)
+ LOOPDEVICES=`losetup -a | grep "$B0/" | \
+ awk '{print $1}' | tr -d :`
+ for l in $LOOPDEVICES;
+ do
+ losetup -d $l
+ done
+ ;;
+ NetBSD)
+ vnd=`vnconfig -l | \
+ awk '!/not in use/{printf("%s%s:%d ", $1, $2, $5);}'`
+ for l in ${vnd} ; do
+ dev=${l%%:*}
+ tmp=${l#*:}
+ fs=${tmp%%:*}
+ inode=${tmp#*:}
+ file=`find -x ${fs} -inum ${inode} -print -exit`
+ echo ${file} | grep "$B0/" && \
+ LOOPDEVICES="${LOOPDEVICES} $dev"
+ done
+ for l in $LOOPDEVICES;
+ do
+ vnconfig -u $l
+ done
+ ;;
+ *)
+ echo "`uname -s` loopback device supportmissing"
+ ;;
+ esac
rm -rf /var/lib/glusterd/* $B0/* /etc/glusterd/*;