From 0909a1c8d7aa4d9e4f95077da4b3b31e3d4c392f 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. Lustre-change: https://review.whamcloud.com/33894 Lustre-commit: b8e6c8bdca9bd0e12d78cd4a06800c13f4293325 Signed-off-by: James Simmons Change-Id: I704d13059f76337fa49aab77f3e748a70a74f1bc Reviewed-by: Andreas Dilger Reviewed-by: James Nunez Reviewed-on: https://review.whamcloud.com/34783 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- 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 2a25d0d..2298ec1 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -668,7 +668,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" } @@ -899,7 +899,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 @@ -1064,7 +1064,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 72ff347..3d444f5 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -16787,7 +16787,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=$? @@ -16796,7 +16796,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 7f464ab..48ef0ec 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -6867,7 +6867,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