Whamcloud - gitweb
LU-6198 test: fix large-lun test_1, test_2 defects 01/13601/3
authorElena Gryaznova <elena.gryaznova@seagate.com>
Mon, 2 Feb 2015 23:46:35 +0000 (03:46 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 21 Jul 2015 16:20:36 +0000 (16:20 +0000)
setupall()->start ost called at the end of large-lun.sh
fails to start the ost devices which leads test_1() and
test_2() fail if run separately.

The reasons are:
1) osts data are destroyed by test_1()->llverdev
2) osts are reformatted by test_2, but mds config not changed
Patch fixes the following:
- format Lustre at the end of test_1() and test_2()
- add the "REFORMAT" option check to avoid killing
filesystems that do not want a reformat.

Signed-off-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Xyratex-bug-id: MRP-1984
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@seagate.com>
Change-Id: I7f1465d4777b7a5d5538e019226334dc090e3f50
Reviewed-on: http://review.whamcloud.com/13601
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/large-lun.sh

index bac2b01..2a60f90 100644 (file)
@@ -11,6 +11,12 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
+if ! [ "$REFORMAT" ]; then
+       skip_env "$0 reformats all devices,\
+               please set REFORMAT to run this test"
+       exit 0
+fi
+
 # Variable to run mdsrate
 THREADS_PER_CLIENT=${THREADS_PER_CLIENT:-5}    # thread(s) per client node
 MACHINEFILE=${MACHINEFILE:-$TMP/$TESTSUITE.machines}
@@ -152,6 +158,8 @@ test_1 () {
                do_rpc_nodes $(facet_host ost${num}) run_llverdev $dev -vpf ||
                        error "llverdev on $dev failed!"
        done
+       # restore format overwritten by llverdev
+       formatall
 }
 run_test 1 "run llverdev on raw LUN"
 
@@ -225,6 +233,9 @@ test_2 () {
                        $RUN_FSCK && check_fsfacet ost${num}
                fi
        done
+       # there is no reason to continue using ost devices
+       # filled by llverfs as ldiskfs
+       formatall
 }
 run_test 2 "run llverfs on OST ldiskfs/zfs filesystem"