Newer
Older
#
# This test needs to be run on the client
#
. $LUSTRE/tests/test-framework.sh
init_test_env $@
CHECK_GRANT=${CHECK_GRANT:-"yes"}
GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
if [ "$FAILURE_MODE" = "HARD" ] && mixed_ost_devs; then
CONFIG_EXCEPTIONS="0b 42 47 61a 61c"
echo -n "Several ost services on one ost node are used with FAILURE_MODE=$FAILURE_MODE. "
echo "Except the tests: $CONFIG_EXCEPTIONS"
ALWAYS_EXCEPT="$ALWAYS_EXCEPT $CONFIG_EXCEPTIONS"
fi
# 63 min 7 min AT AT AT AT"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="1 2 3 4 6 12 16 44a 44b 65 66 67 68"
build_test_filter
remote_ost_nodsh && skip "remote OST with nodsh" && return 0
# this test attempts to trigger a race in the precreation code,
# and must run before any other objects are created on the filesystem
createmany -o $DIR/$tfile 20 || return 1
unlinkmany $DIR/$tfile 20 || return 2
}
run_test 0b "ensure object created after recover exists. (3284)"
$CHECKSTAT -t file $DIR/$tfile || return 1
rm $DIR/$tfile
run_test 1 "simple create"
$CHECKSTAT -t file $DIR/$tfile || return 1
rm $DIR/$tfile
$CHECKSTAT -t file $DIR/$tfile || return 1
rm $DIR/$tfile
mcreate $DIR/$tfile
o_directory $DIR/$tfile
$CHECKSTAT -t file $DIR/$tfile || return 2
rm $DIR/$tfile
run_test 3a "replay failed open(O_DIRECTORY)"
test_3b() {
#define OBD_FAIL_MDS_OPEN_PACK | OBD_FAIL_ONCE
$CHECKSTAT -t file $DIR/$tfile && return 2
return 0
}
run_test 3b "replay failed open -ENOMEM"
test_3c() {
#define OBD_FAIL_MDS_ALLOC_OBDO | OBD_FAIL_ONCE
$CHECKSTAT -t file $DIR/$tfile && return 2
return 0
}
run_test 3c "replay failed open -ENOMEM"
for i in `seq 10`; do
echo "tag-$i" > $DIR/$tfile-$i
done
for i in `seq 10`; do
grep -q "tag-$i" $DIR/$tfile-$i || error "$tfile-$i"
rm -rf $DIR/$tfile-*
$CHECKSTAT -t file $DIR/$tfile-* && return 1 || true
}
run_test 4b "|x| rm 10 files"
# The idea is to get past the first block of precreated files on both
# osts, and then replay.
test_5() {
for i in `seq 220`; do
echo "tag-$i" > $DIR/$tfile-$i
done
for i in `seq 220`; do
grep -q "tag-$i" $DIR/$tfile-$i || error "f1c-$i"
done
rm -rf $DIR/$tfile-*
sleep 3
# waiting for commitment of removal
}
run_test 5 "|x| 220 open(O_CREAT)"
mcreate $DIR/$tdir/$tfile
$CHECKSTAT -t dir $DIR/$tdir || return 1
$CHECKSTAT -t file $DIR/$tdir/$tfile || return 2
sleep 2
# waiting for log process thread
}
$CHECKSTAT -t dir $DIR/$tdir && return 1 || true
}
run_test 6b "|X| rmdir"
test_7() {
mcreate $DIR/$tdir/$tfile
$CHECKSTAT -t dir $DIR/$tdir || return 1
$CHECKSTAT -t file $DIR/$tdir/$tfile || return 2
rm -fr $DIR/$tdir
}
run_test 7 "mkdir |X| contained create"
test_8() {
multiop_bg_pause $DIR/$tfile mo_c || return 4
ls $DIR/$tfile
$CHECKSTAT -t file $DIR/$tfile || return 1
Loading
Loading full blame...