Add patch to fix tests.

This commit is contained in:
Richard W.M. Jones 2021-03-02 22:24:23 +00:00
parent cef4a03029
commit c81b6ed16c
2 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,74 @@
From 8b20bbd329c07941f3e4aa00e14c05ed27b25435 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 2 Mar 2021 22:20:49 +0000
Subject: [PATCH] copy: Stable sort in tests.
When running the tests in Koji they behaved differently from running
locally (under a UTF-8 locale). This turned out to be a difference in
sorting under the different locales.
Thanks: Eric Blake
---
copy/copy-sparse-request-size.sh | 2 +-
copy/copy-sparse.sh | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/copy/copy-sparse-request-size.sh b/copy/copy-sparse-request-size.sh
index b539f5e..f2e2b61 100755
--- a/copy/copy-sparse-request-size.sh
+++ b/copy/copy-sparse-request-size.sh
@@ -50,7 +50,7 @@ $VG nbdcopy --no-extents -S 0 --request-size=1048576 -- \
trim=" echo \$@ >> $out " \
zero=" echo \$@ >> $out " ]
-sort -n -o $out $out
+LC_ALL=C sort -n -o $out $out
echo Output:
cat $out
diff --git a/copy/copy-sparse.sh b/copy/copy-sparse.sh
index c43b41a..5f12bad 100755
--- a/copy/copy-sparse.sh
+++ b/copy/copy-sparse.sh
@@ -50,7 +50,7 @@ $VG nbdcopy -S 0 -- \
# Order of the output could vary because requests are sent in
# parallel.
-sort -n -o $out $out
+LC_ALL=C sort -n -o $out $out
echo Output:
cat $out
@@ -65,8 +65,8 @@ zero 134184960 4160749568 may_trim
zero 134184960 939524096 may_trim
zero 134217728 1073741824 may_trim
zero 134217728 1207959552 may_trim
-zero 134217728 1342177280 may_trim
zero 134217728 134217728 may_trim
+zero 134217728 1342177280 may_trim
zero 134217728 1476395008 may_trim
zero 134217728 1610612736 may_trim
zero 134217728 1744830464 may_trim
@@ -76,8 +76,8 @@ zero 134217728 2147483648 may_trim
zero 134217728 2281701376 may_trim
zero 134217728 2415919104 may_trim
zero 134217728 2550136832 may_trim
-zero 134217728 2684354560 may_trim
zero 134217728 268435456 may_trim
+zero 134217728 2684354560 may_trim
zero 134217728 2818572288 may_trim
zero 134217728 2952790016 may_trim
zero 134217728 3087007744 may_trim
@@ -87,8 +87,8 @@ zero 134217728 3489660928 may_trim
zero 134217728 3623878656 may_trim
zero 134217728 3758096384 may_trim
zero 134217728 3892314112 may_trim
-zero 134217728 4026531840 may_trim
zero 134217728 402653184 may_trim
+zero 134217728 4026531840 may_trim
zero 134217728 536870912 may_trim
zero 134217728 671088640 may_trim
zero 134217728 805306368 may_trim" ]; then
--
2.29.0.rc2

View File

@ -25,6 +25,8 @@ Source2: libguestfs.keyring
# Maintainer script which helps with handling patches.
Source3: copy-patches.sh
Patch1: 0001-copy-Stable-sort-in-tests.patch
%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool
%endif