Comment updating. Allow overriding SCRATCH_DEV from the env.
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 7 May 2022 22:24:37 +0000 (18:24 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sat, 7 May 2022 22:24:37 +0000 (18:24 -0400)
tests/w-racer.sh

index 2737281807f27b8bf50133cdee32e490ba8c32bc..caa00ea58e2705f49e350061272a00ec27feb713 100755 (executable)
@@ -2,9 +2,9 @@
 # RACER tests
 
 ##############################################################################
-# scratch device to mount on /n/scratch
-#SCRATCH_DEV=/dev/hdd2
-SCRATCH_DEV=/dev/sdb
+# Scratch device to mount on /n/scratch.
+# Users can set $SCRATCH_DEV and export it, else we default to /dev/sdb
+test -z "$SCRATCH_DEV" && SCRATCH_DEV=/dev/sdb
 
 function runcmd
 {
@@ -45,7 +45,7 @@ case "$lowertype" in
     tmpfs )
        runcmd umount /n/scratch
        runcmd swapoff $SCRATCH_DEV
-       ;;
+v      ;;
     nfs )
        runcmd umount /n/scratch
        runcmd exportfs -u localhost:/n/lower
@@ -77,12 +77,11 @@ 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
+# 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.  We couldn't get yes(1) to play nicely with runcmd.  mkfs.ext4
+# also has a -F force option but this didn't seem to work.
 case "$lowertype" in
     ext2 | ext3 | ext4 | reiserfs )
        runcmd mkfs -t $lowertype -q $SCRATCH_DEV <<< y