|
|
e63663 |
From fc6318841f008dadc1e7c93e539f10d24aa83e90 Mon Sep 17 00:00:00 2001
|
|
|
e63663 |
From: Bernhard Voelker <mail@bernhard-voelker.de>
|
|
|
e63663 |
Date: Wed, 21 Apr 2021 00:12:00 +0200
|
|
|
e63663 |
Subject: [PATCH 1/2] tests: fix FP in ls/stat-free-color.sh
|
|
|
e63663 |
|
|
|
e63663 |
On newer systems like Fedora 34 and openSUSE Tumbleweed, ls(1) calls
|
|
|
e63663 |
newfstatat(STDOUT_FILENO, ...), but only when there is something to
|
|
|
e63663 |
output.
|
|
|
e63663 |
|
|
|
e63663 |
* tests/ls/stat-free-color.sh: Add -a option to the reference invocation
|
|
|
e63663 |
of ls, thus enforcing something gets output.
|
|
|
e63663 |
|
|
|
e63663 |
Upstream-commit: b7091093bb6505c33279f9bc940b2e94763a6e5d
|
|
|
e63663 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
e63663 |
---
|
|
|
e63663 |
tests/ls/stat-free-color.sh | 10 ++++++----
|
|
|
e63663 |
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
|
e63663 |
|
|
|
e63663 |
diff --git a/tests/ls/stat-free-color.sh b/tests/ls/stat-free-color.sh
|
|
|
e63663 |
index 00942f7..87bed1c 100755
|
|
|
e63663 |
--- a/tests/ls/stat-free-color.sh
|
|
|
e63663 |
+++ b/tests/ls/stat-free-color.sh
|
|
|
e63663 |
@@ -56,12 +56,14 @@ eval $(dircolors -b color-without-stat)
|
|
|
e63663 |
# The system may perform additional stat-like calls before main.
|
|
|
e63663 |
# Furthermore, underlying library functions may also implicitly
|
|
|
e63663 |
# add an extra stat call, e.g. opendir since glibc-2.21-360-g46f894d.
|
|
|
e63663 |
-# To avoid counting those, first get a baseline count for running
|
|
|
e63663 |
-# ls with one empty directory argument. Then, compare that with the
|
|
|
e63663 |
-# invocation under test.
|
|
|
e63663 |
+# Finally, ls(1) makes a stat call for stdout, but only in the case
|
|
|
e63663 |
+# when there is something to output.
|
|
|
e63663 |
+# To get the comparison right, first get a baseline count for running
|
|
|
e63663 |
+# 'ls -a' with one empty directory argument. Then, compare that with
|
|
|
e63663 |
+# the invocation under test.
|
|
|
e63663 |
mkdir d || framework_failure_
|
|
|
e63663 |
|
|
|
e63663 |
-strace -q -o log1 -e $stats ls --color=always d || fail=1
|
|
|
e63663 |
+strace -q -o log1 -e $stats ls -a --color=always d || fail=1
|
|
|
e63663 |
n_stat1=$(grep -vF '+++' log1 | wc -l) || framework_failure_
|
|
|
e63663 |
|
|
|
e63663 |
test $n_stat1 = 0 \
|
|
|
e63663 |
--
|
|
|
e63663 |
2.31.1
|
|
|
e63663 |
|
|
|
e63663 |
|
|
|
e63663 |
From c16ca58f17a088e925c0d1c4015c48332c380a00 Mon Sep 17 00:00:00 2001
|
|
|
e63663 |
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
|
|
|
e63663 |
Date: Sun, 9 May 2021 23:41:00 +0100
|
|
|
e63663 |
Subject: [PATCH 2/2] tests: fix tests/cp/sparse-2.sh false failure on some
|
|
|
e63663 |
systems
|
|
|
e63663 |
|
|
|
e63663 |
* tests/cp/sparse-2.sh: Double check cp --sparse=always,
|
|
|
e63663 |
with dd conv=sparse, in the case where the former didn't
|
|
|
e63663 |
create a sparse file. Now that this test is being newly run
|
|
|
e63663 |
on macos, we're seeing a failure due to seek() not creating
|
|
|
e63663 |
holes on apfs unless the size is >= 16MiB.
|
|
|
e63663 |
|
|
|
e63663 |
Upstream-commit: 6b499720fecae935dc00e236d6aefe94d9010482
|
|
|
e63663 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
e63663 |
---
|
|
|
e63663 |
tests/cp/fiemap-2.sh | 13 ++++++++++---
|
|
|
e63663 |
1 file changed, 10 insertions(+), 3 deletions(-)
|
|
|
e63663 |
|
|
|
e63663 |
diff --git a/tests/cp/fiemap-2.sh b/tests/cp/fiemap-2.sh
|
|
|
e63663 |
index 548a376..e20ce54 100755
|
|
|
e63663 |
--- a/tests/cp/fiemap-2.sh
|
|
|
e63663 |
+++ b/tests/cp/fiemap-2.sh
|
|
|
e63663 |
@@ -17,7 +17,7 @@
|
|
|
e63663 |
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
e63663 |
|
|
|
e63663 |
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
|
|
|
e63663 |
-print_ver_ cp
|
|
|
e63663 |
+print_ver_ cp stat dd
|
|
|
e63663 |
|
|
|
e63663 |
# Require a fiemap-enabled FS.
|
|
|
e63663 |
touch fiemap_chk # check a file rather than current dir for best coverage
|
|
|
e63663 |
@@ -46,10 +46,17 @@ dd bs=1k seek=1 of=k count=255 < /dev/zero || framework_failure_
|
|
|
e63663 |
|
|
|
e63663 |
# cp should detect the all-zero blocks and convert some of them to holes.
|
|
|
e63663 |
# How many it detects/converts currently depends on io_blksize.
|
|
|
e63663 |
-# Currently, on my F14/ext4 desktop, this K starts off with size 256KiB,
|
|
|
e63663 |
+# Currently, on my F14/ext4 desktop, this K file starts off with size 256KiB,
|
|
|
e63663 |
# (note that the K in the preceding test starts off with size 4KiB).
|
|
|
e63663 |
# cp from coreutils-8.9 with --sparse=always reduces the size to 32KiB.
|
|
|
e63663 |
cp --sparse=always k k2 || fail=1
|
|
|
e63663 |
-test $(stat -c %b k2) -lt $(stat -c %b k) || fail=1
|
|
|
e63663 |
+if test $(stat -c %b k2) -ge $(stat -c %b k); then
|
|
|
e63663 |
+ # If not sparse, then double check by creating with dd
|
|
|
e63663 |
+ # as we're not guaranteed that seek will create a hole.
|
|
|
e63663 |
+ # apfs on darwin 19.2.0 for example was seen to not to create holes < 16MiB.
|
|
|
e63663 |
+ hole_size=$(stat -c %o k2) || framework_failure_
|
|
|
e63663 |
+ dd if=k of=k2.dd bs=$hole_size conv=sparse || framework_failure_
|
|
|
e63663 |
+ test $(stat -c %b k2) -eq $(stat -c %b k2.dd) || fail=1
|
|
|
e63663 |
+fi
|
|
|
e63663 |
|
|
|
e63663 |
Exit $fail
|
|
|
e63663 |
--
|
|
|
e63663 |
2.31.1
|
|
|
e63663 |
|