Whamcloud - gitweb
LU-8328 tests: cleanup system after conf-sanity test_86 87/20987/2
authorFan Yong <fan.yong@intel.com>
Wed, 18 May 2016 07:52:31 +0000 (15:52 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Jul 2016 23:59:15 +0000 (23:59 +0000)
The conf-sanity test_86 reformats the OST1 device, it only
checks whether the reformat works or not, but it does not
reformat the MGS (or write conf) as to after reformatting
the OST1, it cannot mount to the MGS, so if the subsequent
tests do not reformat the system, then will get failure.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I808d7d6c3fa2e57e8b644bd4af7350be006605c3
Reviewed-on: http://review.whamcloud.com/20987
Tested-by: Jenkins
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/conf-sanity.sh

index dcfd372..b639d44 100755 (executable)
@@ -5839,6 +5839,15 @@ test_85() {
 }
 run_test 85 "osd_ost init: fail ea_fid_set"
 
+cleanup_86() {
+       trap 0
+
+       # ost1 has already registered to the MGS before the reformat.
+       # So after reformatting it with option "-G", it could not be
+       # mounted to the MGS. Cleanup the system for subsequent tests.
+       reformat_and_config
+}
+
 test_86() {
        [ "$(facet_fstype ost1)" = "zfs" ] &&
                skip "LU-6442: no such mkfs params for ZFS OSTs" && return
@@ -5862,6 +5871,9 @@ test_86() {
 
        echo "params: $opts"
 
+       trap cleanup_86 EXIT ERR
+
+       stopall
        add ost1 $opts || error "add ost1 failed with new params"
 
        local FOUNDSIZE=$(do_facet ost1 "$DEBUGFS -c -R stats $(ostdevname 1)" |
@@ -5869,7 +5881,8 @@ test_86() {
 
        [[ $FOUNDSIZE == $NEWSIZE ]] ||
                error "Flex block group size: $FOUNDSIZE, expected: $NEWSIZE"
-       return 0
+
+       cleanup_86
 }
 run_test 86 "Replacing mkfs.lustre -G option"