Whamcloud - gitweb
b=14471
authorgrev <grev>
Wed, 15 Oct 2008 17:11:01 +0000 (17:11 +0000)
committergrev <grev>
Wed, 15 Oct 2008 17:11:01 +0000 (17:11 +0000)
i=Adilger
replace lustre proc by lctl [set|get]_param

lustre/tests/lfscktest.sh
lustre/tests/replay-ost-single.sh
lustre/tests/test-framework.sh

index e445f14..cc56df8 100755 (executable)
@@ -45,7 +45,7 @@ if [ "$WAS_MOUNTED" ]; then
 fi
 
 get_mnt_devs() {
-       DEVS=`cat /proc/fs/lustre/$1/*/mntdev`
+       DEVS=`lctl get_param -n $1.*.mntdev`
        for DEV in $DEVS; do
                case $DEV in
                *loop*) losetup $DEV | sed -e "s/.*(//" -e "s/).*//" ;;
index 1b1c5e8..5902ebc 100755 (executable)
@@ -118,7 +118,7 @@ test_5() {
 run_test 5 "Fail OST during iozone"
 
 kbytesfree() {
-   lctl get_param -n osc.*-osc-*.kbytesfree | awk '{total+=$1} END {print total}'
+   calc_osc_kbytes kbytesfree
 }
 
 test_6() {
index db9f281..f0f1b23 100644 (file)
@@ -1947,6 +1947,14 @@ calc_llite_stats() {
         echo $res
 }
 
+calc_sum () {
+        awk 'BEGIN {s = 0}; {s += $1}; END {print s}'
+}
+
+calc_osc_kbytes () {
+        $LCTL get_param -n osc.*[oO][sS][cC][-_]*.$1 | calc_sum
+}
+
 # save_lustre_params(node, parameter_mask)
 # generate a stream of formatted strings (<node> <param name>=<param value>)
 save_lustre_params() {