X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=c190c7c76b23cfcba4cb5372a956abf56353fd87;hp=41bcfc6faf991f5a412f23994a8c902b4069f445;hb=020e353a21add0181af4a78302d2cd2e12bdf82d;hpb=b66f20c77d7501331d301ea61b62d0280bab677e diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 41bcfc6..c190c7c 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -8456,15 +8456,29 @@ test_151() { set_osd_param $list '' writethrough_cache_enable 1 - # pages should be in the case right after write - dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES || error "dd failed" - local BEFORE=`roc_hit` - cancel_lru_locks osc - cat $DIR/$tfile >/dev/null - local AFTER=`roc_hit` - if ! let "AFTER - BEFORE == CPAGES"; then - error "NOT IN CACHE: before: $BEFORE, after: $AFTER" - fi + # check write cache is enabled on all obdfilters + if get_osd_param $list '' writethrough_cache_enable | grep 0; then + echo "oss write cache is NOT enabled" + return 0 + fi + +#define OBD_FAIL_OBD_NO_LRU 0x609 + do_nodes $list $LCTL set_param fail_loc=0x609 + + # pages should be in the case right after write + dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES || + error "dd failed" + + local BEFORE=`roc_hit` + cancel_lru_locks osc + cat $DIR/$tfile >/dev/null + local AFTER=`roc_hit` + + do_nodes $list $LCTL set_param fail_loc=0 + + if ! let "AFTER - BEFORE == CPAGES"; then + error "NOT IN CACHE: before: $BEFORE, after: $AFTER" + fi # the following read invalidates the cache cancel_lru_locks osc