Whamcloud - gitweb
LU-160 Reduce OST size requirement for test 155
authorPrakash Surya <surya1@llnl.gov>
Wed, 11 May 2011 15:57:19 +0000 (08:57 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 25 May 2011 22:34:41 +0000 (15:34 -0700)
The OST size requirements for sanity test 155 is reduced by running with
only a single-striped file on a particular OST, and only checking the
RAM on that OST's OSS node. Because it is no longer trying to create a
file larger than multiple OSS nodes' RAM while only striped over a
single OST, these tests should run at times when they previously would
not have.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I4c1829240f4cd44366ad0de24ef6caa444f98801
Reviewed-on: http://review.whamcloud.com/534
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Chris Gearing <chris@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 49c4c35..2a2b650 100644 (file)
@@ -6872,21 +6872,21 @@ test_155_small_load() {
 test_155_big_load() {
     local temp=$TMP/$tfile
     local file=$DIR/$tfile
 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" && \
+
+    free_min_max
+    local cache_size=$(do_facet ost$((MAXI+1)) \
+        "awk '/cache/ {sum+=\\\$4} END {print sum}' /proc/cpuinfo")
+    local large_file_size=$((cache_size * 2))
+
+    echo "OSS cache size: $cache_size KB"
+    echo "Large file size: $large_file_size KB"
+
+    [ $MAXV -le $large_file_size ] && \
+        skip_env "max available OST size needs > $large_file_size KB" && \
         return 0
 
         return 0
 
+    $SETSTRIPE $file -c 1 -i $MAXI || error "$SETSTRIPE $file failed"
+
     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
     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