From b8e6c8bdca9bd0e12d78cd4a06800c13f4293325 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 24 Jan 2019 13:20:48 -0500 Subject: [PATCH] LU-11803 tests: don't assume obd device name Several tests created to exercise lustre were developed on the x86 platform and it was assumed the device name exposed in the sysfs tree are the same across all platforms. Additionally we can update the test to handle the case of using an uuid format for the sysfs directory naming instead of an internal address pointer. Test-Parameters: clientdistro=ubuntu1804 Signed-off-by: James Simmons Change-Id: I704d13059f76337fa49aab77f3e748a70a74f1bc Reviewed-on: https://review.whamcloud.com/33894 Reviewed-by: Andreas Dilger Reviewed-by: James Nunez Tested-by: Jenkins Tested-by: Maloo --- lustre/tests/sanity-flr.sh | 6 +++--- lustre/tests/sanity.sh | 4 ++-- lustre/tests/test-framework.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 2631eca..74cad1a 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -667,7 +667,7 @@ test_0g() { cat $tf &> /dev/null || error "error reading file '$tf'" # verify that the data was provided by OST1 where mirror 1 resides - local nr_read=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-ffff*.stats | + local nr_read=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[-0-9a-f]*.stats | awk '/ost_read/{print $2}') [ -n "$nr_read" ] || error "read was not provided by OST1" } @@ -895,7 +895,7 @@ get_osc_lock_count() { local osc_name local count - osc_name=${FSNAME}-OST$(printf "%04x" $((idx-1)))-osc-'ffff*' + osc_name=${FSNAME}-OST$(printf "%04x" $((idx-1)))-osc-'[-0-9a-f]*' count=$($LCTL get_param -n ldlm.namespaces.$osc_name.lock_count) lock_count=$((lock_count + count)) done @@ -1060,7 +1060,7 @@ test_33() { start_osts 1 # read file again with ost2 failed - $LCTL set_param ldlm.namespaces.lustre-*-osc-ffff*.lru_size=clear + $LCTL set_param ldlm.namespaces.lustre-*-osc-[-0-9a-f]*.lru_size=clear fail ost2 & sleep 1 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 1e0196c..1cdbe3e 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -16694,7 +16694,7 @@ test_255c() { cancel_lru_locks osc count=$($LCTL get_param -n \ - ldlm.namespaces.$FSNAME-OST0000*osc-f*.lock_unused_count) + ldlm.namespaces.$FSNAME-OST0000*osc-[-0-9a-f]*.lock_unused_count) lockahead_test -d $DIR/$tdir -t $i -f $tfile rc=$? @@ -16703,7 +16703,7 @@ test_255c() { fi new_count=$($LCTL get_param -n \ - ldlm.namespaces.$FSNAME-OST0000*osc-f*.lock_unused_count) + ldlm.namespaces.$FSNAME-OST0000*osc-[-0-9a-f]*.lock_unused_count) difference="$((new_count - count))" # Test 15 output is divided by 100 to map down to valid return diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 00997a7..1e7a5b9 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -6875,7 +6875,7 @@ convert_facet2label() { } get_clientosc_proc_path() { - echo "${1}-osc-ffff*" + echo "${1}-osc-[-0-9a-f]*" } # If the 2.0 MDS was mounted on 1.8 device, then the OSC and LOV names -- 1.8.3.1