$ ./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
;;
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
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
--- /dev/null
+#!/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
+++ /dev/null
-#!/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
$@
ret=$?
if test $ret -ne 0 ; then
- echo "$lowertype and $type failed"
+ echo "$0: $lowertype and $type failed"
exit $ret
fi
}
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 )
;;
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
# 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"