[libvirt-java PATCH 2/6] Add workaround for broken screenshot API on Ubuntu 18.04 vintage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/test/java/org/libvirt/TestJavaBindings.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/libvirt/TestJavaBindings.java b/src/test/java/org/libvirt/TestJavaBindings.java
index 4b55a13..0a3bca0 100644
--- a/src/test/java/org/libvirt/TestJavaBindings.java
+++ b/src/test/java/org/libvirt/TestJavaBindings.java
@@ -325,7 +325,16 @@ public final class TestJavaBindings extends TestCase {
 
         assertFalse("Domain \"test\" not found", dom == null);
 
-        String mimetype = dom.screenshot(str, 0);
+        String mimetype;
+        try {
+            mimetype = dom.screenshot(str, 0);
+        } catch (LibvirtException ex) {
+            if (ex.getMessage().contains("test-screenshot.png': No such file or directory")) {
+                System.err.format("testDomainScreenshot skipped (missing png file)");
+                return;
+            }
+            throw ex;
+        }
 
         ByteBuffer bb = ByteBuffer.allocateDirect(8192);
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux