From 8295c3fff62bdb350def1a73842c34cdd3d3f358 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 6 Mar 2020 09:29:29 +0000 Subject: [PATCH 01/13] New upstream version 1.18.1. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index 983b737..093fcbc 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.18-stable Name: nbdkit -Version: 1.18.0 +Version: 1.18.1 Release: 1%{?dist} Summary: NBD server @@ -932,6 +932,9 @@ make %{?_smp_mflags} check || { %changelog +* Fri Mar 06 2020 Richard W.M. Jones - 1.18.1-1 +- New upstream version 1.18.1. + * Thu Feb 27 2020 Richard W.M. Jones - 1.18.0-1 - New upstream stable branch version 1.18.0. diff --git a/sources b/sources index 4216e06..7e09716 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.18.0.tar.gz) = b81d34a8ee9e2d2d84714828caafd2f7728e4c312994cfa6dd1a662b043d0649ba343efd30e634c125f249e9d88fecf60ad56cfd99dd8ab7669cf4565f2c242f -SHA512 (nbdkit-1.18.0.tar.gz.sig) = a16b914c1ab0c7ef83a7da5b200f8e1c83cb45a783744f8a3b7dc69e9f8803075813d65d5c85ba108473b029ba9862b89c709ab5a45b9c22e992fa0e40bc37c1 +SHA512 (nbdkit-1.18.1.tar.gz) = 39d689dc93a9837cb5228fa19a93e58a0c64d5785af2d0e2f016eee1317da608840952858b4e8b4e1eccdb755cafb356a324b6ca0bbab4f3dfcf1ce5eca281d3 +SHA512 (nbdkit-1.18.1.tar.gz.sig) = 53990323bedd81a888cfafd988abe47f9c425305ac6de5aa5d4131308f016a68950b29fbd1cee9a6c6f99662737ca2a08e487521193c5372cdda47c167477d08 From 534944912b8728f2cab5c4228ec8a49cdabde64f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 17 Mar 2020 13:41:45 +0000 Subject: [PATCH 02/13] New upstream version 1.18.2. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index 093fcbc..1f0d585 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.18-stable Name: nbdkit -Version: 1.18.1 +Version: 1.18.2 Release: 1%{?dist} Summary: NBD server @@ -932,6 +932,9 @@ make %{?_smp_mflags} check || { %changelog +* Tue Mar 17 2020 Richard W.M. Jones - 1.18.2-1 +- New upstream version 1.18.2. + * Fri Mar 06 2020 Richard W.M. Jones - 1.18.1-1 - New upstream version 1.18.1. diff --git a/sources b/sources index 7e09716..eee4d2a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.18.1.tar.gz) = 39d689dc93a9837cb5228fa19a93e58a0c64d5785af2d0e2f016eee1317da608840952858b4e8b4e1eccdb755cafb356a324b6ca0bbab4f3dfcf1ce5eca281d3 -SHA512 (nbdkit-1.18.1.tar.gz.sig) = 53990323bedd81a888cfafd988abe47f9c425305ac6de5aa5d4131308f016a68950b29fbd1cee9a6c6f99662737ca2a08e487521193c5372cdda47c167477d08 +SHA512 (nbdkit-1.18.2.tar.gz) = 5934d4b825e546310732ecefd6f227688532cf703bd5d93dd3f0b422d95b07a3b55baef5bac4b306e65853299bfbbb121894b8fc95b3b4ab9e557dfce398d33c +SHA512 (nbdkit-1.18.2.tar.gz.sig) = c9aa43a9f58438d87013da2f159b6a5b81cff5aff2805c97ed892156d9bdb902ae4ae098503f46a9059c23d64151be4de98ed88da25514aa2436f5d828225a02 From aa6d763ce501e6f8e67a6ae70cc51c35c718d9f5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 28 Mar 2020 21:31:27 +0000 Subject: [PATCH 03/13] New upstream version 1.18.3. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index 1f0d585..ebb68d9 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.18-stable Name: nbdkit -Version: 1.18.2 +Version: 1.18.3 Release: 1%{?dist} Summary: NBD server @@ -932,6 +932,9 @@ make %{?_smp_mflags} check || { %changelog +* Sat Mar 28 2020 Richard W.M. Jones - 1.18.3-1 +- New upstream version 1.18.3. + * Tue Mar 17 2020 Richard W.M. Jones - 1.18.2-1 - New upstream version 1.18.2. diff --git a/sources b/sources index eee4d2a..9c15eb8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.18.2.tar.gz) = 5934d4b825e546310732ecefd6f227688532cf703bd5d93dd3f0b422d95b07a3b55baef5bac4b306e65853299bfbbb121894b8fc95b3b4ab9e557dfce398d33c -SHA512 (nbdkit-1.18.2.tar.gz.sig) = c9aa43a9f58438d87013da2f159b6a5b81cff5aff2805c97ed892156d9bdb902ae4ae098503f46a9059c23d64151be4de98ed88da25514aa2436f5d828225a02 +SHA512 (nbdkit-1.18.3.tar.gz) = de7b7c9e236dc9335bc05c6649825bb0e72161510dd73989e17fc98743c5b66dfcf59a089759cf5c92e5c7eb48b9379aff34d3b12d0cd7421c8bb63cb6b90910 +SHA512 (nbdkit-1.18.3.tar.gz.sig) = 5da9223a6ec3052c3d53e1117f26a88601d69898495c1b44cbfb25a8b0e1d59055caf1d52631fee2b3e8352c24ba1f2bd7ddcb7e179684b39ee2e36377a2226d From a781f281a7488e41f490b9bd4888aa46a547f1bd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 16 Apr 2020 13:22:51 +0100 Subject: [PATCH 04/13] New upstream version 1.18.4. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index ebb68d9..099cb7b 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.18-stable Name: nbdkit -Version: 1.18.3 +Version: 1.18.4 Release: 1%{?dist} Summary: NBD server @@ -932,6 +932,9 @@ make %{?_smp_mflags} check || { %changelog +* Thu Apr 16 2020 Richard W.M. Jones - 1.18.4-1 +- New upstream version 1.18.4. + * Sat Mar 28 2020 Richard W.M. Jones - 1.18.3-1 - New upstream version 1.18.3. diff --git a/sources b/sources index 9c15eb8..bdcabdd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.18.3.tar.gz) = de7b7c9e236dc9335bc05c6649825bb0e72161510dd73989e17fc98743c5b66dfcf59a089759cf5c92e5c7eb48b9379aff34d3b12d0cd7421c8bb63cb6b90910 -SHA512 (nbdkit-1.18.3.tar.gz.sig) = 5da9223a6ec3052c3d53e1117f26a88601d69898495c1b44cbfb25a8b0e1d59055caf1d52631fee2b3e8352c24ba1f2bd7ddcb7e179684b39ee2e36377a2226d +SHA512 (nbdkit-1.18.4.tar.gz) = 701de0f0f83b9960b8ec40f2e31c2d65d656bcc20941efa8fdf4b367840c859acfde2f60a6bcd96ad158de6466197fd1441dbf301ca27cbc7a27ef9d315752e5 +SHA512 (nbdkit-1.18.4.tar.gz.sig) = a46af4006155270b981d90c3fe2a974f1514cb158d29c89447331ac3a6abf58544b1c064e592ed8e0f6dbc1cb3899efe336dc8f740bdf428dc54a799878471d3 From 50b7c3304976daf7efe9ca5bebcada89c1d4ae43 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 4 May 2020 19:08:30 +0100 Subject: [PATCH 05/13] New upstream version 1.18.5. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index 099cb7b..334814f 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.18-stable Name: nbdkit -Version: 1.18.4 +Version: 1.18.5 Release: 1%{?dist} Summary: NBD server @@ -932,6 +932,9 @@ make %{?_smp_mflags} check || { %changelog +* Mon May 4 2020 Richard W.M. Jones - 1.18.5-1 +- New upstream version 1.18.5. + * Thu Apr 16 2020 Richard W.M. Jones - 1.18.4-1 - New upstream version 1.18.4. diff --git a/sources b/sources index bdcabdd..70a847b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.18.4.tar.gz) = 701de0f0f83b9960b8ec40f2e31c2d65d656bcc20941efa8fdf4b367840c859acfde2f60a6bcd96ad158de6466197fd1441dbf301ca27cbc7a27ef9d315752e5 -SHA512 (nbdkit-1.18.4.tar.gz.sig) = a46af4006155270b981d90c3fe2a974f1514cb158d29c89447331ac3a6abf58544b1c064e592ed8e0f6dbc1cb3899efe336dc8f740bdf428dc54a799878471d3 +SHA512 (nbdkit-1.18.5.tar.gz) = 3099db070d1418ba9f6ab96b296c10e7bff99e72c2ab1cec1ee7978257b1f1a147289a002a20b217fbf58be4b4df667b7bada52090f7b9f3fefe06c9c927c667 +SHA512 (nbdkit-1.18.5.tar.gz.sig) = 529205fc4b1fe7290a54f7269676b15797c39f1683eee5ef7cbc23936c73a82e4d7de0898c3fac74d0c6e64d278b4f4877f8ff55e8f552f6cfaa88fcda76ec7e From c9f10573208157a825872c0bf2d70e10f5c17538 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 19 May 2020 21:50:40 +0100 Subject: [PATCH 06/13] New upstream version 1.20.2. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index babdc3a..ccfe535 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.20-stable Name: nbdkit -Version: 1.20.1 +Version: 1.20.2 Release: 1%{?dist} Summary: NBD server @@ -972,6 +972,9 @@ make %{?_smp_mflags} check || { %changelog +* Tue May 19 2020 Richard W.M. Jones - 1.20.2-1 +- New upstream version 1.20.2. + * Mon May 4 2020 Richard W.M. Jones - 1.20.1-2 - New upstream version 1.20.1. diff --git a/sources b/sources index 09ada51..2aad156 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.20.1.tar.gz) = d3c1d8bb3c739899303ee20c7375fb2b7126569bf071e4185536aaf776915c69434fbcda09964c9b38b43315a33e11ebd02ac68c7dacfbca676f7431c4d6ca2d -SHA512 (nbdkit-1.20.1.tar.gz.sig) = 9bc993c42b48669ef554a74ca85f36d357432eba8df43d62aa2cee980d6c51c0e69c392aa246c009c0d14d5b89d8fa0b3b0242030363b7e9d94ccb48aae5d47e +SHA512 (nbdkit-1.20.2.tar.gz) = 4a03c6e8007d60a98feb829a228188d6a0712343c2131e815a5cc0bf1650dfbfa262d7dcba7ecb20163fee98d3dfd9d8384c8023f831b0b890d4bc267952ea59 +SHA512 (nbdkit-1.20.2.tar.gz.sig) = cd2f4bd14f17ce83e165285470e75ab475cf55abd51ac803b18df28c62b14347974c8da6485789458eac48e9e5ab587573dace95b01df1fef88439d4cce583fb From 8224035505b63924332142b66ff231e9435c5fcd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 20 May 2020 16:06:27 +0100 Subject: [PATCH 07/13] Add upstream patch to make tests/test-truncate4.sh more stable on s390x. (cherry picked from commit 1da65fc037b049cb56c1343eea38510ff068f844) --- ...st-truncate4.sh-Rewrite-to-use-nbdsh.patch | 167 ++++++++++++++++++ nbdkit.spec | 8 +- 2 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch diff --git a/0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch b/0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch new file mode 100644 index 0000000..cd6bf8f --- /dev/null +++ b/0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch @@ -0,0 +1,167 @@ +From 0632acc76bfeb7d70d3eefa42fc842ce6b7be4f8 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 May 2020 13:27:27 +0100 +Subject: [PATCH] tests/test-truncate4.sh: Rewrite to use nbdsh. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The old test relied on issuing an asynchronous command to a qemu-io +subprocess, requiring a sleep to ensure that the command had been +carried out. ‘sleep 1’ was not long enough on s390x as you can see +from this partial trace: + + + exec + + qemu-io -f raw nbd:unix:/tmp/tmp.jqOZGj6dnX + + exec + + echo 'Reading from connection A, try 1' + Reading from connection A, try 1 + + echo 'r -P 1 0 1024' + + sleep 1 + +Above we issue the command and sleep while it executes. However: + + nbdkit: debug: accepted connection + nbdkit: file[1]: debug: truncate: preconnect + nbdkit: file[1]: debug: file: preconnect + nbdkit: file[1]: debug: newstyle negotiation: flags: global 0x3 + + echo 'Resizing down' + Resizing down + + truncate -s 512 truncate4.data + nbdkit: file[1]: debug: newstyle negotiation: client flags: 0x3 + nbdkit: file[1]: debug: newstyle negotiation: NBD_OPT_STRUCTURED_REPLY: client requested structured replies + +Here are still connecting to nbdkit from "connection A", long after +the sleep has finished and the truncate has been done. + +Instead of increasing the sleep and hoping for the best, I chose to +rewrite the test to use nbdsh. This allows us to control both +connections from a single process, making the test predicatable and +easier to understand. +--- + tests/test-truncate4.sh | 85 +++++++++++++++++++++++++---------------- + 1 file changed, 53 insertions(+), 32 deletions(-) + +diff --git a/tests/test-truncate4.sh b/tests/test-truncate4.sh +index e4be626b..36b2743c 100755 +--- a/tests/test-truncate4.sh ++++ b/tests/test-truncate4.sh +@@ -1,6 +1,6 @@ + #!/usr/bin/env bash + # nbdkit +-# Copyright (C) 2019 Red Hat Inc. ++# Copyright (C) 2019-2020 Red Hat Inc. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are +@@ -31,55 +31,76 @@ + # SUCH DAMAGE. + + # Regression test when next_ops->get_size changes between connections. ++# + # For now, NBD does not support dynamic resize; but the file plugin + # reads size from the file system for each new connection, at which + # point the client remembers that size for the life of the connection. ++# + # We are testing that connection A can still see the tail of a file, + # even when connection B is opened while the file was temporarily +-# shorter (if the actions of connection B affect the size visible +-# through connection A, we didn't isolate per-connection state). ++# shorter. If the actions of connection B affect the size visible ++# through connection A, we didn't isolate per-connection state. + + source ./functions.sh + set -e + set -x + +-requires qemu-io --version ++requires nbdsh --version + + sock=`mktemp -u` +-files="truncate4.out truncate4.pid $sock truncate4.data" ++data=truncate4.data ++files="truncate4.pid $sock $data" + rm -f $files + cleanup_fn rm -f $files + +-# Initial file contents: 1k of pattern 1 +-truncate -s 1024 truncate4.data +-qemu-io -c 'w -P 1 0 1024' -f raw truncate4.data ++# Create and truncate the file. ++: > $data + + # Run nbdkit with file plugin and truncate filter in front. + start_nbdkit -P truncate4.pid -U $sock \ + --filter=truncate \ +- file truncate4.data \ ++ file $data \ + round-up=1024 + +-fail=0 +-exec 4>&1 # Save original stdout +-{ +- exec 5>&1 >&4 # Save connection A, set stdout back to original +- echo 'Reading from connection A, try 1' +- echo 'r -P 1 0 1024' >&5 +- sleep 1 +- echo 'Resizing down' +- truncate -s 512 truncate4.data +- echo 'Reading from connection B' +- echo 'r -P 1 0 512' | qemu-io -f raw nbd:unix:$sock >> truncate4.out +- echo 'Restoring size' +- truncate -s 1024 truncate4.data +- qemu-io -c 'w -P 2 0 1024' -f raw truncate4.data +- echo 'Reading from connection A, try 2' +- echo 'r -P 2 512 512' >&5 +- echo 'quit' >&5 +-} | qemu-io -f raw nbd:unix:$sock >> truncate4.out || fail=1 +-exec 4>&- +- +-cat truncate4.out +-grep 'Pattern verification failed' truncate4.out && fail=1 +-exit $fail ++export data sock ++nbdsh -c ' ++import os ++ ++data = os.environ["data"] ++sock = os.environ["sock"] ++ ++def restore_file(): ++ # Original test data, 1024 bytes of "TEST" repeated. ++ with open (data, "w") as file: ++ file.write ("TEST"*256) ++ ++restore_file () ++ ++print ("Connection A.", flush=True) ++connA = nbd.NBD () ++connA.set_handle_name ("A") ++connA.connect_unix (sock) ++print ("Check the size.", flush=True) ++assert connA.get_size () == 1024 ++ ++print ("Truncate %s to 512 bytes." % data, flush=True) ++os.truncate (data, 512) ++ ++print ("Connection B.", flush=True) ++connB = nbd.NBD () ++connB.set_handle_name ("B") ++connB.connect_unix (sock) ++print ("Check the size.", flush=True) ++assert connB.get_size () == 1024 # because of the round-up parameter ++print ("Read data from connection B.", flush=True) ++buf = connB.pread (1024, 0) ++assert buf == b"TEST"*128 + b"\0"*512 ++ ++print ("Restore the file size and original data.", flush=True) ++restore_file () ++ ++print ("Read data from connection A.", flush=True) ++buf = connA.pread (1024, 0) ++assert 1024 == len (buf) ++assert buf == b"TEST"*256 ++' +-- +2.25.0 + diff --git a/nbdkit.spec b/nbdkit.spec index ccfe535..23eb8eb 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -38,7 +38,7 @@ ExclusiveArch: x86_64 Name: nbdkit Version: 1.20.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: NBD server License: BSD @@ -51,6 +51,9 @@ Source1: http://libguestfs.org/download/nbdkit/%{source_directory}/%{name Source2: libguestfs.keyring %endif +# Upstream patch to make tests/test-truncate4.sh more stable on s390x. +Patch1: 0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch + %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool %endif @@ -972,6 +975,9 @@ make %{?_smp_mflags} check || { %changelog +* Wed May 20 2020 Richard W.M. Jones - 1.21.4-2 +- Add upstream patch to make tests/test-truncate4.sh more stable on s390x. + * Tue May 19 2020 Richard W.M. Jones - 1.20.2-1 - New upstream version 1.20.2. From 726fd0a7c7c64b86aaa26b2b557218a4232f3ff7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Jun 2020 14:20:26 +0100 Subject: [PATCH 08/13] New upstream version 1.20.3. --- ...st-truncate4.sh-Rewrite-to-use-nbdsh.patch | 167 ------------------ nbdkit.spec | 12 +- sources | 4 +- 3 files changed, 8 insertions(+), 175 deletions(-) delete mode 100644 0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch diff --git a/0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch b/0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch deleted file mode 100644 index cd6bf8f..0000000 --- a/0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 0632acc76bfeb7d70d3eefa42fc842ce6b7be4f8 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 20 May 2020 13:27:27 +0100 -Subject: [PATCH] tests/test-truncate4.sh: Rewrite to use nbdsh. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The old test relied on issuing an asynchronous command to a qemu-io -subprocess, requiring a sleep to ensure that the command had been -carried out. ‘sleep 1’ was not long enough on s390x as you can see -from this partial trace: - - + exec - + qemu-io -f raw nbd:unix:/tmp/tmp.jqOZGj6dnX - + exec - + echo 'Reading from connection A, try 1' - Reading from connection A, try 1 - + echo 'r -P 1 0 1024' - + sleep 1 - -Above we issue the command and sleep while it executes. However: - - nbdkit: debug: accepted connection - nbdkit: file[1]: debug: truncate: preconnect - nbdkit: file[1]: debug: file: preconnect - nbdkit: file[1]: debug: newstyle negotiation: flags: global 0x3 - + echo 'Resizing down' - Resizing down - + truncate -s 512 truncate4.data - nbdkit: file[1]: debug: newstyle negotiation: client flags: 0x3 - nbdkit: file[1]: debug: newstyle negotiation: NBD_OPT_STRUCTURED_REPLY: client requested structured replies - -Here are still connecting to nbdkit from "connection A", long after -the sleep has finished and the truncate has been done. - -Instead of increasing the sleep and hoping for the best, I chose to -rewrite the test to use nbdsh. This allows us to control both -connections from a single process, making the test predicatable and -easier to understand. ---- - tests/test-truncate4.sh | 85 +++++++++++++++++++++++++---------------- - 1 file changed, 53 insertions(+), 32 deletions(-) - -diff --git a/tests/test-truncate4.sh b/tests/test-truncate4.sh -index e4be626b..36b2743c 100755 ---- a/tests/test-truncate4.sh -+++ b/tests/test-truncate4.sh -@@ -1,6 +1,6 @@ - #!/usr/bin/env bash - # nbdkit --# Copyright (C) 2019 Red Hat Inc. -+# Copyright (C) 2019-2020 Red Hat Inc. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are -@@ -31,55 +31,76 @@ - # SUCH DAMAGE. - - # Regression test when next_ops->get_size changes between connections. -+# - # For now, NBD does not support dynamic resize; but the file plugin - # reads size from the file system for each new connection, at which - # point the client remembers that size for the life of the connection. -+# - # We are testing that connection A can still see the tail of a file, - # even when connection B is opened while the file was temporarily --# shorter (if the actions of connection B affect the size visible --# through connection A, we didn't isolate per-connection state). -+# shorter. If the actions of connection B affect the size visible -+# through connection A, we didn't isolate per-connection state. - - source ./functions.sh - set -e - set -x - --requires qemu-io --version -+requires nbdsh --version - - sock=`mktemp -u` --files="truncate4.out truncate4.pid $sock truncate4.data" -+data=truncate4.data -+files="truncate4.pid $sock $data" - rm -f $files - cleanup_fn rm -f $files - --# Initial file contents: 1k of pattern 1 --truncate -s 1024 truncate4.data --qemu-io -c 'w -P 1 0 1024' -f raw truncate4.data -+# Create and truncate the file. -+: > $data - - # Run nbdkit with file plugin and truncate filter in front. - start_nbdkit -P truncate4.pid -U $sock \ - --filter=truncate \ -- file truncate4.data \ -+ file $data \ - round-up=1024 - --fail=0 --exec 4>&1 # Save original stdout --{ -- exec 5>&1 >&4 # Save connection A, set stdout back to original -- echo 'Reading from connection A, try 1' -- echo 'r -P 1 0 1024' >&5 -- sleep 1 -- echo 'Resizing down' -- truncate -s 512 truncate4.data -- echo 'Reading from connection B' -- echo 'r -P 1 0 512' | qemu-io -f raw nbd:unix:$sock >> truncate4.out -- echo 'Restoring size' -- truncate -s 1024 truncate4.data -- qemu-io -c 'w -P 2 0 1024' -f raw truncate4.data -- echo 'Reading from connection A, try 2' -- echo 'r -P 2 512 512' >&5 -- echo 'quit' >&5 --} | qemu-io -f raw nbd:unix:$sock >> truncate4.out || fail=1 --exec 4>&- -- --cat truncate4.out --grep 'Pattern verification failed' truncate4.out && fail=1 --exit $fail -+export data sock -+nbdsh -c ' -+import os -+ -+data = os.environ["data"] -+sock = os.environ["sock"] -+ -+def restore_file(): -+ # Original test data, 1024 bytes of "TEST" repeated. -+ with open (data, "w") as file: -+ file.write ("TEST"*256) -+ -+restore_file () -+ -+print ("Connection A.", flush=True) -+connA = nbd.NBD () -+connA.set_handle_name ("A") -+connA.connect_unix (sock) -+print ("Check the size.", flush=True) -+assert connA.get_size () == 1024 -+ -+print ("Truncate %s to 512 bytes." % data, flush=True) -+os.truncate (data, 512) -+ -+print ("Connection B.", flush=True) -+connB = nbd.NBD () -+connB.set_handle_name ("B") -+connB.connect_unix (sock) -+print ("Check the size.", flush=True) -+assert connB.get_size () == 1024 # because of the round-up parameter -+print ("Read data from connection B.", flush=True) -+buf = connB.pread (1024, 0) -+assert buf == b"TEST"*128 + b"\0"*512 -+ -+print ("Restore the file size and original data.", flush=True) -+restore_file () -+ -+print ("Read data from connection A.", flush=True) -+buf = connA.pread (1024, 0) -+assert 1024 == len (buf) -+assert buf == b"TEST"*256 -+' --- -2.25.0 - diff --git a/nbdkit.spec b/nbdkit.spec index 23eb8eb..338b439 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,8 +37,8 @@ ExclusiveArch: x86_64 %global source_directory 1.20-stable Name: nbdkit -Version: 1.20.2 -Release: 2%{?dist} +Version: 1.20.3 +Release: 1%{?dist} Summary: NBD server License: BSD @@ -51,9 +51,6 @@ Source1: http://libguestfs.org/download/nbdkit/%{source_directory}/%{name Source2: libguestfs.keyring %endif -# Upstream patch to make tests/test-truncate4.sh more stable on s390x. -Patch1: 0001-tests-test-truncate4.sh-Rewrite-to-use-nbdsh.patch - %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool %endif @@ -975,7 +972,10 @@ make %{?_smp_mflags} check || { %changelog -* Wed May 20 2020 Richard W.M. Jones - 1.21.4-2 +* Tue Jun 9 2020 Richard W.M. Jones - 1.20.3-1 +- New upstream version 1.20.3. + +* Wed May 20 2020 Richard W.M. Jones - 1.20.2-2 - Add upstream patch to make tests/test-truncate4.sh more stable on s390x. * Tue May 19 2020 Richard W.M. Jones - 1.20.2-1 diff --git a/sources b/sources index 2aad156..d1719bd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.20.2.tar.gz) = 4a03c6e8007d60a98feb829a228188d6a0712343c2131e815a5cc0bf1650dfbfa262d7dcba7ecb20163fee98d3dfd9d8384c8023f831b0b890d4bc267952ea59 -SHA512 (nbdkit-1.20.2.tar.gz.sig) = cd2f4bd14f17ce83e165285470e75ab475cf55abd51ac803b18df28c62b14347974c8da6485789458eac48e9e5ab587573dace95b01df1fef88439d4cce583fb +SHA512 (nbdkit-1.20.3.tar.gz) = 362e5ca9caccbf820ab55dfc80c49bf754ec6a02427198c75f76dfdd2198e3aaaf2b077b39deb22a15b3d1a6bb77647551c3a640dba503bdfe80b394da6aa5c0 +SHA512 (nbdkit-1.20.3.tar.gz.sig) = a2d9294f2ff647c7ae437e42594146902f38717cf9d6e654629521966c6b464829a7fb37b6e37f91db1320a8c926880f95f92edc8266b62733c6dbb5c4c6fa4e From 7dc23d75fafd44763da28a908d374689ceb6cd13 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 19 Jun 2020 16:17:27 +0100 Subject: [PATCH 09/13] New upstream version 1.20.4. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index 338b439..6a132ea 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.20-stable Name: nbdkit -Version: 1.20.3 +Version: 1.20.4 Release: 1%{?dist} Summary: NBD server @@ -972,6 +972,9 @@ make %{?_smp_mflags} check || { %changelog +* Fri Jun 19 2020 Richard W.M. Jones - 1.20.4-1 +- New upstream version 1.20.4. + * Tue Jun 9 2020 Richard W.M. Jones - 1.20.3-1 - New upstream version 1.20.3. diff --git a/sources b/sources index d1719bd..9ebe23c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.20.3.tar.gz) = 362e5ca9caccbf820ab55dfc80c49bf754ec6a02427198c75f76dfdd2198e3aaaf2b077b39deb22a15b3d1a6bb77647551c3a640dba503bdfe80b394da6aa5c0 -SHA512 (nbdkit-1.20.3.tar.gz.sig) = a2d9294f2ff647c7ae437e42594146902f38717cf9d6e654629521966c6b464829a7fb37b6e37f91db1320a8c926880f95f92edc8266b62733c6dbb5c4c6fa4e +SHA512 (nbdkit-1.20.4.tar.gz) = ff573c73dafc5c271cdb64f43c1139c71e9fd056a9555949b381ebeb3931e1c471c7b3d29409ffee1521ce186b6197fdca4735bf31b67fc58417e4948e5c80e0 +SHA512 (nbdkit-1.20.4.tar.gz.sig) = 269a0460895bf2f010df337d9fe10a8a174b5b10cdf7330d713c8466ee5e2abe86fdb8f2c4787b1774054851322987196825d83a112b855e884b9d56ca544b2a From cff35d9a8d5245d7d4581959c0d3bf1ed45a43e9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Jul 2020 09:15:04 +0100 Subject: [PATCH 10/13] New upstream version 1.20.5. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index 6a132ea..b08270e 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.20-stable Name: nbdkit -Version: 1.20.4 +Version: 1.20.5 Release: 1%{?dist} Summary: NBD server @@ -972,6 +972,9 @@ make %{?_smp_mflags} check || { %changelog +* Mon Jul 13 2020 Richard W.M. Jones - 1.20.5-1 +- New upstream version 1.20.5. + * Fri Jun 19 2020 Richard W.M. Jones - 1.20.4-1 - New upstream version 1.20.4. diff --git a/sources b/sources index 9ebe23c..d47e065 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.20.4.tar.gz) = ff573c73dafc5c271cdb64f43c1139c71e9fd056a9555949b381ebeb3931e1c471c7b3d29409ffee1521ce186b6197fdca4735bf31b67fc58417e4948e5c80e0 -SHA512 (nbdkit-1.20.4.tar.gz.sig) = 269a0460895bf2f010df337d9fe10a8a174b5b10cdf7330d713c8466ee5e2abe86fdb8f2c4787b1774054851322987196825d83a112b855e884b9d56ca544b2a +SHA512 (nbdkit-1.20.5.tar.gz) = 5b343ffe1cc0f74460a01e69942a343abdcd842642f4105b234bc18938104d63ff17039ad4e5c34ef77d6e09ca7c4bae68c5897135f4980b4a5708f280bfeb04 +SHA512 (nbdkit-1.20.5.tar.gz.sig) = cd4985fe55181e6e294f4e11ec067d182e42e5fa206159bbc5fd06c2e91d75eabf1bc3411ee10159fe4e88002f069a080064b384b313aaa6de1ea371cdb290fc From 2baf65dafde16e296e56ff6da1602933ec9905ce Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 10 Aug 2020 17:48:33 +0100 Subject: [PATCH 11/13] New upstream version 1.20.6. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index b08270e..de2bb65 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.20-stable Name: nbdkit -Version: 1.20.5 +Version: 1.20.6 Release: 1%{?dist} Summary: NBD server @@ -972,6 +972,9 @@ make %{?_smp_mflags} check || { %changelog +* Mon Aug 10 2020 Richard W.M. Jones - 1.20.6-1 +- New upstream version 1.20.6. + * Mon Jul 13 2020 Richard W.M. Jones - 1.20.5-1 - New upstream version 1.20.5. diff --git a/sources b/sources index d47e065..ac976e5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.20.5.tar.gz) = 5b343ffe1cc0f74460a01e69942a343abdcd842642f4105b234bc18938104d63ff17039ad4e5c34ef77d6e09ca7c4bae68c5897135f4980b4a5708f280bfeb04 -SHA512 (nbdkit-1.20.5.tar.gz.sig) = cd4985fe55181e6e294f4e11ec067d182e42e5fa206159bbc5fd06c2e91d75eabf1bc3411ee10159fe4e88002f069a080064b384b313aaa6de1ea371cdb290fc +SHA512 (nbdkit-1.20.6.tar.gz) = 118ff134cc11e2af45234c8ef5bf5220e1bd57c1a1c4b58970d8555260111c54a9328529bd805b3f9a2be68cc0410a2fe33fe538716f41b2d82894b7cfc86c33 +SHA512 (nbdkit-1.20.6.tar.gz.sig) = dab3dcdcc72bb9db952f1cef03e02215fea4e851335421b5a9c555bdc31738ff17bdc60ba7549b7bbca1c021fde23c0952c7c02807f65fff05cc345686bfc3ea From 583a55b0a79980ce5c78b2ed666b20a60d749145 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 10 Aug 2020 18:14:16 +0100 Subject: [PATCH 12/13] Disable libguestfs tests on aarch64. At the moment on Fedora 32, kernel cannot boot on qemu. --- nbdkit.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbdkit.spec b/nbdkit.spec index de2bb65..c59f5f9 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -2,7 +2,7 @@ # Broken on {power64} because of # https://bugzilla.redhat.com/show_bug.cgi?id=1778520 -%ifarch aarch64 %{arm} x86_64 ppc +%ifarch %{arm} x86_64 ppc %global have_libguestfs 1 %endif From 366b1848332d87c271f8321afe2a9a9701ff189e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 3 Sep 2020 21:21:55 +0100 Subject: [PATCH 13/13] New upstream version 1.20.7. --- nbdkit.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nbdkit.spec b/nbdkit.spec index c59f5f9..13cffe8 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -37,7 +37,7 @@ ExclusiveArch: x86_64 %global source_directory 1.20-stable Name: nbdkit -Version: 1.20.6 +Version: 1.20.7 Release: 1%{?dist} Summary: NBD server @@ -972,6 +972,9 @@ make %{?_smp_mflags} check || { %changelog +* Thu Sep 03 2020 Richard W.M. Jones - 1.20.7-1 +- New upstream version 1.20.7. + * Mon Aug 10 2020 Richard W.M. Jones - 1.20.6-1 - New upstream version 1.20.6. diff --git a/sources b/sources index ac976e5..95d32be 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.20.6.tar.gz) = 118ff134cc11e2af45234c8ef5bf5220e1bd57c1a1c4b58970d8555260111c54a9328529bd805b3f9a2be68cc0410a2fe33fe538716f41b2d82894b7cfc86c33 -SHA512 (nbdkit-1.20.6.tar.gz.sig) = dab3dcdcc72bb9db952f1cef03e02215fea4e851335421b5a9c555bdc31738ff17bdc60ba7549b7bbca1c021fde23c0952c7c02807f65fff05cc345686bfc3ea +SHA512 (nbdkit-1.20.7.tar.gz) = 0f6449a83fa6c8ec3fbf50376686e6189a61ee4066f1d819a6a0a9c6f99cfadee6689647e40152090689596edfe0bec4307c6260fda4477999957ce47c03f93c +SHA512 (nbdkit-1.20.7.tar.gz.sig) = c73234ea154a461eeca78addfe6c0655d7ff3115c57163b192d32eed4c25698075a3c375833a7700247715aef4a8d0fd78f464b08a482f8ddf293b880516b687