From 7a2519183f9d039d454e466221c60bc46860ee79 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Apr 2010 15:23:06 -0700 Subject: [PATCH] b=22312 sanity test 33c has problems parsing llobdstat when write_bytes is large i=robert.read@sun.com --- lustre/tests/sanity.sh | 28 +++++++++++++++++++--------- lustre/tests/test-framework.sh | 9 --------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 2f1f1a9..278c443 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1741,11 +1741,11 @@ test_33c() { ostname=$(printf "lustre-OST%.4d" $((ostnum - 1))) # Parsing llobdstat's output sucks; we could grep the /proc # path, but that's likely to not be as portable as using the - # llobdstat utility. Besides, this way we also test that - # utility. - write_bytes=$(do_facet ost$ostnum $LLOBDSTAT $ostname | - sed -e 's/^.*, Write: \([0-9][0-9]*\),.*$/\1/' | - grep '^[0-9]*$') + # llobdstat utility. So we parse lctl output instead. + write_bytes=$(do_facet ost$ostnum lctl get_param -n \ + obdfilter/$ostname/stats | + awk '/^write_bytes/ {print $7}' ) + echo "baseline_write_bytes@$OSTnum/$ostname=$write_bytes" if (( ${write_bytes:-0} > 0 )) then all_zeros=false @@ -1763,9 +1763,10 @@ test_33c() { # Total up write_bytes after writing. We'd better find non-zeros. for ostnum in $(seq $OSTCOUNT); do ostname=$(printf "lustre-OST%.4d" $((ostnum - 1))) - write_bytes=$(do_facet ost$ostnum $LLOBDSTAT $ostname | - sed -e 's/^.*, Write: \([0-9][0-9]*\),.*$/\1/' | - grep '^[0-9]*$') + write_bytes=$(do_facet ost$ostnum lctl get_param -n \ + obdfilter/$ostname/stats | + awk '/^write_bytes/ {print $7}' ) + echo "write_bytes@$OSTnum/$ostname=$write_bytes" if (( ${write_bytes:-0} > 0 )) then all_zeros=false @@ -1773,7 +1774,16 @@ test_33c() { fi done - $all_zeros && error "OST not keeping write_bytes stats (b22312)" + if $all_zeros + then + for ostnum in $(seq $OSTCOUNT); do + ostname=$(printf "lustre-OST%.4d" $((ostnum - 1))) + echo "Check that write_bytes is present in obdfilter/*/stats:" + do_facet ost$ostnum lctl get_param -n \ + obdfilter/$ostname/stats + done + error "OST not keeping write_bytes stats (b22312)" + fi } run_test 33c "test llobdstat and write_bytes" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 0165fee..be08a46 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -34,15 +34,6 @@ if [ -f "$EXCEPT_LIST_FILE" ]; then . $EXCEPT_LIST_FILE fi -if [[ -x $LUSTRE/utils/llobdstat ]]; then - LLOBDSTAT=$LUSTRE/utils/llobdstat -elif [[ -x /usr/bin/llobdstat ]]; then - LLOBDSTAT=/usr/bin/llobdstat -else - # Good luck - LLOBDSTAT=llobdstat -fi - [ -z "$MODPROBECONF" -a -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf [ -z "$MODPROBECONF" -a -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre -- 1.8.3.1