From: Daniel P. Berrange Date: Tue, 6 Dec 2016 12:45:18 +0000 (+0000) Subject: test: fix screenshot API impl X-Git-Tag: v3.0.0-rc1~371 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0be9cea1990a62953a8b6bcfec8bf266d93dc395;p=thirdparty%2Flibvirt.git test: fix screenshot API impl 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 --- diff --git a/libvirt.spec.in b/libvirt.spec.in index 4f35313a20..4bb0699cba 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1842,6 +1842,8 @@ exit 0 %{_datadir}/libvirt/cpu_map.xml +%{_datadir}/libvirt/test-screenshot.png + %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf %files admin diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index 65d3e6df96..e088dc22a5 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index 8c620d5e08..f87fd473b1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 index 0000000000..3991eabb22 Binary files /dev/null and b/src/test/test-screenshot.png differ diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 5a82f8e7f9..de92a013a7 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -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;