On 5/20/20 11:09 PM, Filipe Manana wrote:
On Tue, May 19, 2020 at 9:10 AM Chengguang Xu <cgxu519@xxxxxxxxxxxx> wrote:
This test checks data integrity when remounting from
rw to ro mode.
Signed-off-by: Chengguang Xu <cgxu519@xxxxxxxxxxxx>
---
v1->v2:
- Add to shutdown greoup.
- Change case number to 597
tests/generic/597 | 54 +++++++++++++++++++++++++++++++++++++++++++
tests/generic/597.out | 2 ++
tests/generic/group | 1 +
3 files changed, 57 insertions(+)
create mode 100755 tests/generic/597
create mode 100644 tests/generic/597.out
diff --git a/tests/generic/597 b/tests/generic/597
new file mode 100755
index 00000000..d96e750b
--- /dev/null
+++ b/tests/generic/597
@@ -0,0 +1,54 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Chengguang Xu <cgxu519@xxxxxxxxxxxx>.
+# All Rights Reserved.
+#
+# FS QA Test 597
+#
+# Test data integrity for ro remount.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_fssum
+_require_scratch
+_require_scratch_shutdown
Couldn't the test be using dm's flakey instead of shutdown?
As shutdown is not implemented by all filesystems (btrfs for example),
it would allow more coverage.
Thanks for the suggestion, I tried with dmflakey but unfortunately it
could not work on overlayfs, a possible solution is that move current
test case to overlay specific directory and create new test case with
dmflakey for generic purpose.
Test results with dmflakey on xfs, btrfs and overlayfs.
[root@hades xfstests-dev]# ./check generic/597
FSTYP -- xfs (non-debug)
PLATFORM -- Linux/x86_64 hades 5.6.0-rc3+ #31 SMP Fri May 22
11:27:07 CST 2020
MKFS_OPTIONS -- -f -bsize=4096 /dev/nvme0n1p8
MOUNT_OPTIONS -- /dev/nvme0n1p8 /mnt/scratch
generic/597 1s ... 0s
Ran: generic/597
Passed all 1 tests
[root@hades xfstests-dev]# ./check generic/597
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 hades 5.6.0-rc3+ #31 SMP Fri May 22
11:27:07 CST 2020
MKFS_OPTIONS -- /dev/nvme0n1p8
MOUNT_OPTIONS -- /dev/nvme0n1p8 /mnt/scratch
generic/597 0s ... 0s
Ran: generic/597
Passed all 1 tests
[root@hades xfstests-dev]# ./check -overlay generic/597
FSTYP -- overlay
PLATFORM -- Linux/x86_64 hades 5.6.0-rc3+ #31 SMP Fri May 22
11:27:07 CST 2020
MKFS_OPTIONS -- /mnt/scratch
MOUNT_OPTIONS -- /mnt/scratch /mnt/scratch/ovl-mnt
generic/597 0s ... [not run] require /mnt/scratch to be valid block disk
Ran: generic/597
Not run: generic/597
Passed all 1 tests
Thanks,
cgxu