From: James Nunez Date: Tue, 20 Nov 2018 15:38:26 +0000 (-0700) Subject: LU-7631 tests: add debug info to conf-sanity 82a X-Git-Tag: 2.12.51~55 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e76683a5bd540cacd2271a969aa9acd9bf790ccf LU-7631 tests: add debug info to conf-sanity 82a In the routine check_stripe_count, the different error messages need to be modified so when an error occurs, a user can tell what error was hit. Also, print precreated object information at the beginning of the test and on error. Test-Parameters: trivial mdscount=2 mdtcount=4 testlist=conf-sanity envdefinitions=ONLY=82a Test-Parameters: mdscount=1 mdtcount=1 testlist=conf-sanity envdefinitions=ONLY=82a Signed-off-by: James Nunez Change-Id: Ifc75d52d38d9cb401118ef7baa4014bddf6298f2 Reviewed-on: https://review.whamcloud.com/33689 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 00295d3..4bcb5f2 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -5906,7 +5906,7 @@ test_82a() { # LU-4665 done ost_indices=$(comma_list $ost_indices) - trap "restore_ostindex" EXIT + stack_trap "restore_ostindex" EXIT echo -e "\nFormat $OSTCOUNT OSTs with sparse indices $ost_indices" OST_INDEX_LIST=[$ost_indices] formatall @@ -5917,12 +5917,19 @@ test_82a() { # LU-4665 error "start ost$i failed" done + # Collect debug information - start of test + do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL get_param osc.*.prealloc_*_id + mount_client $MOUNT || error "mount client $MOUNT failed" wait_osts_up $LFS df $MOUNT || error "$LFS df $MOUNT failed" mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed" + stack_trap "do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL get_param osc.*.prealloc_*_id" EXIT + # 1. If the file does not exist, new file will be created # with specified OSTs. local file=$DIR/$tdir/$tfile-1 diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 1bb56f6..1a044d2 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -8689,15 +8689,15 @@ check_stripe_count() { [[ -z "$file" || -z "$expected" ]] && error "check_stripe_count: invalid argument" - local cmd="$GETSTRIPE -c $file" + local cmd="$LFS getstripe -c $file" actual=$($cmd) || error "$cmd failed" actual=${actual%% *} if [[ $actual -ne $expected ]]; then - [[ $expected -eq -1 ]] || - error "$cmd wrong: found $actual, expected $expected" - [[ $actual -eq $OSTCOUNT ]] || - error "$cmd wrong: found $actual, expected $OSTCOUNT" + [[ $expected -eq -1 ]] || { $LFS getstripe $file; + error "$cmd not expected ($expected): found $actual"; } + [[ $actual -eq $OSTCOUNT ]] || { $LFS getstripe $file; + error "$cmd not OST count ($OSTCOUNT): found $actual"; } fi }