From: Andrew Burford Date: Sat, 14 May 2022 16:06:08 +0000 (-0400) Subject: test wrapfs stacked on itself in w-racer.sh X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=38beea2378805ac7d628fa9301a3de3358e34fdb;p=wrapfs-mgmt.git test wrapfs stacked on itself in w-racer.sh --- diff --git a/tests/w-racer.sh b/tests/w-racer.sh index 5e6771f..ef63812 100755 --- a/tests/w-racer.sh +++ b/tests/w-racer.sh @@ -9,9 +9,6 @@ SCRATCH_DIR=/n/scratch LOWER_DIR=/n/lower TMP_DIR=/n/tmp -# TODO: define TMP_DIR, SCRATCH_DIR, and LOWER_DIR, and don't hardcode them below -# TODO: TMP_DIR shoyld be /n/tmp, ensure to "runcmd mkdir -p $TMP_DIR" - function runcmd { echo "CMD: $@" @@ -62,9 +59,21 @@ case "$lowertype" in runcmd exportfs -u localhost:$LOWER_DIR runcmd umount $LOWER_DIR ;; + wrapfs ) + runcmd lsof $LOWER_DIR + runcmd umount $LOWER_DIR + runcmd lsof $SCRATCH_DIR + runcmd umount $SCRATCH_DIR esac } +dirs="$TMP_DIR $LOWER_DIR $SCRATCH_DIR" +for d in $dirs; do + if cat /proc/mounts | grep $d; then + runcmd umount $d + fi +done + # decide what type of test type="bind" # default case "$1" in @@ -72,10 +81,10 @@ case "$1" in -d | -direct ) type="direct" ; shift ;; esac case "$1" in - ext3 | ext2 | ext4 | reiserfs | xfs | tmpfs | nfs ) lowertype=$1 ;; + ext3 | ext2 | ext4 | reiserfs | xfs | tmpfs | nfs | wrapfs ) lowertype=$1 ;; * ) echo "Usage: $0 '[-w(rapfs) | -d(irect)] LOWERTYPE [duration (60 sec default)]'" - echo "where LOWERTYPE is one of: ext[234] reiserfs xfs tmpfs nfs" + echo "where LOWERTYPE is one of: ext[234] reiserfs xfs tmpfs nfs wrapfs" echo "-d will run racer directly on lower fs mount" echo "if neither -w nor -d is specified, racer will run through a bind mount" exit 1 @@ -117,12 +126,15 @@ case "$lowertype" in runcmd mount -t $lowertype -o size=3000m tmpfs $SCRATCH_DIR ;; nfs ) - runcmd mkdir -p $LOWER_DIR runcmd mkfs -t ext3 -q $SCRATCH_DEV <<< y runcmd mount -t ext3 $SCRATCH_DEV $LOWER_DIR runcmd exportfs -o no_root_squash,rw localhost:$LOWER_DIR runcmd mount -t $lowertype localhost:$LOWER_DIR $SCRATCH_DIR ;; + wrapfs ) + runcmd mkfs -t ext4 -q $SCRATCH_DEV <<< y + runcmd mount -t ext4 $SCRATCH_DEV $LOWER_DIR + runcmd mount -t $lowertype $LOWER_DIR $SCRATCH_DIR esac case "$type" in wrapfs )