Whamcloud - gitweb
LU-14204 tests: make sure we have a single import 98/40998/2
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 9 Dec 2020 17:53:12 +0000 (18:53 +0100)
committerOleg Drokin <green@whamcloud.com>
Mon, 13 Sep 2021 19:06:35 +0000 (19:06 +0000)
In sanity, retrieve the exact name of the import being used on the
client, in order to properly get information such as lock_count
or lru_size.

Change-Id: I065b7da7990c7171d5baa24f3400c5f8ffc12fc9
Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-on: https://review.whamcloud.com/40998
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 3f353ff..78c84af 100755 (executable)
@@ -17793,6 +17793,9 @@ test_255c() {
        [ $OST1_VERSION -lt $(version_code 2.10.50) ] &&
                skip "lustre < 2.10.50 does not support lockahead"
 
+       local ost1_imp=$(get_osc_import_name client ost1)
+       local imp_name=$($LCTL list_param osc.$ost1_imp | head -n1 |
+                        cut -d'.' -f2)
        local count
        local new_count
        local difference
@@ -17840,7 +17843,7 @@ test_255c() {
                cancel_lru_locks osc
 
                count=$($LCTL get_param -n \
-                      ldlm.namespaces.$FSNAME-OST0000*osc-[-0-9a-f]*.lock_unused_count)
+                      ldlm.namespaces.$imp_name.lock_unused_count)
 
                lockahead_test -d $DIR/$tdir -t $i -f $tfile
                rc=$?
@@ -17849,7 +17852,7 @@ test_255c() {
                fi
 
                new_count=$($LCTL get_param -n \
-                      ldlm.namespaces.$FSNAME-OST0000*osc-[-0-9a-f]*.lock_unused_count)
+                      ldlm.namespaces.$imp_name.lock_unused_count)
                difference="$((new_count - count))"
 
                # Test 15 output is divided by 100 to map down to valid return
@@ -21756,6 +21759,10 @@ test_815()
 run_test 815 "zero byte tiny write doesn't hang (LU-12382)"
 
 test_816() {
+       local ost1_imp=$(get_osc_import_name client ost1)
+       local imp_name=$($LCTL list_param osc.$ost1_imp | head -n1 |
+                        cut -d'.' -f2)
+
        [ "$SHARED_KEY" = true ] &&
                skip "OSC connections never go IDLE with Shared-Keys enabled"
 
@@ -21769,12 +21776,12 @@ test_816() {
        local before
        local now
        before=$($LCTL get_param -n \
-                ldlm.namespaces.$FSNAME-OST0000-osc-[^M]*.lru_size)
+                ldlm.namespaces.$imp_name.lru_size)
 
        wait_osc_import_state client ost1 IDLE
        dd if=/dev/null of=$DIR/$tfile bs=1k count=1 conv=sync
        now=$($LCTL get_param -n \
-             ldlm.namespaces.$FSNAME-OST0000-osc-[^M]*.lru_size)
+             ldlm.namespaces.$imp_name.lru_size)
        [ $before == $now ] || error "lru_size changed $before != $now"
 }
 run_test 816 "do not reset lru_resize on idle reconnect"