FSTests Archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: Anthony Iliopoulos <ailiop@suse.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH v2 2/2] generic/682: update and fix-up golden output
Date: Wed, 7 Feb 2024 17:19:59 +0800	[thread overview]
Message-ID: <20240207091959.w2hckaplrjqfr3j6@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com> (raw)
In-Reply-To: <20240206173625.18623-3-ailiop@suse.com>

On Tue, Feb 06, 2024 at 06:36:25PM +0100, Anthony Iliopoulos wrote:
> coreutils v9.4 introduced a change in the error output of mv under
> certain errno values via commit 3cb862ce5f10 ("mv: better diagnostic for
> 'mv dir x' failure"), which broke the golden output.
> 
> Update golden output to match the change, and further add an output
> filter to avoid having the test fail on environments that ran with an
> older coreutils release, taken from commit d9323ad7a05e ("generic/245:
> Filter mv error message").
> 
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
> ---
> v2: consolidate g/245 and g/682 mv filter into common/filter

Thanks, this version looks good to me, I'll merge it. But if you're
not hurry, it won't be in the release of this week (will be in next
release), due to the release of this week is a republish of old
v2024.02.04 which was abandoned, I hope to do as few updates as
possible on it, for safe :)

Reviewed-by: Zorro Lang <zlang@redhat.com>

Thanks,
Zorro

> 
>  common/filter         | 14 ++++++++++++++
>  tests/generic/245     | 14 +-------------
>  tests/generic/682     |  2 +-
>  tests/generic/682.out |  2 +-
>  4 files changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/common/filter b/common/filter
> index 36d51bd957dd..e7473c9568e9 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -481,6 +481,20 @@ _filter_mv()
>  	sed -e "s/^renamed //"
>  }
>  
> +# According to the rename(2) manpage you can get either EEXIST or
> +# ENOTEMPTY as an error for trying to rename a non-empty directory, so
> +# just catch the error for ENOTMEMPTY and replace it with the EEXIST
> +# output so that either result passes.
> +#
> +# Also, coreutils v9.4 modified the error message when a nonempty
> +# destination directory fails to be overwritten, filter the output
> +# accordingly.
> +_filter_mv_output()
> +{
> +	sed -e "s,Directory not empty,File exists,g" \
> +	    -e "s,cannot move .* to \(.*\):\(.*\),cannot overwrite \1:\2,g"
> +}
> +
>  # New stat(1) uses statx(2)
>  _filter_stat()
>  {
> diff --git a/tests/generic/245 b/tests/generic/245
> index 81ce4d4e2450..8b8e3e219255 100755
> --- a/tests/generic/245
> +++ b/tests/generic/245
> @@ -26,18 +26,6 @@ _cleanup()
>  	rm -rf $dir
>  }
>  
> -# According to the rename(2) manpage you can get either EEXIST or ENOTEMPTY as an
> -# error for trying to rename a non-empty directory, so just catch the error for
> -# ENOTMEMPTY and replace it with the EEXIST output so that either result passes
> -# Also, mv v9.4+ modified error message when a nonempty destination directory fails
> -# to be overwriteen
> -_filter_directory_not_empty()
> -{
> -	sed -e "s,Directory not empty,File exists,g" \
> -	    -e "s,cannot move .* to \(.*\):\(.*\),cannot overwrite \1:\2,g"
> -}
> - 
> -
>  mkdir $dir
>  
>  mkdir $dir/aa
> @@ -46,7 +34,7 @@ touch $dir/aa/1
>  mkdir $dir/ab/aa
>  touch $dir/ab/aa/2
>  
> -mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty
> +mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_mv_output
>  
>  status=0
>  exit $status
> diff --git a/tests/generic/682 b/tests/generic/682
> index a51d18338742..b70a4d02e429 100755
> --- a/tests/generic/682
> +++ b/tests/generic/682
> @@ -62,7 +62,7 @@ for ((i = 0; i < dirents; i++)); do
>  	name=$(printf "y%0254d" $i)
>  	ln $scratchfile $stagedir/$name
>  	su - "$qa_user" -c "mv $stagedir/$name $scratchdir/$name" 2>&1 | \
> -		_filter_scratch | sed -e 's/y[0-9]*/yXXX/g'
> +		_filter_scratch | _filter_mv_output | sed -e 's/y[0-9]*/yXXX/g'
>  	test "${PIPESTATUS[0]}" -ne 0 && break
>  done
>  repquota -upn $SCRATCH_MNT >> $seqres.full
> diff --git a/tests/generic/682.out b/tests/generic/682.out
> index b74708117237..db22d5f60487 100644
> --- a/tests/generic/682.out
> +++ b/tests/generic/682.out
> @@ -1,3 +1,3 @@
>  QA output created by 682
> -mv: cannot move 'SCRATCH_MNT/staging/yXXX' to 'SCRATCH_MNT/dir/yXXX': Disk quota exceeded
> +mv: cannot overwrite 'SCRATCH_MNT/dir/yXXX': Disk quota exceeded
>  Silence is golden
> -- 
> 2.41.0
> 
> 


      reply	other threads:[~2024-02-07  9:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 17:36 [PATCH v2 0/2] generic/681 and generic/682 fixes Anthony Iliopoulos
2024-02-06 17:36 ` [PATCH v2 1/2] generic/68[12]: use the dir blocksize for xfs filesystems Anthony Iliopoulos
2024-02-06 17:36 ` [PATCH v2 2/2] generic/682: update and fix-up golden output Anthony Iliopoulos
2024-02-07  9:19   ` 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=20240207091959.w2hckaplrjqfr3j6@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com \
    --to=zlang@redhat.com \
    --cc=ailiop@suse.com \
    --cc=fstests@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).