clean up some previous changes and add comments
authoraburford <andrew.burford@stonybrook.edu>
Sat, 7 May 2022 19:18:28 +0000 (15:18 -0400)
committeraburford <andrew.burford@stonybrook.edu>
Sat, 7 May 2022 19:18:28 +0000 (15:18 -0400)
README
fix-remotes.sh
tests/Makefile
tests/ls-test.sh [new file with mode: 0755]
tests/ls_test.sh [deleted file]
tests/w-racer.sh
update-stable.sh

diff --git a/README b/README
index 75efeddaea419311393ee6728175dda84db4450f..4793007dd5763bf1335cfacfeb033b2ec30cc626 100644 (file)
--- a/README
+++ b/README
@@ -36,3 +36,19 @@ $ ./wrapfs-patch-release.sh --version 2.6.32.21 --release-patch yes
 $ ./wrapfs-patch-release.sh -r yes
 $ ./wrapfs-patch-release.sh --release-patch yes
 
+
+Testing 
+
+The tests directory contains a Makefile and some wrapper scripts for running
+racer tests.
+
+w-racer.sh
+A wrapper for racer-fsl.sh which will mkfs and mount the specified lower file
+system, stack wrapfs on top of it, and run racer on the wrapfs mount. It can
+optionally run racer directly on the lower file system through a bind mount.
+
+ls-test.sh
+This script will run w-racer.sh for the specified lower file system but also
+run ls -l in the background 100 times a second to check for corrupted inode
+entries (which show up as ??? in ls -l output). It creates a log file
+ls-test.log
index d33121f65fed003a3b3236f59989112a394e714f..fe7040cdf2c82c03d27e22b5de746d1637b5b98e 100755 (executable)
@@ -39,35 +39,35 @@ case "$THIS_REPO" in
        ;;
 esac
 
-# verify we have both master and wrapfs branches
-TMP_BR_LIST=/tmp/.tbr.$$
-TMP_BR2_LIST=/tmp/.tbr2.$$
-(
-cat <<EOF
-  origin/HEAD -> origin/master
-  origin/guilt/wrapfs
-  origin/master
-  origin/wrapfs
-EOF
-) > $TMP_BR_LIST
-(
-cat <<EOF
-  origin/HEAD -> origin/master
-  origin/master
-  origin/wrapfs
-EOF
-) > $TMP_BR2_LIST
-EXP_BR_LIST=/tmp/.ebr.$$
-git branch -r > $EXP_BR_LIST
-if ! cmp $TMP_BR_LIST $EXP_BR_LIST &>/dev/null && ! cmp $TMP_BR2_LIST $EXP_BR_LIST &>/dev/null; then
-    echo "Expected list of branches mismatched for `basename $PWD`"
-    diff -u $TMP_BR_LIST $EXP_BR_LIST
-    /bin/rm -f $TMP_BR_LIST $EXP_BR_LIST
-#    exit 1
-fi
-/bin/rm -f $TMP_BR_LIST $TMP_BR2_LIST $EXP_BR_LIST
+# we could verify we have both master and wrapfs branches
+# as done below but I don't really see the purpose of this because
+# we are going to overwrite/add the origin and korg remote URL's anyway
+# so doing this gives us no actionable information. I feel like it just
+# confuses the user with what looks like an error but is actually something the
+# script is about to fix.
+#TMP_BR_LIST=/tmp/.tbr.$$
+#(
+#cat <<EOF
+#  origin/HEAD -> origin/master
+#  origin/guilt/wrapfs
+#  origin/master
+#  origin/wrapfs
+#EOF
+#) > $TMP_BR_LIST
+#EXP_BR_LIST=/tmp/.ebr.$$
+#git branch -r > $EXP_BR_LIST
+#if ! cmp $TMP_BR_LIST $EXP_BR_LIST &>/dev/null; then
+#    echo "Expected list of branches mismatched for `basename $PWD`"
+#    diff -u $TMP_BR_LIST $EXP_BR_LIST
+#    /bin/rm -f $TMP_BR_LIST $EXP_BR_LIST
+##    exit 1
+#fi
+#/bin/rm -f $TMP_BR_LIST $EXP_BR_LIST
 
 # find out the URL for the remote "origin"`
+# `git remote get-url origin` is the newest syntax but the syntax below
+# works on newer and older versions of git
+# so I'm not sure which is preferable
 THIS_ORIGIN_URL=`git config --get remote.origin.url 2>/dev/null`
 #echo THIS_ORIGIN_URL=$THIS_ORIGIN_URL
 # expected origin URL
index 82b29d42e7607f10cac95ce9018d5a9ecc924e54..412425fc8ffe4c45b2ea2c9edfb376accfc52748 100644 (file)
@@ -59,8 +59,14 @@ wtests: progs
        sh w-racer.sh $(OPT) nfs 60
        sh w-racer.sh $(OPT) nfs 60
 
-ls_test:
-       sh ls_test.sh
+ls_tests:
+       date >> ls-test.log
+       sh ls-test.sh ext2 60
+       sh ls-test.sh ext3 60
+       sh ls-test.sh ext4 60
+       sh ls-test.sh xfs 60
+       sh ls-test.sh tmpfs 60
+       sh ls-test.sh reiserfs 60
 
 wtest2:
        sh w-racer.sh $(OPT) ext2 60
diff --git a/tests/ls-test.sh b/tests/ls-test.sh
new file mode 100755 (executable)
index 0000000..3a50f31
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+# RACER tests one lower filesystems with ls -l running in background
+# we check for ??? entries returned by ls -l and save results to ls-test.log
+
+function runcmd
+{
+    echo "CMD: $@"
+    sleep 0.25
+    $@
+    ret=$?
+    if test $ret -ne 0 ; then
+       exit $ret
+    fi
+}
+
+type=""        # default
+case "$1" in
+    -w | -wrapfs ) type="-w" ; shift ;;
+esac
+case "$1" in
+    ext3 | ext2 | ext4 | reiserfs | xfs | tmpfs | nfs ) fstype=$1 ;;
+    * )
+       echo "Usage: $0 '[-w(rapfs)] LOWERTYPE [duration (60 sec default)]'"
+       echo "where FSTYPE is one of: ext[234] reiserfs xfs tmpfs nfs"
+       exit 1
+       ;;
+esac
+
+# continually run `ls -l` in the background
+while true; do ls -l /tmp/r 2>/dev/null|grep ??? >>ls-test.log;sleep 0.01;done &
+
+echo "$fstype" >> ls-test.log
+runcmd ./w-racer.sh $type $fstype $2
+
+# kill background `ls -l` loop
+kill %1
diff --git a/tests/ls_test.sh b/tests/ls_test.sh
deleted file mode 100755 (executable)
index 6af6cb7..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-date >> ls_test.log
-while true; do ls -l /tmp/r 2>/dev/null|grep ??? >>ls_test.log;sleep 0.01;done &
-
-echo "ext2" >> ls_test.log
-./w-racer.sh ext2 60
-echo "ext3" >> ls_test.log
-./w-racer.sh ext3 60
-echo "ext4" >> ls_test.log
-./w-racer.sh ext4 60
-echo "xfs" >> ls_test.log
-./w-racer.sh xfs 60
-echo "tmpfs" >> ls_test.log
-./w-racer.sh tmpfs 60
-echo "reiser" >> ls_test.log
-./w-racer.sh reiserfs 60
-
-kill %1
index f948c2671f60e41a5d12403fe90cb96bf5dffa4f..2737281807f27b8bf50133cdee32e490ba8c32bc 100755 (executable)
@@ -13,7 +13,7 @@ function runcmd
     $@
     ret=$?
     if test $ret -ne 0 ; then
-       echo "$lowertype and $type failed"
+       echo "$0: $lowertype and $type failed"
        exit $ret
     fi
 }
@@ -77,13 +77,19 @@ then
     cleanup
 fi
 
+# file system specific mkfs programs have a -q option for quiet but
+# it doesn't prevent asking for confirmation when a filesystem already
+# exists on the specified disk
+# so we must feed in a y to proceed through this prompt
+# I couldn't get yes(1) to play nicely with runcmd
+# mkfs.ext4 also has a -F force option but this didn't work for me
 case "$lowertype" in
     ext2 | ext3 | ext4 | reiserfs )
-       runcmd mkfs -t $lowertype -q $SCRATCH_DEV <<< $(echo y)
+       runcmd mkfs -t $lowertype -q $SCRATCH_DEV <<< y
        runcmd mount -t $lowertype $SCRATCH_DEV /n/scratch
        ;;
     xfs )
-       runcmd mkfs -t $lowertype -q -f $SCRATCH_DEV <<< $(echo y)
+       runcmd mkfs -t $lowertype -q -f $SCRATCH_DEV <<< y
        runcmd mount -t $lowertype $SCRATCH_DEV /n/scratch
        ;;
     tmpfs )
@@ -94,7 +100,7 @@ case "$lowertype" in
        ;;
     nfs )
        runcmd mkdir -p /n/lower
-       runcmd mkfs -t ext3 -q $SCRATCH_DEV <<< $(echo y)
+       runcmd mkfs -t ext3 -q $SCRATCH_DEV <<< y
        runcmd mount -t ext3  $SCRATCH_DEV /n/lower
        runcmd exportfs -o no_root_squash,rw localhost:/n/lower
        runcmd mount -t $lowertype localhost:/n/lower /n/scratch
index b2a357dbf5599530bf99c52e4ccbb81a402a6d7a..61eb3055a3d8efbaace839412990a4cf511209ce 100755 (executable)
@@ -28,14 +28,15 @@ fi
 
 # find out what repo I'm supposed to be (allow override from cmd-line)
 if test -z "$1"; then
-    THIS_REPO=`basename $PWD | sed -e 's/^wrapfs-//'`
+    THIS_REPO=`basename $PWD | sed -e 's/^wrapfs-//' -e 's/\.y$//'`
 else
     THIS_REPO="$1"
 fi
 #echo THIS_REPO:$THIS_REPO
 case "$THIS_REPO" in
     2.6.* | 3.* | 4.* | 5.* )
-       BRANCH="linux-${THIS_REPO}"
+    # add back the .y that we removed when parsing basename
+       BRANCH="linux-${THIS_REPO}.y"
        ;;
     latest )
        BRANCH="master"