run_test 53 "verify that MDS and OSTs agree on pre-creation ===="
test_54a() {
- [ ! -f "$SOCKETSERVER" ] &&
- skip_env "no socketserver, skipping" && return
- [ ! -f "$SOCKETCLIENT" ] &&
- skip_env "no socketclient, skipping" && return
- $SOCKETSERVER $DIR/socket
- $SOCKETCLIENT $DIR/socket || error "$SOCKETCLIENT $DIR/socket failed"
- $MUNLINK $DIR/socket
+ $SOCKETSERVER $DIR/socket ||
+ error "$SOCKETSERVER $DIR/socket failed: $?"
+ $SOCKETCLIENT $DIR/socket ||
+ error "$SOCKETCLIENT $DIR/socket failed: $?"
+ $MUNLINK $DIR/socket || error "$MUNLINK $DIR/socket failed: $?"
}
run_test 54a "unix domain socket test =========================="
test_60a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
remote_mgs_nodsh && skip "remote MGS with nodsh" && return
- [ ! -f run-llog.sh ] && skip_env "missing subtest run-llog.sh" && return
+ do_facet mgs "! which run-llog.sh &> /dev/null" &&
+ skip_env "missing subtest run-llog.sh" && return
log "$TEST60_HEAD - from kernel mode"
do_facet mgs sh run-llog.sh
}
test_64b () {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- [ ! -f oos.sh ] && skip_env "missing subtest oos.sh" && return
- sh oos.sh $MOUNT
+ sh oos.sh $MOUNT || error "oos.sh failed: $?"
}
run_test 64b "check out-of-space detection on client ==========="
test_185() { # LU-2441
+ # LU-3553 - no volatile file support in old servers
+ [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.60) ]] ||
+ { skip "Need MDS version at least 2.3.60"; return 0; }
+
mkdir -p $DIR/$tdir || error "creating dir $DIR/$tdir"
touch $DIR/$tdir/spoo
local mtime1=$(stat -c "%Y" $DIR/$tdir)
}
run_test 207b "can refresh layout at open"
+test_208() {
+ # FIXME: in this test suite, only RD lease is used. This is okay
+ # for now as only exclusive open is supported. After generic lease
+ # is done, this test suite should be revised. - Jinshan
+
+ [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.4.52) ]] ||
+ { skip "Need MDS version at least 2.4.52"; return 0; }
+
+ echo "==== test 1: verify get lease work"
+ $MULTIOP $DIR/$tfile oO_CREAT:O_RDWR:eRE+eU || error "get lease error"
+
+ echo "==== test 2: verify lease can be broken by upcoming open"
+ $MULTIOP $DIR/$tfile oO_RDONLY:eR_E-eUc &
+ local PID=$!
+ sleep 1
+
+ $MULTIOP $DIR/$tfile oO_RDONLY:c
+ kill -USR1 $PID && wait $PID || error "break lease error"
+
+ echo "==== test 3: verify lease can't be granted if an open already exists"
+ $MULTIOP $DIR/$tfile oO_RDONLY:_c &
+ local PID=$!
+ sleep 1
+
+ $MULTIOP $DIR/$tfile oO_RDONLY:eReUc && error "apply lease should fail"
+ kill -USR1 $PID && wait $PID || error "open file error"
+
+ echo "==== test 4: lease can sustain over recovery"
+ $MULTIOP $DIR/$tfile oO_RDONLY:eR_E+eUc &
+ PID=$!
+ sleep 1
+
+ fail mds1
+
+ kill -USR1 $PID && wait $PID || error "lease broken over recovery"
+
+ echo "==== test 5: lease broken can't be regained by replay"
+ $MULTIOP $DIR/$tfile oO_RDONLY:eR_E-eUc &
+ PID=$!
+ sleep 1
+
+ # open file to break lease and then recovery
+ $MULTIOP $DIR/$tfile oO_RDWR:c || error "open file error"
+ fail mds1
+
+ kill -USR1 $PID && wait $PID || error "lease not broken over recovery"
+
+ rm -f $DIR/$tfile
+}
+run_test 208 "Exclusive open"
+
test_212() {
size=`date +%s`
size=$((size % 8192 + 1))
[ $stripe_count -eq 2 ] || error "stripe count not 2 ($stripe_count)"
stat $DIR/$tfile || error "failed to stat released file"
- # Truncate should fail.
$TRUNCATE $DIR/$tfile 200000 &&
error "truncate of released file should fail"
stripe_count=$($GETSTRIPE -c $DIR/$tfile) || error "getstripe failed"
[ $stripe_count -eq 2 ] || error "after trunc: ($stripe_count)"
+ chown $RUNAS_ID $DIR/$tfile ||
+ error "chown $RUNAS_ID $DIR/$tfile failed"
+
+ chgrp $RUNAS_ID $DIR/$tfile ||
+ error "chgrp $RUNAS_ID $DIR/$tfile failed"
+
+ touch $DIR/$tfile ||
+ error "touch $DIR/$tfile failed"
+
rm $DIR/$tfile || error "failed to remove released file"
}
-run_test 229 "getstripe/stat/rm work on released files (stripe count = 2)"
+run_test 229 "getstripe/stat/rm/attr changes work on released files"
test_230a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return