]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: fix screenshot API impl
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 6 Dec 2016 12:45:18 +0000 (12:45 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 8 Dec 2016 10:57:32 +0000 (10:57 +0000)
When redoing the website we deleted the libvirtLogo.png file
not remembering that the test driver screenshot API impl
relied on it.

Rather than having the test driver use the logo as a side
effect, give it its own dedicated image to use. This is
installed in /usr/share/libvirt/test-screenshot.png and
is taken from a NeXT Cube running WorldWideWeb[1]. The
very first web browser in existance, running on the
hardware it was originally written on.

[1] https://en.wikipedia.org/wiki/WorldWideWeb

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
libvirt.spec.in
mingw-libvirt.spec.in
src/Makefile.am
src/test/test-screenshot.png [new file with mode: 0644]
src/test/test_driver.c

index 4f35313a20cc5b89ba563559424a46c2d64fcd62..4bb0699cba0be9d02f493e82705b7100ee1202df 100644 (file)
@@ -1842,6 +1842,8 @@ exit 0
 
 %{_datadir}/libvirt/cpu_map.xml
 
+%{_datadir}/libvirt/test-screenshot.png
+
 %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
 
 %files admin
index 65d3e6df96f317f03ea7b9507225defb0c8919ac..e088dc22a5252dbd8d7fa54b4036b0d568ca2e80 100644 (file)
@@ -232,6 +232,8 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
 
 %{mingw32_datadir}/libvirt/cpu_map.xml
 
+%{mingw32_datadir}/libvirt/test-screenshot.png
+
 %{mingw32_datadir}/locale/*/LC_MESSAGES/libvirt.mo
 
 %dir %{mingw32_includedir}/libvirt
@@ -314,6 +316,8 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
 
 %{mingw64_datadir}/libvirt/cpu_map.xml
 
+%{mingw64_datadir}/libvirt/test-screenshot.png
+
 %{mingw64_datadir}/locale/*/LC_MESSAGES/libvirt.mo
 
 %dir %{mingw64_includedir}/libvirt
index 8c620d5e08d9e33d279b8a2cc8dbe2bf93c9326f..f87fd473b13c69a85c695f69010acfca45c67a2e 100644 (file)
@@ -692,6 +692,7 @@ check-local: check-protocol check-symfile check-symsorting \
 # Mock driver, covering domains, storage, networks, etc
 TEST_DRIVER_SOURCES =                                          \
                test/test_driver.c test/test_driver.h
+TEST_DRIVER_ASSETS = test/test-screenshot.png
 
 # Now the Hypervisor specific drivers
 XEN_DRIVER_SOURCES =                                           \
@@ -1195,6 +1196,10 @@ GENERATED_SYM_FILES = \
        $(NULL)
 
 if WITH_TEST
+
+driver_test_asset_DATA = $(TEST_DRIVER_ASSETS)
+driver_test_assetdir = $(pkgdatadir)
+
 noinst_LTLIBRARIES += libvirt_driver_test.la
 libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
 libvirt_driver_test_la_CFLAGS = \
@@ -1887,6 +1892,7 @@ access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
 # Add all conditional sources just in case...
 EXTRA_DIST +=                                                  \
                $(TEST_DRIVER_SOURCES)                          \
+               $(TEST_DRIVER_ASSETS)                           \
                $(REMOTE_DRIVER_SOURCES)                        \
                $(XEN_DRIVER_SOURCES)                           \
                $(QEMU_DRIVER_SOURCES)                          \
diff --git a/src/test/test-screenshot.png b/src/test/test-screenshot.png
new file mode 100644 (file)
index 0000000..3991eab
Binary files /dev/null and b/src/test/test-screenshot.png differ
index 5a82f8e7f93871339e342685b41c657d91e597e3..de92a013a72628844135f426ef7485a03d180621 100644 (file)
@@ -5923,7 +5923,7 @@ testDomainScreenshot(virDomainPtr dom ATTRIBUTE_UNUSED,
     if (VIR_STRDUP(ret, "image/png") < 0)
         return NULL;
 
-    if (virFDStreamOpenFile(st, PKGDATADIR "/libvirtLogo.png", 0, 0, O_RDONLY) < 0)
+    if (virFDStreamOpenFile(st, PKGDATADIR "/test-screenshot.png", 0, 0, O_RDONLY) < 0)
         VIR_FREE(ret);
 
     return ret;