[Libguestfs] [supermin PATCH] tests: different dirs for formats in test-build-bash.sh

Pino Toscano ptoscano at redhat.com
Fri Apr 3 10:13:46 UTC 2020


Use different directories for the output formats, otherwise any supermin
--build call after the first will fail to rename the temporary directory
to the designated output directory (as it exists already).

Also make sure that we can remove all the files in the chroot output.
---
 tests/test-build-bash.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/test-build-bash.sh b/tests/test-build-bash.sh
index 44a8c89..0b75d8b 100755
--- a/tests/test-build-bash.sh
+++ b/tests/test-build-bash.sh
@@ -27,6 +27,7 @@ tmpdir=`mktemp -d`
 
 d1=$tmpdir/d1
 d2=$tmpdir/d2
+d3=$tmpdir/d3
 
 test "$USE_NETWORK" = 1 || USE_INSTALLED=--use-installed
 
@@ -37,6 +38,8 @@ arch="$(uname -m)"
 
 # Check all supermin-helper formats work.
 ../src/supermin -v --build -f chroot --host-cpu $arch $d1 -o $d2
-../src/supermin -v --build -f ext2 --host-cpu $arch $d1 -o $d2
+../src/supermin -v --build -f ext2 --host-cpu $arch $d1 -o $d3
 
+# Need to chmod $d2 since rm -r can't remove unwritable directories.
+chmod -R +w $d2 ||:
 rm -rf $tmpdir ||:
-- 
2.25.1




More information about the Libguestfs mailing list