libnbd/0001-copy-Stable-sort-in-tests.patch
DistroBaker bd814fcc34 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/libnbd.git#b5a71ab87ad8c2289fbd2364fae2fe7c2c3629b8
2021-03-19 14:45:29 +00:00

75 lines
2.4 KiB
Diff

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 1/6] 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