From: Zorro Lang <zlang@kernel.org>
To: Joanne Chang <joannechien@google.com>
Cc: fstests@vger.kernel.org, djwong@kernel.org
Subject: Re: [PATCH v1] generic/63{4,5}: Modify criteria for passing test
Date: Thu, 18 Jun 2026 03:27:54 +0800 [thread overview]
Message-ID: <ajLxLnEepPuVq7-Z@zlang-mailbox> (raw)
In-Reply-To: <20260602071911.3652151-1-joannechien@google.com>
On Tue, Jun 02, 2026 at 07:19:11AM +0000, Joanne Chang wrote:
> The two tests pass when a timestamp is not preserved after the remount,
> because "cmp -s" does not print to the output file, and status is set to
> 0 regardless of the return value of cmp. So, use "diff" instead to
> correctly fail the test and flag the error case in the output file.
>
> Also, as the tests are focused on timestamps, don't print file contents
> so the tests can still pass if only the file contents differ.
>
> Signed-off-by: Joanne Chang <joannechien@google.com>
> ---
> tests/generic/634 | 4 ++--
> tests/generic/635 | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/generic/634 b/tests/generic/634
> index 8a4210a3..d7dd9dd8 100755
> --- a/tests/generic/634
> +++ b/tests/generic/634
> @@ -52,7 +52,7 @@ touchme() {
> report() {
> local files=($SCRATCH_MNT/t_*)
> for file in "${files[@]}"; do
> - echo "${file}: $(cat "${file}")"
> + echo "${file}:"
> TZ=UTC stat -c '%y %Y %n' "${file}"
> test $test_statx -gt 0 && \
> $XFS_IO_PROG -c 'statx -r' "${file}" | grep 'stat.mtime'
> @@ -98,7 +98,7 @@ report > $tmp.after_remount
> cat $tmp.after_remount >> $seqres.full
>
> # Did they match?
> -cmp -s $tmp.before_remount $tmp.after_remount
> +diff $tmp.before_remount $tmp.after_remount
Haha, looks like Darrick accidentally added the -s option :)
It seems like simply dropping the -s option would fix this issue, though
switching to diff works as well. If Darrick has no further review points,
I'll go ahead and merge this patch.
Reviewed-by: Zorro Lang <zlang@kernel.org>
>
> # success, all done
> echo Silence is golden.
> diff --git a/tests/generic/635 b/tests/generic/635
> index 018b868c..f74d0cd7 100755
> --- a/tests/generic/635
> +++ b/tests/generic/635
> @@ -55,7 +55,7 @@ touchme() {
> report() {
> local files=($SCRATCH_MNT/t_*)
> for file in "${files[@]}"; do
> - echo "${file}: $(cat "${file}")"
> + echo "${file}:"
> TZ=UTC stat -c '%y %Y %n' "${file}"
> test $test_statx -gt 0 && \
> $XFS_IO_PROG -c 'statx -r' "${file}" | grep 'stat.mtime'
> @@ -102,7 +102,7 @@ report > $tmp.after_crash
> cat $tmp.after_crash >> $seqres.full
>
> # Did they match?
> -cmp -s $tmp.before_crash $tmp.after_crash
> +diff $tmp.before_crash $tmp.after_crash
>
> # success, all done
> status=0
> --
> 2.54.0.929.g9b7fa37559-goog
>
prev parent reply other threads:[~2026-06-17 19:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 7:19 [PATCH v1] generic/63{4,5}: Modify criteria for passing test Joanne Chang
2026-06-17 19:27 ` Zorro Lang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ajLxLnEepPuVq7-Z@zlang-mailbox \
--to=zlang@kernel.org \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=joannechien@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox