coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: avoid failure when cp fails for /proc/cpuinfo


From: Pádraig Brady
Subject: Re: [PATCH] tests: avoid failure when cp fails for /proc/cpuinfo
Date: Mon, 24 Apr 2023 11:46:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0

On 24/04/2023 09:15, Andreas Schwab wrote:
When run under QEmu emulation emulated /proc files have unstable inode
numbers.
---
  tests/cp/proc-short-read.sh | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/cp/proc-short-read.sh b/tests/cp/proc-short-read.sh
index 0f7c9e697..806fe285b 100755
--- a/tests/cp/proc-short-read.sh
+++ b/tests/cp/proc-short-read.sh
@@ -24,7 +24,13 @@ proc_large=/proc/cpuinfo  # usually > 4KiB
  test -r $proc_large || skip_ "your system lacks $proc_large"
# Before coreutils-7.3, cp would copy less than 4KiB of this file.
-cp $proc_large 1    || fail=1
+# Skip this test when run under QEmu emulation where emulated /proc files
+# have unstable inode numbers.
+cp $proc_large 1 2>err \
+  || { fail=1
+       grep 'replaced while being copied' err \
+         && skip_ "File $proc_large is being replaced while being copied"; }
+
  cat $proc_large > 2 || fail=1
# adjust varying parts

Ah that should have been part of:
https://github.com/coreutils/coreutils/commit/d13421197

Pushed.

thanks!
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]