[Libguestfs] [PATCH 1/4] tests: add Mageia checks in test-harder

Pino Toscano ptoscano at redhat.com
Mon Oct 31 14:36:27 UTC 2016


Previously it was implicitly caught by the 'redhat' case (since
/etc/redhat-release exists on mageia), and since the switch to
/etc/os-release the 'mageia' distro was considered unhandled.

Copy most of what the 'redhat' case does, with the tar -> rpm change (as
tar on mageia has currently no epoch, while rpm does).
---
 tests/test-harder.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/tests/test-harder.sh b/tests/test-harder.sh
index 7e1b8df..cfa448a 100755
--- a/tests/test-harder.sh
+++ b/tests/test-harder.sh
@@ -36,6 +36,8 @@ elif [ -f /etc/arch-release ]; then
     distro=arch
 elif [ -f /etc/debian_version ]; then
     distro=debian
+elif [ -f /etc/mageia-release ]; then  # before the redhat checks
+    distro=mageia
 elif [ -f /etc/redhat-release ]; then
     distro=redhat
 elif [ -f /etc/SuSE-release ]; then
@@ -59,6 +61,11 @@ case $distro in
     debian)
 	pkgs="augeas-tools libaugeas0 libhivex0 libhivex-bin"
 	;;
+    mageia)
+	# Choose rpm because it has an epoch > 0 and is commonly
+	# installed.  (See commit fb40baade8e3441b73ce6fd10a32fbbfe49cc4da)
+	pkgs="augeas hivex rpm"
+	;;
     redhat)
         # Choose tar because it has an epoch > 0 and is commonly
         # installed.  (See commit fb40baade8e3441b73ce6fd10a32fbbfe49cc4da)
@@ -119,6 +126,33 @@ case $distro in
 	    exit 1
 	fi
 	;;
+    mageia)
+	if [ ! -x $d2/usr/bin/augtool ]; then
+	    echo "$0: $distro: augtool binary not installed in chroot"
+	    ls -lR $d2
+	    exit 1
+	fi
+	if [ "$(find $d2/usr/lib* -name libaugeas.so.0 | wc -l)" -lt 1 ]; then
+	    echo "$0: $distro: augeas library not installed in chroot"
+	    ls -lR $d2
+	    exit 1
+	fi
+	if [ ! -x $d2/usr/bin/hivexget ]; then
+	    echo "$0: $distro: hivexget binary not installed in chroot"
+	    ls -lR $d2
+	    exit 1
+	fi
+	if [ "$(find $d2/usr/lib* -name libhivex.so.0 | wc -l)" -lt 1 ]; then
+	    echo "$0: $distro: hivex library not installed in chroot"
+	    ls -lR $d2
+	    exit 1
+	fi
+	if [ ! -x $d2/bin/rpm ]; then
+	    echo "$0: $distro: rpm binary not installed in chroot"
+	    ls -lR $d2
+	    exit 1
+	fi
+	;;
     redhat)
 	if [ ! -x $d2/usr/bin/augtool ]; then
 	    echo "$0: $distro: augtool binary not installed in chroot"
-- 
2.7.4




More information about the Libguestfs mailing list