nbdkit/0011-tests-cache-Simplify-test-cache-on-read.sh.patch

41 lines
1.2 KiB
Diff
Raw Normal View History

From a09b06f2c104c01d7b0ff5e657c0c64bf1c4cc41 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 29 Jul 2021 20:14:24 +0100
Subject: [PATCH] tests: cache: Simplify test-cache-on-read.sh
We can use the memory plugin instead of a backing file.
(cherry picked from commit 5527b28e323b7c9c35af8e1bb6b05e6468e68950)
---
tests/test-cache-on-read.sh | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/tests/test-cache-on-read.sh b/tests/test-cache-on-read.sh
index 3b3c7657..f8584dcd 100755
--- a/tests/test-cache-on-read.sh
+++ b/tests/test-cache-on-read.sh
@@ -38,18 +38,14 @@ requires_filter cache
requires_nbdsh_uri
sock=$(mktemp -u /tmp/nbdkit-test-sock.XXXXXX)
-files="cache-on-read.img $sock cache-on-read.pid"
+files="$sock cache-on-read.pid"
rm -f $files
cleanup_fn rm -f $files
-# Create an empty base image.
-truncate -s 128K cache-on-read.img
-
# Run nbdkit with the caching filter and cache-on-read set.
start_nbdkit -P cache-on-read.pid -U $sock \
--filter=cache \
- file cache-on-read.img \
- cache-on-read=true
+ memory 128K cache-on-read=true
nbdsh --connect "nbd+unix://?socket=$sock" \
-c '
--
2.31.1