From: Chengguang Xu Date: Tue, 19 May 2020 08:09:29 +0000 (+0800) Subject: fstests: test data integrity for rdonly remount X-Git-Tag: v2022.05.01~780 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=155efc41eab3846ebf5138fe3020ff12b3fae444;p=xfstests-dev.git fstests: test data integrity for rdonly remount This test checks data integrity when remounting from rw to ro mode. Signed-off-by: Chengguang Xu Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/generic/599 b/tests/generic/599 new file mode 100755 index 00000000..cea641f0 --- /dev/null +++ b/tests/generic/599 @@ -0,0 +1,54 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chengguang Xu . +# All Rights Reserved. +# +# FS QA Test 599 +# +# 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 + +_scratch_mkfs &>/dev/null +_scratch_mount + +localdir=$SCRATCH_MNT/dir +mkdir $localdir +sync + +# fssum used for comparing checksum of test file(data & metedata), +# exclude checking about atime, block structure, open error. +$FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir +_scratch_remount ro +_scratch_shutdown +_scratch_cycle_mount +$FSSUM_PROG -r $tmp.fssum $localdir + +exit diff --git a/tests/generic/599.out b/tests/generic/599.out new file mode 100644 index 00000000..3b9e4aea --- /dev/null +++ b/tests/generic/599.out @@ -0,0 +1,2 @@ +QA output created by 599 +OK diff --git a/tests/generic/group b/tests/generic/group index 221b6ed7..134a2ce0 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -601,3 +601,4 @@ 596 auto quick 597 auto quick perms 598 auto quick perms +599 auto quick remount shutdown