From 996b6269a23c53faf5cc37b56edee95497a7cba6 Mon Sep 17 00:00:00 2001 From: bobijam Date: Wed, 13 Aug 2008 02:22:04 +0000 Subject: [PATCH] Branch b1_8_gate b=15924 i=johann add a test case for bug 15924, combine flock tests code into a single file flocks_test.c --- lustre/tests/sanity.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 5eed453..ec08c22 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -4091,9 +4091,9 @@ test_105a() { touch $DIR/$tfile if [ -n "`mount | grep \"$DIR.*flock\" | grep -v noflock`" ]; then - flocks_test on -f $DIR/$tfile || error "fail flock on" + flocks_test 1 on -f $DIR/$tfile || error "fail flock on" else - flocks_test off -f $DIR/$tfile || error "fail flock off" + flocks_test 1 off -f $DIR/$tfile || error "fail flock off" fi } run_test 105a "flock when mounted without -o flock test ========" @@ -4102,9 +4102,9 @@ test_105b() { touch $DIR/$tfile if [ -n "`mount | grep \"$DIR.*flock\" | grep -v noflock`" ]; then - flocks_test on -c $DIR/$tfile || error "fail flock on" + flocks_test 1 on -c $DIR/$tfile || error "fail flock on" else - flocks_test off -c $DIR/$tfile || error "fail flock off" + flocks_test 1 off -c $DIR/$tfile || error "fail flock off" fi } run_test 105b "fcntl when mounted without -o flock test ========" @@ -4113,13 +4113,23 @@ test_105c() { touch $DIR/$tfile if [ -n "`mount | grep \"$DIR.*flock\" | grep -v noflock`" ]; then - flocks_test on -l $DIR/$tfile || error "fail flock on" + flocks_test 1 on -l $DIR/$tfile || error "fail flock on" else - flocks_test off -l $DIR/$tfile || error "fail flock off" + flocks_test 1 off -l $DIR/$tfile || error "fail flock off" fi } run_test 105c "lockf when mounted without -o flock test ========" +test_105d() { # bug 15924 + mkdir -p $DIR/$tdir + [ -z "`mount | grep \"$DIR.*flock\" | grep -v noflock`" ] && \ + skip "mount w/o flock enabled" && return + #define OBD_FAIL_LDLM_CP_CB_WAIT 0x315 + $LCTL set_param fail_loc=0x80000315 + flocks_test 2 $DIR/$tdir +} +run_test 105d "flock race (should not freeze) ========" + test_106() { #bug 10921 mkdir -p $DIR/$tdir $DIR/$tdir && error "exec $DIR/$tdir succeeded" -- 1.8.3.1