From: Andreas Dilger Date: Mon, 11 Nov 2024 19:16:00 +0000 (-0800) Subject: LU-15496 tests: fix sanity/398c to use proper OSC name X-Git-Tag: 2.15.6-RC1~13 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F56977%2F2;p=fs%2Flustre-release.git LU-15496 tests: fix sanity/398c to use proper OSC name For ppc64le and aarch64 clients, the OSC import instance name does not have "ffff" at the start, so use the proper device name for this subtest. Clean up the rest of test_398c to meet modern test code style. Lustre-change: https://review.whamcloud.com/55132 Lustre-commit: b1b57bcadeeb5a87ac75387c4aa4ae084e1a27e0 LU-15496 tests: add debugging to sanity/398c Dump the rpc_stats to help understand why the test is failing. Lustre-change: https://review.whamcloud.com/53462 Lustre-commit: 304ca31e2aa15c576e468a86e45d8817c8eca391 Test-Parameters: trivial testlist=sanity clientarch=ppc64le env=ONLY=398c,ONLY_REPEAT=100 Signed-off-by: Andreas Dilger Change-Id: If8c72fa9b13eace009f39daf82454221eba6761b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56977 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index fdb4acc..5393847 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -24626,19 +24626,18 @@ test_398b() { # LU-4198 run_test 398b "DIO and buffer IO race" test_398c() { # LU-4198 - local ost1_imp=$(get_osc_import_name client ost1) - local imp_name=$($LCTL list_param osc.$ost1_imp | head -n1 | - cut -d'.' -f2) + local ost1_imp="osc.$(get_osc_import_name client ost1)" + local imp_name=($($LCTL list_param $ost1_imp | cut -d'.' -f2)) which fio || skip_env "no fio installed" saved_debug=$($LCTL get_param -n debug) $LCTL set_param debug=0 - local size=$(lctl get_param -n osc.$FSNAME-OST0000*.kbytesavail | head -1) - ((size /= 1024)) # by megabytes - ((size /= 2)) # write half of the OST at most - [ $size -gt 40 ] && size=40 #reduce test time anyway + local size=($($LCTL get_param -n $ost1_imp.kbytesavail)) + (( size /= 1024 )) # by megabytes + (( size /= 2 )) # write half of the OST at most + (( size <= 40 )) || size=40 #reduce test time anyway $LFS setstripe -c 1 $DIR/$tfile @@ -24648,7 +24647,7 @@ test_398c() { # LU-4198 cancel_lru_locks osc # clear and verify rpc_stats later - $LCTL set_param osc.${FSNAME}-OST0000-osc-ffff*.rpc_stats=clear + $LCTL set_param $ost1_imp.rpc_stats=clear local njobs=4 echo "writing ${size}M to OST0 by fio with $njobs jobs..." @@ -24658,14 +24657,17 @@ test_398c() { # LU-4198 --filename=$DIR/$tfile [ $? -eq 0 ] || error "fio write error" - [ $($LCTL get_param -n ldlm.namespaces.$imp_name.lock_count) -eq 0 ] || + (( $($LCTL get_param -n ldlm.namespaces.$imp_name.lock_count) == 0 )) || error "Locks were requested while doing AIO" # get the percentage of 1-page I/O pct=$($LCTL get_param osc.${imp_name}.rpc_stats | grep -A 1 'pages per rpc' | grep -v 'pages per rpc' | awk '{print $7}') - [ $pct -le 50 ] || error "$pct% of I/O are 1-page" + (( $pct <= 50 )) || { + $LCTL get_param osc.${imp_name}.rpc_stats + error "$pct% of I/O are 1-page" + } echo "mix rw ${size}M to OST0 by fio with $njobs jobs..." fio --name=rand-rw --rw=randrw --bs=$PAGE_SIZE --direct=1 \