diff --git a/tests/generic/999 b/tests/generic/999 new file mode 100755 index 00000000..781b37c5 --- /dev/null +++ b/tests/generic/999 @@ -0,0 +1,76 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2019 Kusanagi Kouichi. All Rights Reserved. +# +# FS QA Test 999 +# +# Test timestamp is persistent across umount. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +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 + +# Modify as appropriate. +_supported_fs generic +_supported_os Linux +_require_scratch + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount + +check_persist() +{ + ls "$SCRATCH_MNT" > /dev/null + before="$(stat -c '%x %y %z' "$SCRATCH_MNT")" + $XFS_IO_PROG -c "$1" "$SCRATCH_MNT" + _scratch_cycle_mount strictatime + after="$(stat -c '%x %y %z' "$SCRATCH_MNT")" + if test "$before" != "$after" + then + echo "timestamp didn't persist across umount." + echo "ls $1" + echo "before $before" + echo "after $after" + exit + fi +} + +check_persist '' +check_persist fsync +check_persist syncfs +check_persist sync + +"$FSSTRESS_PROG" -d "$SCRATCH_MNT" -v $(_scale_fsstress_args -n 1000 -p 2) > "$tmp".fsstress +find "$SCRATCH_MNT" ! -type d -exec stat -c '%x %y %z %i %F %n' '{}' + > "$tmp".before +_scratch_cycle_mount +find "$SCRATCH_MNT" ! -type d -exec stat -c '%x %y %z %i %F %n' '{}' + > "$tmp".after +if ! diff -u "$tmp".before "$tmp".after +then + echo "timestamp didn't persist across umount after fsstress." + cat "$tmp".fsstress + exit +fi + +# success, all done +status=0 +exit diff --git a/tests/generic/999.out b/tests/generic/999.out new file mode 100644 index 00000000..7fbc6768 --- /dev/null +++ b/tests/generic/999.out @@ -0,0 +1 @@ +QA output created by 999 diff --git a/tests/generic/group b/tests/generic/group index 6fe62505..7879eb70 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -595,3 +595,4 @@ 590 auto prealloc preallocrw 591 auto quick rw pipe splice 592 auto quick encrypt +999 auto quick