X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frunfailure-mds;h=f2942c35053faed95043039166216d9a3ee17f28;hb=a2210b7e0b2b8e0ea7d722f673ab0719a0195749;hp=b6240c36e3bb087ae900bd89b1a7275de0e6be03;hpb=f4c2bf6fd38d2000a5630bdd0ed184db759bae92;p=fs%2Flustre-release.git diff --git a/lustre/tests/runfailure-mds b/lustre/tests/runfailure-mds index b6240c3..f2942c3 100755 --- a/lustre/tests/runfailure-mds +++ b/lustre/tests/runfailure-mds @@ -3,39 +3,9 @@ SRCDIR="`dirname $0`" . $SRCDIR/common.sh -NETWORK=tcp -LOCALHOST=localhost -SERVER=localhost -PORT=1234 +. $SRCDIR/llmount.sh -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 @@ -44,47 +14,50 @@ test_fail() { $* echo "Cleaning up and restarting MDS" - umount /mnt/obd + umount /mnt/lustre || fail "unable to unmount" $OBDCTL <<- EOF - device 0 + name2dev MDSDEV cleanup detach + quit EOF echo 0 > /proc/sys/lustre/fail_loc $OBDCTL <<- EOF - device 0 - attach mds + newdev + attach mds MDSDEV setup ${MDS} ${MDSFS} + quit EOF - mount -t lustre_light -o device=3 none /mnt/obd + $MNT } -set -vx +#set -vx -touch /mnt/obd/foo -chmod a+x /mnt/obd/foo +touch /mnt/lustre/foo +chmod a+x /mnt/lustre/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 -[ ! -x /mnt/obd/foo ] && echo "/mnt/obd/foo is executable!" 1>&2 && exit -1 +test_fail 0x10a chmod 000 /mnt/lustre/foo +ls -l /mnt/lustre/foo +[ ! -x /mnt/lustre/foo ] && fail "/mnt/lustre/foo is not executable!" # OBD_FAIL_MDS_REINT_CREATE_WRITE - MDS will not create the file -test_fail 0x10c touch /mnt/obd/bar -ls /mnt/obd/bar -[ $? -eq 0 ] && echo "/mnt/obd/bar was created!" 1>&2 && exit -1 +test_fail 0x10c touch /mnt/lustre/bar +ls /mnt/lustre/bar +[ $? -eq 0 ] && fail "/mnt/lustre/bar was created!" # OBD_FAIL_MDS_REINT_UNLINK_WRITE - MDS will discard data from unlink -test_fail 0x10e rm /mnt/obd/foo -ls /mnt/obd/foo -[ $? -eq 1 ] && echo "/mnt/obd/foo has been removed!" 1>&2 && exit -1 +test_fail 0x10e rm /mnt/lustre/foo +ls /mnt/lustre/foo +[ $? -eq 1 ] && fail "/mnt/lustre/foo has been removed!" # OBD_FAIL_MDS_REINT_RENAME_WRITE - MDS will discard data from rename -test_fail 0x112 mv /mnt/obd/foo /mnt/obd/bar -ls /mnt/obd/bar -[ $? -eq 0 ] && echo "/mnt/obd/foo has been renamed to bar!" 1>&2 && exit -1 +test_fail 0x112 mv /mnt/lustre/foo /mnt/lustre/bar +ls /mnt/lustre/foo /mnt/lustre/bar +[ ! -f /mnt/lustre/foo -o -f /mnt/lustre/bar ] && \ + fail "/mnt/lustre/foo has been renamed to bar!" echo "Done."