Whamcloud - gitweb
LU-11803 tests: don't assume obd device name 94/33894/8
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 24 Jan 2019 18:20:48 +0000 (13:20 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Feb 2019 06:37:36 +0000 (06:37 +0000)
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 <uja.ornl@yahoo.com>
Change-Id: I704d13059f76337fa49aab77f3e748a70a74f1bc
Reviewed-on: https://review.whamcloud.com/33894
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/sanity-flr.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh

index 2631eca..74cad1a 100644 (file)
@@ -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
        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"
 }
                        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
 
                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
                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
        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
 
        fail ost2 &
        sleep 1
index 1e0196c..1cdbe3e 100755 (executable)
@@ -16694,7 +16694,7 @@ test_255c() {
                cancel_lru_locks osc
 
                count=$($LCTL get_param -n \
                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=$?
 
                lockahead_test -d $DIR/$tdir -t $i -f $tfile
                rc=$?
@@ -16703,7 +16703,7 @@ test_255c() {
                fi
 
                new_count=$($LCTL get_param -n \
                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
                difference="$((new_count - count))"
 
                # Test 15 output is divided by 100 to map down to valid return
index 00997a7..1e7a5b9 100755 (executable)
@@ -6875,7 +6875,7 @@ convert_facet2label() {
 }
 
 get_clientosc_proc_path() {
 }
 
 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
 }
 
 # If the 2.0 MDS was mounted on 1.8 device, then the OSC and LOV names