diff options
-rw-r--r-- | recipes-extended/libvirt/libvirt/run-ptest | 3 | ||||
-rw-r--r-- | recipes-extended/libvirt/libvirt/runptest.patch | 112 | ||||
-rw-r--r-- | recipes-extended/libvirt/libvirt_1.2.1.bb | 39 |
3 files changed, 151 insertions, 3 deletions
diff --git a/recipes-extended/libvirt/libvirt/run-ptest b/recipes-extended/libvirt/libvirt/run-ptest new file mode 100644 index 00000000..a434b186 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | make -C tests -k check-TESTS | ||
diff --git a/recipes-extended/libvirt/libvirt/runptest.patch b/recipes-extended/libvirt/libvirt/runptest.patch new file mode 100644 index 00000000..0c019751 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/runptest.patch | |||
@@ -0,0 +1,112 @@ | |||
1 | Add 'install-ptest' rule. | ||
2 | Change TESTS_ENVIRONMENT to allow running outside build dir. | ||
3 | |||
4 | Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> | ||
5 | Upstream-status: Pending | ||
6 | |||
7 | diff -uNr a/tests/Makefile.am b/tests/Makefile.am | ||
8 | --- a/tests/Makefile.am 2014-03-11 11:37:31.497605736 +0200 | ||
9 | +++ b/tests/Makefile.am 2014-03-17 15:57:35.515268399 +0200 | ||
10 | @@ -27,9 +27,11 @@ | ||
11 | -I$(top_srcdir)/src/conf \ | ||
12 | $(GETTEXT_CPPFLAGS) | ||
13 | |||
14 | +PTEST_DIR ?= /usr/lib/libvirt/ptest | ||
15 | + | ||
16 | AM_CFLAGS = \ | ||
17 | - -Dabs_builddir="\"`pwd`\"" \ | ||
18 | - -Dabs_srcdir="\"`cd '$(srcdir)'; pwd`\"" \ | ||
19 | + -Dabs_builddir="\"$(PTEST_DIR)/tests\"" \ | ||
20 | + -Dabs_srcdir="\"$(PTEST_DIR)/tests\"" \ | ||
21 | $(LIBXML_CFLAGS) \ | ||
22 | $(GNUTLS_CFLAGS) \ | ||
23 | $(SASL_CFLAGS) \ | ||
24 | @@ -41,7 +43,7 @@ | ||
25 | |||
26 | if WITH_DRIVER_MODULES | ||
27 | INCLUDES += \ | ||
28 | - -DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\" | ||
29 | + -DTEST_DRIVER_DIR=\"$(PTEST_DIR)/src/.libs\" | ||
30 | endif WITH_DRIVER_MODULES | ||
31 | |||
32 | PROBES_O = | ||
33 | @@ -344,20 +346,19 @@ | ||
34 | # Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an | ||
35 | # intermediate shell variable, but must do all the expansion in make | ||
36 | |||
37 | -lv_abs_top_builddir=`cd '$(top_builddir)'; pwd` | ||
38 | path_add = $(subst :,$(PATH_SEPARATOR),\ | ||
39 | - $(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests)) | ||
40 | + $(subst !,$(PTEST_DIR)/,!daemon:!tools:!tests)) | ||
41 | |||
42 | VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT) | ||
43 | TESTS_ENVIRONMENT = \ | ||
44 | - abs_top_builddir=$(lv_abs_top_builddir) \ | ||
45 | - abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \ | ||
46 | - abs_builddir=`pwd` \ | ||
47 | - abs_srcdir=`cd '$(srcdir)'; pwd` \ | ||
48 | - CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h" \ | ||
49 | + abs_top_builddir="$(PTEST_DIR)" \ | ||
50 | + abs_top_srcdir="$(PTEST_DIR)" \ | ||
51 | + abs_builddir="$(PTEST_DIR)/tests" \ | ||
52 | + abs_srcdir="$(PTEST_DIR)/tests" \ | ||
53 | + CONFIG_HEADER="$(PTEST_DIR)/config.h" \ | ||
54 | PATH="$(path_add)$(PATH_SEPARATOR)$$PATH" \ | ||
55 | SHELL="$(SHELL)" \ | ||
56 | - LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \ | ||
57 | + LIBVIRT_DRIVER_DIR="$(PTEST_DIR)/src/.libs" \ | ||
58 | LIBVIRT_AUTOSTART=0 \ | ||
59 | LC_ALL=C \ | ||
60 | VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \ | ||
61 | @@ -933,5 +934,51 @@ | ||
62 | EXTRA_DIST += object-locking.ml | ||
63 | endif ! WITH_CIL | ||
64 | |||
65 | +buildtest-TESTS: $(TESTS) $(test_libraries) $(test_helpers) | ||
66 | + | ||
67 | +PTESTS = $(TESTS) $(test_helpers) test-lib.sh schematestutils.sh | ||
68 | + | ||
69 | +install-ptest: | ||
70 | + list='$(TESTS) $(test_helpers) test-lib.sh schematestutils.sh' | ||
71 | + install -d $(DEST_DIR)/tools | ||
72 | + @(if [ -d ../tools/.libs ] ; then cd ../tools/.libs; fi; \ | ||
73 | + install * $(DEST_DIR)/tools) | ||
74 | + install -d $(DEST_DIR)/src/network | ||
75 | + cp ../src/network/*.xml $(DEST_DIR)/src/network | ||
76 | + install -d $(DEST_DIR)/src/cpu | ||
77 | + cp ../src/cpu/*.xml $(DEST_DIR)/src/cpu | ||
78 | + install ../src/libvirt_iohelper $(DEST_DIR)/src | ||
79 | + install -D ../daemon/libvirtd $(DEST_DIR)/daemon/libvirtd | ||
80 | + install -D ../daemon/libvirtd.conf $(DEST_DIR)/daemon/libvirtd.conf | ||
81 | + @(if [ -d ../daemon/.libs ] ; then cd ../daemon/.libs; fi; \ | ||
82 | + install * $(DEST_DIR)/daemon) | ||
83 | + install -d $(DEST_DIR)/src/.libs | ||
84 | + @(if [ -d ../src/.libs ] ; then cd ../src/.libs; fi; \ | ||
85 | + install * $(DEST_DIR)/src/.libs) | ||
86 | + install -d $(DEST_DIR)/docs/schemas | ||
87 | + cp ../docs/schemas/*.rng $(DEST_DIR)/docs/schemas | ||
88 | + cp -r ../build-aux $(DEST_DIR) | ||
89 | + install -d $(DEST_DIR)/examples/xml | ||
90 | + cp -r ../examples/xml/test $(DEST_DIR)/examples/xml | ||
91 | + install -d $(DEST_DIR)/tests/.libs | ||
92 | + find . -type d -name "*xml2xml*" -exec cp -r {} $(DEST_DIR)/tests \; | ||
93 | + find . -type d -name "*data" -exec cp -r {} $(DEST_DIR)/tests \; | ||
94 | + @(for file in $(PTESTS); do \ | ||
95 | + if [ -f .libs/$$file ]; then \ | ||
96 | + install .libs/$$file $(DEST_DIR)/tests; \ | ||
97 | + else \ | ||
98 | + install $$file $(DEST_DIR)/tests; \ | ||
99 | + fi; \ | ||
100 | + done;) | ||
101 | + @(if [ -d .libs ]; then install .libs/*.so $(DEST_DIR)/tests/.libs; fi;) | ||
102 | + cp ../config.h $(DEST_DIR) | ||
103 | + cp Makefile $(DEST_DIR)/tests | ||
104 | + sed -i -e 's/^Makefile:/_Makefile:/' $(DEST_DIR)/tests/Makefile | ||
105 | + cp ../Makefile $(DEST_DIR) | ||
106 | + sed -i -e 's|^Makefile:|_Makefile:|' $(DEST_DIR)/Makefile | ||
107 | + sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/tests/Makefile | ||
108 | + sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/Makefile | ||
109 | + sed -i -e 's|^\(.*\.log:\) \(.*EXEEXT.*\)|\1|g' $(DEST_DIR)/tests/Makefile | ||
110 | + | ||
111 | CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \ | ||
112 | object-locking-files.txt | ||
diff --git a/recipes-extended/libvirt/libvirt_1.2.1.bb b/recipes-extended/libvirt/libvirt_1.2.1.bb index 4c9cf36f..e2c0f99d 100644 --- a/recipes-extended/libvirt/libvirt_1.2.1.bb +++ b/recipes-extended/libvirt/libvirt_1.2.1.bb | |||
@@ -1,6 +1,7 @@ | |||
1 | DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." | 1 | DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." |
2 | HOMEPAGE = "http://libvirt.org" | 2 | HOMEPAGE = "http://libvirt.org" |
3 | LICENSE = "LGPLv2.1+" | 3 | LICENSE = "LGPLv2.1+" |
4 | LICENSE_${PN}-ptest = "GPLv2+ & LGPLv2.1" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
5 | file://COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c" | 6 | file://COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c" |
6 | SECTION = "console/tools" | 7 | SECTION = "console/tools" |
@@ -13,6 +14,8 @@ DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux | |||
13 | # | 14 | # |
14 | RDEPENDS_${PN} = "gettext-runtime" | 15 | RDEPENDS_${PN} = "gettext-runtime" |
15 | 16 | ||
17 | RDEPENDS_${PN}-ptest += "make gawk" | ||
18 | |||
16 | RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" | 19 | RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" |
17 | RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" | 20 | RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" |
18 | RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" | 21 | RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" |
@@ -22,13 +25,16 @@ RCONFLICTS_${PN}_libvirtd = "connman" | |||
22 | 25 | ||
23 | SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ | 26 | SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ |
24 | file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ | 27 | file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ |
25 | file://libvirtd.sh \ | 28 | file://libvirtd.sh \ |
26 | file://libvirtd.conf" | 29 | file://libvirtd.conf \ |
30 | file://runptest.patch \ | ||
31 | file://run-ptest \ | ||
32 | " | ||
27 | 33 | ||
28 | SRC_URI[libvirt.md5sum] = "cce374220f67895afb6331bd2ddedbfd" | 34 | SRC_URI[libvirt.md5sum] = "cce374220f67895afb6331bd2ddedbfd" |
29 | SRC_URI[libvirt.sha256sum] = "bc29b5751bf36753c17e2fdbb75e70c7b07df3d9527586d3426e90f5f4abb898" | 35 | SRC_URI[libvirt.sha256sum] = "bc29b5751bf36753c17e2fdbb75e70c7b07df3d9527586d3426e90f5f4abb898" |
30 | 36 | ||
31 | inherit autotools gettext update-rc.d pkgconfig | 37 | inherit autotools gettext update-rc.d pkgconfig ptest |
32 | 38 | ||
33 | CACHED_CONFIGUREVARS += "\ | 39 | CACHED_CONFIGUREVARS += "\ |
34 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ | 40 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ |
@@ -105,6 +111,23 @@ INITSCRIPT_PACKAGES = "${PN}-libvirtd" | |||
105 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" | 111 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" |
106 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" | 112 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" |
107 | 113 | ||
114 | PRIVATE_LIBS_${PN}-ptest = " \ | ||
115 | libvirt-lxc.so.0 \ | ||
116 | libvirt.so.0 \ | ||
117 | libvirt-qemu.so.0 \ | ||
118 | lockd.so \ | ||
119 | libvirt_driver_secret.so \ | ||
120 | libvirt_driver_nodedev.so \ | ||
121 | libvirt_driver_vbox.so \ | ||
122 | libvirt_driver_interface.so \ | ||
123 | libvirt_driver_uml.so \ | ||
124 | libvirt_driver_network.so \ | ||
125 | libvirt_driver_nwfilter.so \ | ||
126 | libvirt_driver_qemu.so \ | ||
127 | libvirt_driver_storage.so \ | ||
128 | libvirt_driver_lxc.so \ | ||
129 | " | ||
130 | |||
108 | # xen-minimal config | 131 | # xen-minimal config |
109 | #PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" | 132 | #PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" |
110 | 133 | ||
@@ -176,6 +199,16 @@ do_install_append() { | |||
176 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | 199 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt |
177 | } | 200 | } |
178 | 201 | ||
202 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}" | ||
203 | |||
204 | do_compile_ptest() { | ||
205 | oe_runmake -C tests buildtest-TESTS | ||
206 | } | ||
207 | |||
208 | do_install_ptest() { | ||
209 | oe_runmake -C tests install-ptest | ||
210 | } | ||
211 | |||
179 | pkg_postinst_libvirt() { | 212 | pkg_postinst_libvirt() { |
180 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | 213 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then |
181 | /etc/init.d/populate-volatile.sh update | 214 | /etc/init.d/populate-volatile.sh update |