[Libguestfs] [supermin 2/2] tests: Add "--use-installed" variants

Hilko Bengen bengen at hilluzination.de
Sat Mar 15 12:59:03 UTC 2014


---
 tests/Makefile.am                    | 11 +++++++----
 tests/test-binaries-exist-network.sh |  2 ++
 tests/test-binaries-exist.sh         |  4 +++-
 tests/test-build-bash-network.sh     |  3 +++
 tests/test-build-bash.sh             |  4 +++-
 tests/test-harder-network.sh         |  3 +++
 tests/test-harder.sh                 |  4 +++-
 7 files changed, 24 insertions(+), 7 deletions(-)
 create mode 100755 tests/test-binaries-exist-network.sh
 create mode 100755 tests/test-build-bash-network.sh
 create mode 100755 tests/test-harder-network.sh

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9603e89..03c97b3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -22,11 +22,14 @@ EXTRA_DIST = \
 	$(TESTS)
 
 TESTS = \
-	test-basic.sh
-
-if NETWORK_TESTS
-TESTS += \
+	test-basic.sh \
 	test-build-bash.sh \
 	test-binaries-exist.sh \
 	test-harder.sh
+
+if NETWORK_TESTS
+TESTS += \
+	test-build-bash-network.sh \
+	test-binaries-exist-network.sh \
+	test-harder-network.sh
 endif
diff --git a/tests/test-binaries-exist-network.sh b/tests/test-binaries-exist-network.sh
new file mode 100755
index 0000000..19c3830
--- /dev/null
+++ b/tests/test-binaries-exist-network.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+USE_NETWORK=1 ./test-binaries-exist.sh
diff --git a/tests/test-binaries-exist.sh b/tests/test-binaries-exist.sh
index e9d2192..797c808 100755
--- a/tests/test-binaries-exist.sh
+++ b/tests/test-binaries-exist.sh
@@ -22,8 +22,10 @@ d1=test-binaries-exist.d1
 d2=test-binaries-exist.d2
 rm -rf $d1 $d2
 
+test "$USE_NETWORK" = 1 || USE_INSTALLED=--use-installed
+
 # We assume that 'bash' and 'coreutils' package names exist in every distro.
-../src/supermin -v --prepare bash coreutils -o $d1
+../src/supermin -v --prepare $USE_INSTALLED bash coreutils -o $d1
 
 # Build a chroot.
 ../src/supermin -v --build -f chroot $d1 -o $d2
diff --git a/tests/test-build-bash-network.sh b/tests/test-build-bash-network.sh
new file mode 100755
index 0000000..a80da4d
--- /dev/null
+++ b/tests/test-build-bash-network.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+USE_NETWORK=1 ./test-build-bash.sh
diff --git a/tests/test-build-bash.sh b/tests/test-build-bash.sh
index 6507683..0089666 100755
--- a/tests/test-build-bash.sh
+++ b/tests/test-build-bash.sh
@@ -27,8 +27,10 @@ d1=test-build-bash.d1
 d2=test-build-bash.d2
 rm -rf $d1 $d2
 
+test "$USE_NETWORK" = 1 || USE_INSTALLED=--use-installed
+
 # We assume 'bash' is a package everywhere.
-../src/supermin -v --prepare bash -o $d1
+../src/supermin -v --prepare $USE_INSTALLED bash -o $d1
 
 arch="$(uname -m)"
 
diff --git a/tests/test-harder-network.sh b/tests/test-harder-network.sh
new file mode 100755
index 0000000..56619fb
--- /dev/null
+++ b/tests/test-harder-network.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+USE_NETWORK=1 ./test-build-hardser.sh
diff --git a/tests/test-harder.sh b/tests/test-harder.sh
index 25dad90..5bd44b1 100755
--- a/tests/test-harder.sh
+++ b/tests/test-harder.sh
@@ -54,7 +54,9 @@ case $distro in
 	;;
 esac
 
-../src/supermin -v --prepare $pkgs -o $d1
+test "$USE_NETWORK" = 1 || USE_INSTALLED=--use-installed
+
+../src/supermin -v --prepare $USE_INSTALLED $pkgs -o $d1
 
 # Build a chroot.
 ../src/supermin -v --build -f chroot $d1 -o $d2
-- 
1.9.0




More information about the Libguestfs mailing list