run_test 18c "Dropped connect reply after eviction handing (14755)"
test_19a() {
- f=$DIR/$tfile
- do_facet client mcreate $f || return 1
- drop_ldlm_cancel "chmod 0777 $f" || echo "evicted as expected"
+ local BEFORE=`date +%s`
+ local EVICT
- do_facet client checkstat -v -p 0777 $f || echo evicted
- # let the client reconnect
- sleep 5
- do_facet client "munlink $f"
+ mount_client $DIR2
+
+ do_facet client mcreate $DIR/$tfile || return 1
+ drop_ldlm_cancel "chmod 0777 $DIR2"
+
+ umount_client $DIR2
+ do_facet client "munlink $DIR/$tfile"
+
+ # let the client reconnect
+ sleep 5
+ EVICT=$(do_facet client $LCTL get_param mdc.$FSNAME-MDT*.state | \
+ awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
+
+ [ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] || error "no eviction"
}
run_test 19a "test expired_lock_main on mds (2867)"
test_19b() {
- f=$DIR/$tfile
- do_facet client $MULTIOP $f Ow || return 1
- do_facet client $MULTIOP $f or || return 2
+ local BEFORE=`date +%s`
+ local EVICT
- cancel_lru_locks osc
+ mount_client $DIR2
- do_facet client $MULTIOP $f or || return 3
- drop_ldlm_cancel $MULTIOP $f Ow || echo "client evicted, as expected"
+ do_facet client $MULTIOP $DIR/$tfile Ow || return 1
+ drop_ldlm_cancel $MULTIOP $DIR2/$tfile Ow
+ umount_client $DIR2
+ do_facet client munlink $DIR/$tfile
+
+ # let the client reconnect
+ sleep 5
+ EVICT=$(do_facet client $LCTL get_param osc.$FSNAME-OST*.state | \
+ awk -F"[ [,]" '/EVICTED]$/ { if (mx<$4) {mx=$4;} } END { print mx }')
- do_facet client munlink $f || return 4
+ [ ! -z "$EVICT" ] && [[ $EVICT -gt $BEFORE ]] || error "no eviction"
}
run_test 19b "test expired_lock_main on ost (2867)"
#!/bin/bash
-# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
-# vim:shiftwidth=4:softtabstop=4:tabstop=4:
trap 'print_summary && touch $TF_FAIL && \
echo "test-framework exiting on error"' ERR
drop_ldlm_cancel() {
#define OBD_FAIL_LDLM_CANCEL 0x304
- RC=0
- do_facet client lctl set_param fail_loc=0x304
- do_facet client "$@" || RC=$?
- do_facet client lctl set_param fail_loc=0
- return $RC
+ local RC=0
+ local list=$(comma_list $(mdts_nodes) $(osts_nodes))
+ do_nodes $list lctl set_param fail_loc=0x304
+
+ do_facet client "$@" || RC=$?
+
+ do_nodes $list lctl set_param fail_loc=0
+ return $RC
}
drop_bl_callback() {