From 3616783836ff23eec9ee43ecc6a770fc1803f67a Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 29 Apr 2025 18:13:51 -0400 Subject: [PATCH] mv overwrite error format changes in el10 This is somewhat cumbersome, we want to see the error message, but the format changes enough to make this messy. We opt to change the golden to the new format, which only shows one of the arguments in its error output: the thing that cannot be overwritten. We then add a filter that rewrites the old output format with sed patterns to be exactly like the new format, so this will work everywhere again, without changing or adding filters to obscure error messages. Signed-off-by: Auke Kok --- tests/golden/basic-posix-consistency | 2 +- tests/tests/basic-posix-consistency.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/golden/basic-posix-consistency b/tests/golden/basic-posix-consistency index e96251bc..7fd126a1 100644 --- a/tests/golden/basic-posix-consistency +++ b/tests/golden/basic-posix-consistency @@ -47,7 +47,7 @@ four --- dir within dir --- overwrite file --- can't overwrite non-empty dir -mv: cannot move '/mnt/test/test/basic-posix-consistency/dir/c/clobber' to '/mnt/test/test/basic-posix-consistency/dir/a/dir': Directory not empty +mv: cannot overwrite '/mnt/test/test/basic-posix-consistency/dir/a/dir': Directory not empty --- can overwrite empty dir --- can rename into root == path resoluion diff --git a/tests/tests/basic-posix-consistency.sh b/tests/tests/basic-posix-consistency.sh index 6abe4e46..bb9d9e66 100644 --- a/tests/tests/basic-posix-consistency.sh +++ b/tests/tests/basic-posix-consistency.sh @@ -138,7 +138,9 @@ echo "--- can't overwrite non-empty dir" mkdir "$T_D0/dir/a/dir" touch "$T_D0/dir/a/dir/nope" mkdir "$T_D1/dir/c/clobber" -mv -T "$T_D1/dir/c/clobber" "$T_D1/dir/a/dir" 2>&1 | t_filter_fs +mv -T "$T_D1/dir/c/clobber" "$T_D1/dir/a/dir" 2>&1 | \ + sed "s@mv: cannot move '.*' to '\(.*\)': Directory not empty@mv: cannot overwrite '\1': Directory not empty@g" | \ + t_filter_fs find "$T_D0/dir" -ls 2>&1 | t_filter_fs > "$T_TMP.0" find "$T_D1/dir" -ls 2>&1 | t_filter_fs > "$T_TMP.1" diff -u "$T_TMP.0" "$T_TMP.1"