Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
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