summaryrefslogtreecommitdiff
path: root/tests/cp
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2023-04-24 10:15:01 +0200
committerPádraig Brady <P@draigBrady.com>2023-04-24 11:37:09 +0100
commite29f4411c80b38a8d146de9ceb0d7e85831b72f3 (patch)
tree05f4e6a4b50a3ac019bd183752fc16dbab55c396 /tests/cp
parent6bab375973e62e9fcc0b41451d637134073e3007 (diff)
downloadcoreutils-e29f4411c80b38a8d146de9ceb0d7e85831b72f3.tar.gz
tests: avoid failure when cp fails for proc files
When run under QEmu emulation emulated /proc files have unstable inode numbers. * tests/cp/proc-short-read.sh: Skip if unstable inode numbers detected.
Diffstat (limited to 'tests/cp')
-rwxr-xr-xtests/cp/proc-short-read.sh8
1 files changed, 7 insertions, 1 deletions
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