[Pkg-libvirt-commits] [libguestfs] 15/179: log: tests: skip fedora.img if journal is not available

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 31 19:07:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit c92734b209e4504e84a051e433c81d4d5449d660
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Mon Oct 6 18:05:53 2014 +0200

    log: tests: skip fedora.img if journal is not available
---
 cat/test-virt-log.sh | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/cat/test-virt-log.sh b/cat/test-virt-log.sh
index af6bb95..d4fa0ed 100755
--- a/cat/test-virt-log.sh
+++ b/cat/test-virt-log.sh
@@ -19,7 +19,32 @@
 export LANG=C
 set -e
 
+can_handle ()
+{
+    fn=$(basename $1)
+    case "$fn" in
+    fedora.img)
+        guestfish -a /dev/null run : available journal
+        ;;
+    *)
+        return 0
+        ;;
+    esac
+}
+
 # Read out the log files from the image using virt-log.
 for f in ../tests/guests/{fedora,debian,ubuntu}.img; do
-    if [ -s "$f" ]; then $VG virt-log -a "$f"; fi
+    echo "Trying $f ..."
+    if [ ! -s "$f" ]; then
+        echo "SKIP: empty file"
+        echo
+        continue
+    fi
+    if ! can_handle "$f"; then
+        echo "SKIP: cannot handle $f"
+        echo
+        continue
+    fi
+    $VG virt-log -a "$f"
+    echo
 done

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list