tests: Use a more robust method to create the test disk atomically.

This commit is contained in:
Richard W.M. Jones 2019-03-12 22:14:58 +00:00
parent 53b3645e71
commit 43f581b434
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 183d81fa792fd024f62d068ead9cad0cc53d3c8e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 12 Mar 2019 22:13:24 +0000
Subject: [PATCH] tests: Use a more robust method to create the test disk
atomically.
---
tests/Makefile.am | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1712565..f50a35e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -334,9 +334,10 @@ check_DATA += disk
CLEANFILES += disk
disk:
- rm -f $@ test1.img
- guestfish -N fs:ext4:100M -m /dev/sda1 write /hello.txt "hello,world"
- mv test1.img disk
+ rm -f $@ $@-t
+ guestfish -N $@-t=fs:ext4:100M -m /dev/sda1 \
+ write /hello.txt "hello,world"
+ mv $@-t $@
endif HAVE_GUESTFISH
--
2.20.1

View File

@ -20,7 +20,8 @@
%global verify_tarball_signature 1 %global verify_tarball_signature 1
# If there are patches which touch autotools files, set this to 1. # If there are patches which touch autotools files, set this to 1.
%global patches_touch_autotools %{nil} #%global patches_touch_autotools %{nil}
%global patches_touch_autotools 1
# The source directory. # The source directory.
%global source_directory 1.11-development %global source_directory 1.11-development
@ -40,6 +41,9 @@ Source1: http://libguestfs.org/download/nbdkit/%{source_directory}/%{name
Source2: libguestfs.keyring Source2: libguestfs.keyring
%endif %endif
# Upstream patch for tests.
Patch1: 0001-tests-Use-a-more-robust-method-to-create-the-test-di.patch
%if 0%{patches_touch_autotools} %if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool BuildRequires: autoconf, automake, libtool
%endif %endif