From f93d0f6a82844f079b5301620301d97bf1ceb1d2 Mon Sep 17 00:00:00 2001 From: Prakash Surya Date: Tue, 10 May 2011 09:58:44 -0700 Subject: [PATCH] LU-160 Split small/big file parts of test_155_load Separate the small file parts and the big file parts of test_155_load into different tests. This has the benefit of always running the small file portions of test 155, even if the big file tests are skipped. Signed-off-by: Prakash Surya Change-Id: Ic895fb8590f1d15fbd1889b64b0a6143ff1c6289 Reviewed-on: http://review.whamcloud.com/528 Tested-by: Hudson Reviewed-by: Yu Jian Reviewed-by: Chris Gearing Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 82 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index bd56ac5..4e747ee 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6843,23 +6843,9 @@ test_154() { } run_test 154 "Opening a file by FID" -test_155_load() { +test_155_small_load() { local temp=$TMP/$tfile local file=$DIR/$tfile - local list=$(comma_list $(osts_nodes)) - local big=$(do_nodes $list grep "cache" /proc/cpuinfo | \ - awk '{sum+=$4} END{print sum}') - local min_avail=$(lctl get_param -n osc.*[oO][sS][cC]-[^M]*.kbytesavail | \ - sort -n | head -1) - local large_file_size=$((big * 2)) - - log "cache size on OSS is $big KB" - log "large file size is $large_file_size KB" - log "min available OST size is $min_avail KB" - - [ $min_avail -le $large_file_size ] && \ - skip "the minimum available OST size needs > $large_file_size KB" && \ - return 0 dd if=/dev/urandom of=$temp bs=6096 count=1 || \ error "dd of=$temp bs=6096 count=1 failed" @@ -6879,6 +6865,28 @@ test_155_load() { echo "12345" >>$file cmp $temp $file || error "$temp $file differ (append2)" + rm -f $temp $file + true +} + +test_155_big_load() { + local temp=$TMP/$tfile + local file=$DIR/$tfile + local list=$(comma_list $(osts_nodes)) + local big=$(do_nodes $list grep "cache" /proc/cpuinfo | \ + awk '{sum+=$4} END{print sum}') + local min_avail=$(lctl get_param -n osc.*[oO][sS][cC]-[^M]*.kbytesavail | \ + sort -n | head -1) + local large_file_size=$((big * 2)) + + log "cache size on OSS is $big KB" + log "large file size is $large_file_size KB" + log "min available OST size is $min_avail KB" + + [ $min_avail -le $large_file_size ] && \ + skip "the minimum available OST size needs > $large_file_size KB" && \ + return 0 + dd if=/dev/urandom of=$temp bs=$large_file_size count=1k || \ error "dd of=$temp bs=$large_file_size count=1k failed" cp $temp $file @@ -6893,30 +6901,58 @@ test_155_load() { test_155a() { set_cache read on set_cache writethrough on - test_155_load + test_155_small_load } -run_test 155a "Verification of correctness: read cache:on write_cache:on" +run_test 155a "Verify small file correctness: read cache:on write_cache:on" test_155b() { set_cache read on set_cache writethrough off - test_155_load + test_155_small_load } -run_test 155b "Verification of correctness: read cache:on write_cache:off" +run_test 155b "Verify small file correctness: read cache:on write_cache:off" test_155c() { set_cache read off set_cache writethrough on - test_155_load + test_155_small_load } -run_test 155c "Verification of correctness: read cache:off write_cache:on" +run_test 155c "Verify small file correctness: read cache:off write_cache:on" test_155d() { set_cache read off set_cache writethrough off - test_155_load + test_155_small_load +} +run_test 155d "Verify small file correctness: read cache:off write_cache:off" + +test_155e() { + set_cache read on + set_cache writethrough on + test_155_big_load +} +run_test 155e "Verify big file correctness: read cache:on write_cache:on" + +test_155f() { + set_cache read on + set_cache writethrough off + test_155_big_load +} +run_test 155f "Verify big file correctness: read cache:on write_cache:off" + +test_155g() { + set_cache read off + set_cache writethrough on + test_155_big_load +} +run_test 155g "Verify big file correctness: read cache:off write_cache:on" + +test_155h() { + set_cache read off + set_cache writethrough off + test_155_big_load } -run_test 155d "Verification of correctness: read cache:off write_cache:off " +run_test 155h "Verify big file correctness: read cache:off write_cache:off" test_156() { local CPAGES=3 -- 1.8.3.1