From 846c0d0e32515d0b2ed590b304d960aecc7a808e Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 2 Apr 2002 19:13:25 +0000 Subject: [PATCH] A script which sets up an ext3 testbed (ala llext3.sh), and then runs some failure tests (setattr, create, unlink, rename) that would write to disk. --- lustre/tests/runfailure-mds | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 lustre/tests/runfailure-mds diff --git a/lustre/tests/runfailure-mds b/lustre/tests/runfailure-mds new file mode 100755 index 0000000..adb5a1f --- /dev/null +++ b/lustre/tests/runfailure-mds @@ -0,0 +1,81 @@ +#!/bin/sh + +SRCDIR="`dirname $0`" +. $SRCDIR/common.sh + +NETWORK=tcp +LOCALHOST=localhost +SERVER=localhost +PORT=1234 + +setup +setup_portals + +new_fs ext2 /tmp/ost 10000 +OST=$LOOPDEV +MDSFS=ext3 +new_fs ${MDSFS} /tmp/mds 10000 +MDS=$LOOPDEV + +echo 0xffffffff > /proc/sys/portals/debug + +$OBDCTL < /proc/sys/lustre/fail_loc + shift + echo "Running '$*'" + $* + + echo 0 > /proc/sys/lustre/fail_loc + + echo "Cleaning up and restarting MDS" + umount /mnt/obd + $OBDCTL <<- EOF + device 0 + cleanup + detach + attach mds + setup ${MDS} ${MDSFS} + EOF + mount -t lustre_light -o device=3 none /mnt/obd +} + +set -vx + +touch /mnt/obd/foo +sync + +# OBD_FAIL_MDS_REINT_SETATTR_WRITE - MDS will discard data from setattr +test_fail 0x10a chmod 000 /mnt/obd/foo +ls -l /mnt/obd/foo + +# OBD_FAIL_MDS_REINT_CREATE_WRITE - MDS will discard data from create +test_fail 0x10c touch /mnt/obd/bar +ls /mnt/obd + +# OBD_FAIL_MDS_REINT_UNLINK_WRITE - MDS will discard data from create +test_fail 0x10e rm /mnt/obd/foo +ls /mnt/obd + +# OBD_FAIL_MDS_REINT_RENAME_WRITE - MDS will discard data from create +test_fail 0x112 mv /mnt/obd/foo /mnt/obd/bar +ls /mnt/obd + +echo "Done." -- 1.8.3.1