From e4fba379cab38d4cf2188d10a9fceb35f8c3b615 Mon Sep 17 00:00:00 2001 From: Yu Jian Date: Wed, 6 Apr 2011 22:10:33 +0800 Subject: [PATCH] LU-183 replace osd with osd* in proc paths Fix the test scripts to use "osd*" instead of "osd" so that it works with any OSD type. Signed-off-by: Yu Jian Change-Id: Ibc403ff146a7f429acb16c35449ec3026f6a3c7b Reviewed-on: http://review.whamcloud.com/405 Tested-by: Hudson Reviewed-by: Brian J. Murrell Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 6 ++++-- lustre/tests/sanityn.sh | 2 +- lustre/tests/test-framework.sh | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 17b9c9b..4d76798 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -3507,7 +3507,8 @@ test_57b() { sync sleep 1 df $dir #make sure we get new statfs data - local MDSFREE=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree) + local MDSFREE=$(do_facet $mymds \ + lctl get_param -n osd*.*MDT000$((num -1)).kbytesfree) local MDCFREE=$(lctl get_param -n mdc.*MDT000$((num -1))-mdc-*.kbytesfree) echo "opening files to create objects/EAs" local FILE @@ -3521,7 +3522,8 @@ test_57b() { sleep 1 #make sure we get new statfs data df $dir - local MDSFREE2=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree) + local MDSFREE2=$(do_facet $mymds \ + lctl get_param -n osd*.*MDT000$((num -1)).kbytesfree) local MDCFREE2=$(lctl get_param -n mdc.*MDT000$((num -1))-mdc-*.kbytesfree) if [ "$MDCFREE2" -lt "$((MDCFREE - 8))" ]; then if [ "$MDSFREE" != "$MDSFREE2" ]; then diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index c8ae0c3..15c3109 100644 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -710,7 +710,7 @@ print_jbd_stat () { local stat=0 for mds in ${mdts//,/ }; do varsvc=${mds}_svc - dev=$(basename $(do_facet $mds lctl get_param -n osd.${!varsvc}.mntdev)) + dev=$(basename $(do_facet $mds lctl get_param -n osd*.${!varsvc}.mntdev)) val=$(do_facet $mds "procfile=/proc/fs/jbd/$dev/info; [ -f \\\$procfile ] || procfile=/proc/fs/jbd2/$dev/info; [ -f \\\$procfile ] || procfile=/proc/fs/jbd2/${dev}\:\\\*/info; diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index dab56fe2..e690144 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -3084,8 +3084,11 @@ pass() { } check_mds() { - FFREE=$(do_node $SINGLEMDS lctl get_param -n osd.*MDT*.filesfree | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}') - FTOTAL=$(do_node $SINGLEMDS lctl get_param -n osd.*MDT*.filestotal | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}') + local FFREE=$(do_node $SINGLEMDS \ + lctl get_param -n osd*.*MDT*.filesfree | calc_sum) + local FTOTAL=$(do_node $SINGLEMDS \ + lctl get_param -n osd*.*MDT*.filestotal | calc_sum) + [ $FFREE -ge $FTOTAL ] && error "files free $FFREE > total $FTOTAL" || true } -- 1.8.3.1