Whamcloud - gitweb
LU-7631 tests: add debug info to conf-sanity 82a 89/33689/3
authorJames Nunez <jnunez@whamcloud.com>
Tue, 20 Nov 2018 15:38:26 +0000 (08:38 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 16 Jan 2019 07:06:32 +0000 (07:06 +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
Signed-off-by: James Nunez <jnunez@whamcloud.com>
Change-Id: Ifc75d52d38d9cb401118ef7baa4014bddf6298f2
Reviewed-on: https://review.whamcloud.com/33689
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh

index 00295d3..4bcb5f2 100644 (file)
@@ -5906,7 +5906,7 @@ test_82a() { # LU-4665
        done
        ost_indices=$(comma_list $ost_indices)
 
        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
 
        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
 
                        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"
 
        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
        # 1. If the file does not exist, new file will be created
        #    with specified OSTs.
        local file=$DIR/$tdir/$tfile-1
index 1bb56f6..1a044d2 100755 (executable)
@@ -8689,15 +8689,15 @@ check_stripe_count() {
        [[ -z "$file" || -z "$expected" ]] &&
                error "check_stripe_count: invalid argument"
 
        [[ -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
        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
 }
 
        fi
 }