Whamcloud - gitweb
LU-7631 tests: add debug info to conf-sanity 82a 94/34294/2
authorJames Nunez <jnunez@whamcloud.com>
Tue, 20 Nov 2018 15:38:26 +0000 (08:38 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 19 Mar 2019 06:01:12 +0000 (06:01 +0000)
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

Lustre-change: https://review.whamcloud.com/33689
Lustre-commit: e76683a5bd540cacd2271a969aa9acd9bf790ccf

Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: Ifc75d52d38d9cb401118ef7baa4014bddf6298f2
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34294
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh

index 7c0c226..12a4eb5 100644 (file)
@@ -5902,7 +5902,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
 
@@ -5913,12 +5913,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
index b42bc9c..7ff0e9e 100755 (executable)
@@ -8687,15 +8687,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
 }