fstests: remove _wipe_fs from dump testing entirely
authorZorro Lang <zlang@redhat.com>
Wed, 20 Apr 2022 16:07:56 +0000 (00:07 +0800)
committerZorro Lang <zlang@kernel.org>
Tue, 26 Apr 2022 18:43:25 +0000 (02:43 +0800)
The _wipe_fs function in common/dump is a historical remnant of
xfstests, it's easy to cause confusion now. Now xfstests tend to
call `require_scratch && scratch_mkfs && scratch_mount` in each case
itself, we don't need to use a function to do that specially, so
remove _wipe_fs entirely.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
35 files changed:
common/dump
tests/xfs/022
tests/xfs/023
tests/xfs/024
tests/xfs/025
tests/xfs/026
tests/xfs/027
tests/xfs/028
tests/xfs/035
tests/xfs/036
tests/xfs/037
tests/xfs/038
tests/xfs/039
tests/xfs/043
tests/xfs/046
tests/xfs/047
tests/xfs/055
tests/xfs/056
tests/xfs/059
tests/xfs/060
tests/xfs/061
tests/xfs/063
tests/xfs/064
tests/xfs/065
tests/xfs/066
tests/xfs/068
tests/xfs/266
tests/xfs/267
tests/xfs/268
tests/xfs/281
tests/xfs/282
tests/xfs/283
tests/xfs/296
tests/xfs/301
tests/xfs/302

index ea16d442cb4f688ec7d2cf31c4564963161087ee..6de7dab48913bcf1c7680696a9133553d60484a7 100644 (file)
@@ -217,14 +217,6 @@ _require_tape()
     _set_variable
 }
 
-_wipe_fs()
-{
-    _require_scratch
-
-    _scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
-    _scratch_mount >>$seqres.full
-}
-
 #
 # Cleanup created dirs and files
 # Called by trap
@@ -289,7 +281,6 @@ _create_dumpdir_stress_num()
     echo "Creating directory system to dump using fsstress."
 
     _count=$1
-    _wipe_fs
 
     _param="-f link=10 -f creat=10 -f mkdir=10 -f truncate=5 -f symlink=10"
     rm -rf $dump_dir
@@ -567,7 +558,6 @@ End-of-File
 
 _create_dumpdir_largefile()
 {
-    _wipe_fs
     mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
     _largesize=4294967297
     _largefile=$dump_dir/largefile
@@ -579,7 +569,6 @@ _create_dumpdir_largefile()
 
 _create_dumpdir_fill()
 {
-    _wipe_fs
     _mk_fillconfig1
     _do_create_dumpdir_fill
     _stable_fs
@@ -587,7 +576,6 @@ _create_dumpdir_fill()
 
 _create_dumpdir_fill2()
 {
-    _wipe_fs
     _mk_fillconfig2
     _do_create_dumpdir_fill
     _stable_fs
@@ -595,7 +583,6 @@ _create_dumpdir_fill2()
 
 _create_dumpdir_fill_perm()
 {
-    _wipe_fs
     _mk_fillconfig_perm
     _do_create_dumpdir_fill
     _stable_fs
@@ -603,7 +590,6 @@ _create_dumpdir_fill_perm()
 
 _create_dumpdir_fill_ea()
 {
-    _wipe_fs
     _mk_fillconfig_ea
     _do_create_dumpdir_fill
     _stable_fs
@@ -615,7 +601,6 @@ _create_dumpdir_fill_ea()
 #
 _create_dumpdir_fill_multi()
 {
-    _wipe_fs
     _mk_fillconfig_multi
     _do_create_dumpdir_fill
     _stable_fs
@@ -720,7 +705,6 @@ End-of-File
 
 _create_dumpdir_symlinks()
 {
-    _wipe_fs
     _mk_symlink_config
     _do_create_dump_symlinks
     _stable_fs
@@ -771,7 +755,6 @@ _modify_level()
 _create_dumpdir_hardlinks()
 {
     _numsets=$1
-    _wipe_fs
     echo "Creating directory system of hardlinks to incrementally dump."
 
     mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
index 9334bc4116c550f7af6b09c927e081c9093c9ae5..2f011b284a5217dd539231d53d17665df69909fa 100755 (executable)
@@ -29,6 +29,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 # note: fsstress uses an endian dependent random number generator, running this
 # will produce different output for big/little endian machines.
index 1ff406a68978d0bd69eb565a210e502bb6eb858c..f6f6503a2df289089560ae14fca5f55059800909 100755 (executable)
@@ -28,6 +28,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_hard
 _do_dump_sub
index a277c83f894e9c3ffab4e0954a2b133c94c4a0a3..83a8882c421c092e99aaa96ab146f21b57b141fd 100755 (executable)
@@ -26,6 +26,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 # ensure file/dir timestamps precede dump timestamp
 sleep 2
index b7a5b3bb3e064d279ef48c9c044336639b24c679..bafe82d74d0b91cff60659d2f24e660c9d3b73aa 100755 (executable)
@@ -26,6 +26,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_hard
 _do_dump_min
index 29ebb5aab62187e66ef2f0b95c96a5b8ed307022..fba385dc904a5dd93091f433f2c7aa38d4954807 100755 (executable)
@@ -24,6 +24,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill
 _do_dump_file
index a0dcf8b34a050dddde16fbc7abcb4f939c42bf99..16cd203dae3129e2d881ff86dde40aa7f237ea3e 100755 (executable)
@@ -24,6 +24,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill
 _do_dump_restore
index b7c9d16bb69352c4b967611f2ff9e38f7005069f..1ff9d7d22540a3445acc58dc903c6915299ee3c9 100755 (executable)
@@ -24,10 +24,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
-
-# wipe test dir clean first
-# so dump can be real quick
-_wipe_fs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 #
 # Create 5 dumps
index 03cb7a762e175d0f34aa74cd8794180a932528de..f100bb1862bbb17945392511f43f68c8a3aea382 100755 (executable)
@@ -25,10 +25,17 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_hard
 _do_dump -L $seq.1
 _rewind
+_scratch_unmount
+
+_scratch_mkfs_xfs >>$seqres.full
+_scratch_mount
 _create_dumpdir_fill2
 _do_dump -L $seq.2
 _do_restore -L $seq.2
index 191345c5a5e3705192c0dcd5b92ffb35284650f9..73eb7cd5d8fc01b2f54314ae968cada0d067a0cd 100755 (executable)
@@ -25,6 +25,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $RMT_IRIXTAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_soft
 _do_dump_min -o -F
index b3fbbedd1b1c45a0e2f3a89ebb34f65e04655573..b19ba9e9e031aa4c9b51d6a3056367fc6343d677 100755 (executable)
@@ -24,6 +24,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $RMT_TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_soft
 _do_dump_min -o -F
index 633c51e0bb45493565518468902eb995aa253af6..397c354df88076a050a1b2405a0210add9d17e71 100755 (executable)
@@ -24,6 +24,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $RMT_TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_hard
 _do_dump
index e3a989213944f2efa8c801d8117f2accda5c852a..d54e9975b6b18b969d8692020f67550227fa145a 100755 (executable)
@@ -25,6 +25,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $RMT_IRIXTAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_soft
 _do_dump -o -F
index 5b198ddea2fd3b203fb867f642a7570329aa31ac..415ed16eddb3909a727449f54af61d836135fdaf 100755 (executable)
@@ -26,7 +26,10 @@ _cleanup()
 # real QA test starts here
 _supported_fs xfs
 
-_require_tape $TAPE_DEV 
+_require_tape $TAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 _erase_hard
 _do_dump_sub
index 94d1c051148b185076deb622e96bf17b764bae6a..48daff871cdb74751290e9439a1103c1fe9741f9 100755 (executable)
@@ -22,6 +22,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_symlinks
 _do_dump_file
index f83a2c9470bf5feff6b14c9bb941170a14506fcc..6d0dc5f75263a31f55bf49c7524dbfc17540111b 100755 (executable)
@@ -22,10 +22,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
-
-# wipe test dir clean first
-# so dump can be real quick
-_wipe_fs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 #
 # Create 5 dumps
index 1e3ba6acb5b7e2ba914a363553f11383299b5c29..c6ecae3d4548f09303f575205b0bef4cd8280e45 100755 (executable)
@@ -25,6 +25,10 @@ _cleanup()
 _supported_fs xfs
 
 _require_tape $RMT_TAPE_USER@$RMT_IRIXTAPE_DEV
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
+
 _create_dumpdir_fill
 _erase_soft
 _do_dump -o -F
index 4ee473f64b36a241a887976241becf96cbc7d30a..f742f419d83d1113cab587542f9a06e862441e15 100755 (executable)
@@ -25,6 +25,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill_perm
 _do_dump_file
index 4bbfb5f5c8f0b53445c9d965a9f4fa87bf0442e6..515ef2a4120a6cb7c4359ea8f731147dfa56090c 100755 (executable)
@@ -26,6 +26,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_multi_stream
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill_multi
 _do_dump_multi_file --multi 4
index 4b15c6c2ef0f9ddcc867a1ffe8256ca4bed25d7d..0c0dc981f76feedac5c2cf010a1803166b97cad6 100755 (executable)
@@ -26,6 +26,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_multi_stream
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill_multi
 _do_dump_multi_file --multi 4
index c5d4a2d110320781df44e416a8edcb8290a44d3d..0b20cc30e3be2b95a1f4f3aef3a8173a866c2f66 100755 (executable)
@@ -24,6 +24,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 # src/dumpfile based on dumping from
 # _create_dumpdir_fill_perm (small dump)
index 2d1d2cbc42bebbc5c7bb7a425d629e5da118b69a..660b300f7c6c44b89fcded5cbeaab798aa1bf65e 100755 (executable)
@@ -26,6 +26,9 @@ _cleanup()
 _supported_fs xfs
 
 _require_attrs trusted user
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 # create files with EAs
 _create_dumpdir_fill_ea
index e4e713cd67dd12fbf59a52ba260f83e2b96b4184..a81b226b0be18374629a3e684c19f61366ea418b 100755 (executable)
@@ -36,6 +36,9 @@ _ls_size_filter()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_hardlinks 9
 
index 0df7477f72160f2b0e779a1f98ec6c65ca16deac..8485dee6a1d8287e5c266469855ffe6e2d3d4513 100755 (executable)
@@ -70,7 +70,8 @@ _scratch_unmount
 # files and directories
 #
 
-_wipe_fs
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
 cd $dump_dir
 
index 5f0a74e349c4dfa7032704178e3ff2820846a5ab..2c369ad77f89aa83abcc003e7bd41d69293046b1 100755 (executable)
@@ -24,6 +24,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs xfs
 _require_test
+_require_scratch
 
 _my_stat_filter()
 {
@@ -37,6 +38,8 @@ else
        _notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
 fi
 
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_largefile
 echo "ls dumpdir/largefile"
 stat $dump_dir/largefile | _my_stat_filter
index 103466c3e6a298fb41e60b237a2291a88e9c5b9b..f80b53e5bd14b00dc57724d027f21adabf395403 100755 (executable)
@@ -28,6 +28,9 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_stress_num 4096
 
index 549fff3be3e436d5139ab325cfba58a4f19ca13e..eeca8822fc50e3026ff0f5bdb636277f425b8675 100755 (executable)
@@ -50,12 +50,15 @@ filter_cumulative_quota_updates() {
 
 # real QA test starts here
 _supported_fs xfs
+_require_scratch
 
 $XFSDUMP_PROG -h 2>&1 | grep -q -e -D
 if [ $? -ne 0 ]; then
     _notrun "requires xfsdump -D"
 fi
 
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 _create_dumpdir_fill
 # ensure file/dir timestamps precede dump timestamp
 sleep 2
index 62d39aba54f018481bd137b1e243026f1f6daad6..89b968be158cd4a8759a4283cb29f2afe9294489 100755 (executable)
@@ -34,7 +34,6 @@ _create_files()
 biggg          41943040        $nobody $nobody  777    attr1 some_text1  root
 End-of-File
 
-    _wipe_fs
     _do_create_dumpdir_fill
     _stable_fs
 }
@@ -48,6 +47,9 @@ _supported_fs xfs
 
 _require_tape $TAPE_DEV
 _require_attrs trusted
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_files
 _erase_hard
index b1dd312d953bbcffd15a4a420f1cedf7400a682d..8c991fba59d9cb5f8d879dcde3ef405beb35dfab 100755 (executable)
@@ -37,7 +37,6 @@ bigg1         12582912        $nobody $nobody  777    attr1 some_text1  root
 bigg2          12582912        $nobody $nobody  777    attr2 some_text2  user
 End-of-File
 
-    _wipe_fs
     _do_create_dumpdir_fill
     _stable_fs
 }
@@ -51,6 +50,9 @@ _supported_fs xfs
 
 _require_tape $TAPE_DEV
 _require_attrs trusted user
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_files
 _erase_hard
index ea1147612e94ccf12a6546c3a92a8af93bee0baf..6b148a9466f8275dc4f702ba86c0be71e8407c94 100755 (executable)
@@ -22,8 +22,10 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
-
 _require_legacy_v2_format
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill
 
index 07a4623afb6028292ce9d3c1d4abcd55ae24e23c..50303b084bb7c52c67e9450cf323e5e59f786bfb 100755 (executable)
@@ -24,8 +24,10 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
-
 _require_legacy_v2_format
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill
 # ensure file/dir timestamps precede dump timestamp
index 47fd4c3aadf69022986a60e89c86043f638bbd9c..59ea5f3bceec9a8dca950a3b2ef2404f6b2cba3c 100755 (executable)
@@ -24,8 +24,10 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs xfs
-
 _require_legacy_v2_format
+_require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 _create_dumpdir_fill
 # ensure file/dir timestamps precede dump timestamp
index 4eaf049be13a09a7cceda44feb7e8eb5faed7177..efd303e213e29dcc4b625b0268c386bc6ffd3845 100755 (executable)
@@ -28,8 +28,8 @@ _supported_fs xfs
 _require_scratch
 _require_command "$SETCAP_PROG" setcap
 _require_command "$GETCAP_PROG" getcap
-
-_wipe_fs
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 mkdir -p $dump_dir
 echo test > $dump_dir/testfile
index d44533d6811469a915ac75790606bd4d3a0c8beb..71ec1420342558307d11caa3ab052a363ddcb53f 100755 (executable)
@@ -27,6 +27,8 @@ _cleanup()
 # Modify as appropriate.
 _supported_fs xfs
 _require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 # Extended attributes
 attr_name=attrname
index 6587a6e60e3bd9bf096566738db86c1baebd0cd5..2e16890c750a2aba5c9bfcba091d4d5e3aa9f0a7 100755 (executable)
@@ -26,9 +26,10 @@ _cleanup()
 # Modify as appropriate.
 _supported_fs xfs
 _require_scratch
+_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
+_scratch_mount
 
 echo "Silence is golden."
-_wipe_fs
 mkdir $dump_dir >> $seqres.full 2>&1 || _fail "mkdir \"$dump_dir\" failed"
 for i in `seq 1 4`; do
        $XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile$i \