From 0951e4e8720df406e1ef5a8fa03822302dea7d1f Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 27 Jan 2015 13:44:22 -0500 Subject: [PATCH] LU-2261 test: Re-enable sanity test 156 for zfs With the landing of LU-4259 zfs now supports brw stats like ldiskfs. Earlier sanity test 156 was disabled for zfs but now it can be re-enabled so we can actually verify brw stats on zfs works. Apply additional clean up to test 156: Spaces to tabs. Change-Id: I0a0014bee4c666faadce96177c44953573d85ffd Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/13535 Tested-by: Jenkins Reviewed-by: Alex Zhuravlev Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Andreas Dilger --- lustre/tests/sanity.sh | 215 ++++++++++++++++++++++++------------------------- 1 file changed, 107 insertions(+), 108 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index f13bdd8..ab8b62d 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -10160,142 +10160,141 @@ test_156() { local AFTER local file="$DIR/$tfile" - [ "$(facet_fstype ost1)" = "zfs" ] && - skip "LU-1956/LU-2261: stats unimplemented on OSD ZFS" && + [ "$(facet_fstype ost1)" = "zfs" -a \ + $(lustre_version_code ost1 -lt $(version_code 2.6.93)) ] && + skip "LU-1956/LU-2261: stats not implemented on OSD ZFS" && return roc_hit_init - log "Turn on read and write cache" - set_cache read on - set_cache writethrough on - - log "Write data and read it back." - log "Read should be satisfied from the cache." - dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" - BEFORE=`roc_hit` - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == CPAGES"; then - error "NOT IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi - - log "Read again; it should be satisfied from the cache." - BEFORE=$AFTER - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == CPAGES"; then - error "NOT IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi + log "Turn on read and write cache" + set_cache read on + set_cache writethrough on + log "Write data and read it back." + log "Read should be satisfied from the cache." + dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" + BEFORE=$(roc_hit) + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == CPAGES"; then + error "NOT IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi - log "Turn off the read cache and turn on the write cache" - set_cache read off - set_cache writethrough on + log "Read again; it should be satisfied from the cache." + BEFORE=$AFTER + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == CPAGES"; then + error "NOT IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi - log "Read again; it should be satisfied from the cache." - BEFORE=`roc_hit` - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == CPAGES"; then - error "NOT IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi + log "Turn off the read cache and turn on the write cache" + set_cache read off + set_cache writethrough on - log "Read again; it should not be satisfied from the cache." - BEFORE=$AFTER - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == 0"; then - error "IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi + log "Read again; it should be satisfied from the cache." + BEFORE=$(roc_hit) + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == CPAGES"; then + error "NOT IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi - log "Write data and read it back." - log "Read should be satisfied from the cache." - dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" - BEFORE=`roc_hit` - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == CPAGES"; then - error "NOT IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi + log "Read again; it should not be satisfied from the cache." + BEFORE=$AFTER + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == 0"; then + error "IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi - log "Read again; it should not be satisfied from the cache." - BEFORE=$AFTER - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == 0"; then - error "IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi + log "Write data and read it back." + log "Read should be satisfied from the cache." + dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" + BEFORE=$(roc_hit) + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == CPAGES"; then + error "NOT IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi + log "Read again; it should not be satisfied from the cache." + BEFORE=$AFTER + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == 0"; then + error "IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi - log "Turn off read and write cache" - set_cache read off - set_cache writethrough off + log "Turn off read and write cache" + set_cache read off + set_cache writethrough off - log "Write data and read it back" - log "It should not be satisfied from the cache." - rm -f $file - dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" - cancel_lru_locks osc - BEFORE=`roc_hit` - cat $file >/dev/null - AFTER=`roc_hit` + log "Write data and read it back" + log "It should not be satisfied from the cache." + rm -f $file + dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" + cancel_lru_locks osc + BEFORE=$(roc_hit) + cat $file >/dev/null + AFTER=$(roc_hit) if ! let "AFTER - BEFORE == 0"; then error_ignore bz20762 "IN CACHE: before: $BEFORE, after: $AFTER" else log "cache hits:: before: $BEFORE, after: $AFTER" fi - log "Turn on the read cache and turn off the write cache" - set_cache read on - set_cache writethrough off + log "Turn on the read cache and turn off the write cache" + set_cache read on + set_cache writethrough off - log "Write data and read it back" - log "It should not be satisfied from the cache." - rm -f $file - dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" - BEFORE=`roc_hit` - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` + log "Write data and read it back" + log "It should not be satisfied from the cache." + rm -f $file + dd if=/dev/urandom of=$file bs=4k count=$CPAGES || error "dd failed" + BEFORE=$(roc_hit) + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) if ! let "AFTER - BEFORE == 0"; then error_ignore bz20762 "IN CACHE: before: $BEFORE, after: $AFTER" else log "cache hits:: before: $BEFORE, after: $AFTER" fi - log "Read again; it should be satisfied from the cache." - BEFORE=`roc_hit` - cancel_lru_locks osc - cat $file >/dev/null - AFTER=`roc_hit` - if ! let "AFTER - BEFORE == CPAGES"; then - error "NOT IN CACHE: before: $BEFORE, after: $AFTER" - else - log "cache hits:: before: $BEFORE, after: $AFTER" - fi + log "Read again; it should be satisfied from the cache." + BEFORE=$(roc_hit) + cancel_lru_locks osc + cat $file >/dev/null + AFTER=$(roc_hit) + if ! let "AFTER - BEFORE == CPAGES"; then + error "NOT IN CACHE: before: $BEFORE, after: $AFTER" + else + log "cache hits:: before: $BEFORE, after: $AFTER" + fi - rm -f $file + rm -f $file } -run_test 156 "Verification of tunables ============================" +run_test 156 "Verification of tunables" #Changelogs err17935 () { -- 1.8.3.1