[go PATCH 1/3] Fix tests on Ubuntu 18.04 / Debian 9 with missing screenshot file

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

 



Some versions of the Debian packages were missing the install of the
test-screenshot.png file used by the test driver's screenshot impl.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 domain_test.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/domain_test.go b/domain_test.go
index dd46c4d..bf12603 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -660,6 +660,11 @@ func TestDomainScreenshot(t *testing.T) {
 	defer stream.Free()
 	mime, err := dom.Screenshot(stream, 0, 0)
 	if err != nil {
+		msg := "test-screenshot.png': No such file or directory"
+		if strings.Contains(err.Error(), msg) {
+			t.Skip("test-screenshot.png doesn't exist")
+			return
+		}
 		t.Fatalf("failed to take screenshot: %s", err)
 	}
 	if strings.Index(mime, "image/") != 0 {
-- 
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