3
0
forked from pool/coreutils
coreutils/coreutils-tests-avoid-FP-cp-cpuinfo.patch
Bernhard Voelker 6f150a9022 Accepting request 213254 from home:bernhard-voelker
- Add upstream patch (coreutils-copy-fix-selinux-existing-dirs.patch):
  cp -a: set the correct SELinux context on already existing
  destination directories (rh#1045122).

- Merge I18n fixes from Fedora (coreutils-i18n.patch):
  * sort: fix sorting by non-first field (rh#1003544)
  * cut: avoid using slower multi-byte code in non-UTF-8 locales
    (rh#1021403, rh#499220).

- Testsuite: skip some tests:
  * coreutils-skip-some-sort-tests-on-ppc.patch: Add patch to
    skip 2 valgrind'ed sort tests on ppc/ppc64.
  * coreutils-skip-gnulib-test-tls.patch: Add patch to skip
    the gnulib test 'test-tls' on i586, x86_64, ppc and ppc64.
  * coreutils-tests-avoid-FP-cp-cpuinfo.patch: Add patch to skip a
    test when cp fails for /proc/cpuinfo which happens on aarch64.
  * coreutils-tests-shorten-extreme-factor-tests.patch: Add patch
    to skip most of the extreme-expensive factor tests.

OBS-URL: https://build.opensuse.org/request/show/213254
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=221
2014-01-09 02:21:45 +00:00

37 lines
1.4 KiB
Diff

From 84e67a5bd239179e2faded424861dce5718fa12c Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Tue, 7 Jan 2014 19:18:25 +0100
Subject: [PATCH] tests: avoid FP failure when cp fails for /proc/cpuinfo
On aarch64, cp fails to copy /proc/cpuinfo because the inode number
seems to change between the initial stat() call and copying the file:
$ cp /proc/cpuinfo exp
cp: skipping file '/proc/cpuinfo', as it was \
replaced while being copied
* tests/cp/proc-zero-len.sh: When cp fails, check on the above
error message to skip the test.
---
tests/cp/proc-zero-len.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: tests/cp/proc-zero-len.sh
===================================================================
--- tests/cp/proc-zero-len.sh.orig 2013-12-04 15:48:30.000000000 +0100
+++ tests/cp/proc-zero-len.sh 2014-01-09 01:28:38.447905329 +0100
@@ -27,7 +27,12 @@ test -r $f || f=empty
cat $f > out || fail=1
# With coreutils-6.9, this would create a zero-length "exp" file.
-cp $f exp || fail=1
+# Skip this test on architectures like aarch64 where the inode
+# number of the file changed during the cp run.
+cp $f exp 2>err \
+ || { fail=1;
+ grep 'replaced while being copied' \
+ && skip_ "File $f is being replaced while being copied"; }
# Don't simply compare contents; they might differ,
# e.g., if CPU freq changes between cat and cp invocations.