Whamcloud - gitweb
LU-160 Split small/big file parts of test_155_load
authorPrakash Surya <surya1@llnl.gov>
Tue, 10 May 2011 16:58:44 +0000 (09:58 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 18 May 2011 23:42:30 +0000 (16:42 -0700)
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 <surya1@llnl.gov>
Change-Id: Ic895fb8590f1d15fbd1889b64b0a6143ff1c6289
Reviewed-on: http://review.whamcloud.com/528
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Chris Gearing <chris@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index bd56ac5..4e747ee 100644 (file)
@@ -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