diff options
author | Radu Patriu <radu.patriu@enea.com> | 2014-03-31 11:49:58 +0300 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-04-01 20:51:45 -0400 |
commit | 36b5a4ca38064cfd5e19554f4b9a2b138a055478 (patch) | |
tree | e2d0dddc258bb08e84670b1263b43871458c0f00 /recipes-networking/openvswitch | |
parent | 594a85674c5fd98ca9b34c3d94cca5c84c95cccb (diff) | |
download | meta-virtualization-36b5a4ca38064cfd5e19554f4b9a2b138a055478.tar.gz |
openvswitch: add ptest support
Install openvswitch test suite and run it as ptest.
Signed-off-by: Radu Patriu <radu.patriu@enea.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-networking/openvswitch')
-rw-r--r-- | recipes-networking/openvswitch/files/openvswitch-add-ptest.patch | 67 | ||||
-rw-r--r-- | recipes-networking/openvswitch/files/run-ptest | 4 | ||||
-rw-r--r-- | recipes-networking/openvswitch/openvswitch_2.0.0.bb | 16 |
3 files changed, 85 insertions, 2 deletions
diff --git a/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch b/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch new file mode 100644 index 00000000..aebb1823 --- /dev/null +++ b/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | Add test-install rule to support ptest execution | ||
2 | |||
3 | Signed-off-by: Radu Patriu <radu.patriu@enea.com> | ||
4 | |||
5 | Index: ovs/Makefile.am | ||
6 | =================================================================== | ||
7 | --- ovs.orig/Makefile.am 2014-03-10 16:19:46.000000000 +0200 | ||
8 | +++ ovs/Makefile.am 2014-03-10 16:23:10.481075341 +0200 | ||
9 | @@ -276,3 +276,4 @@ | ||
10 | include python/automake.mk | ||
11 | include python/compat/automake.mk | ||
12 | include tutorial/automake.mk | ||
13 | +include test.mk | ||
14 | Index: ovs/test.mk | ||
15 | =================================================================== | ||
16 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
17 | +++ ovs/test.mk 2014-03-10 16:42:41.000000000 +0200 | ||
18 | @@ -0,0 +1,49 @@ | ||
19 | +TEST_DEST ?= ${prefix}/lib/openvswitch | ||
20 | +TEST_ROOT ?= ${prefix}/lib/openvswitch | ||
21 | +TEST_DEPEND = | ||
22 | + | ||
23 | +if HAVE_OPENSSL | ||
24 | +TEST_DEPEND += $(TESTPKI_FILES) | ||
25 | +endif | ||
26 | + | ||
27 | +test-install: $(TEST_DEPEND) | ||
28 | + @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ | ||
29 | + install -d $(TEST_DEST)/tests ;\ | ||
30 | + install -d $(TEST_DEST)/python ;\ | ||
31 | + install -d $(TEST_DEST)/python/ovs ;\ | ||
32 | + install -d $(TEST_DEST)/python/ovs/db ;\ | ||
33 | + install -d $(TEST_DEST)/python/ovs/unixctl ;\ | ||
34 | + install -d $(TEST_DEST)/vswitchd ;\ | ||
35 | + install vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ | ||
36 | + install -d $(TEST_DEST)/debian ;\ | ||
37 | + install debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ | ||
38 | + install -d $(TEST_DEST)/build-aux ;\ | ||
39 | + install build-aux/check-structs $(TEST_DEST)/build-aux ;\ | ||
40 | + install -d $(TEST_DEST)/xenserver ;\ | ||
41 | + install xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ | ||
42 | + install xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ | ||
43 | + install xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ | ||
44 | + install xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ | ||
45 | + install xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ | ||
46 | + install -d $(TEST_DEST)/vtep ;\ | ||
47 | + install vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ | ||
48 | + for p in $$list ; do \ | ||
49 | + echo $$p ;\ | ||
50 | + p=$${p#./} ;\ | ||
51 | + pre=$${p#tests\/} ;\ | ||
52 | + if test $$pre != $$p ; then \ | ||
53 | + echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ | ||
54 | + install $$p $(TEST_DEST)/tests/$$pre ;\ | ||
55 | + continue ;\ | ||
56 | + fi ;\ | ||
57 | + pre=$${p#python\/ovs\/} ;\ | ||
58 | + if test $$pre != $$p ; then \ | ||
59 | + echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ | ||
60 | + install $$p $(TEST_DEST)/python/ovs/$$pre ;\ | ||
61 | + continue ;\ | ||
62 | + fi; \ | ||
63 | + done ;\ | ||
64 | + sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig | ||
65 | + sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig | ||
66 | + sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig | ||
67 | + sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig | ||
diff --git a/recipes-networking/openvswitch/files/run-ptest b/recipes-networking/openvswitch/files/run-ptest new file mode 100644 index 00000000..dd067076 --- /dev/null +++ b/recipes-networking/openvswitch/files/run-ptest | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ./tests/testsuite --am-fmt -C tests AUTOTEST_PATH=utilities:vswitchd:ovsdb:tests | ||
4 | |||
diff --git a/recipes-networking/openvswitch/openvswitch_2.0.0.bb b/recipes-networking/openvswitch/openvswitch_2.0.0.bb index 15c4dcaf..01003082 100644 --- a/recipes-networking/openvswitch/openvswitch_2.0.0.bb +++ b/recipes-networking/openvswitch/openvswitch_2.0.0.bb | |||
@@ -14,6 +14,10 @@ RDEPENDS_${PN}-pki = "${PN}" | |||
14 | RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch" | 14 | RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch" |
15 | RRECOMMENDS_${PN} += "kernel-module-openvswitch" | 15 | RRECOMMENDS_${PN} += "kernel-module-openvswitch" |
16 | 16 | ||
17 | RDEPENDS_${PN}-ptest += "python-logging python-syslog python-argparse python-io \ | ||
18 | python-fcntl python-shell python-lang python-xml python-math \ | ||
19 | python-datetime python-netclient python sed" | ||
20 | |||
17 | # Some installers will fail because of an install order based on | 21 | # Some installers will fail because of an install order based on |
18 | # rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be | 22 | # rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be |
19 | # queued for install later. | 23 | # queued for install later. |
@@ -26,7 +30,9 @@ SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \ | |||
26 | file://openvswitch-controller-setup \ | 30 | file://openvswitch-controller-setup \ |
27 | file://openvswitch-add-target-python-handling.patch \ | 31 | file://openvswitch-add-target-python-handling.patch \ |
28 | file://openvswitch-add-target-perl-handling.patch \ | 32 | file://openvswitch-add-target-perl-handling.patch \ |
29 | file://openvswitch-add-more-target-python-substitutions.patch \ | 33 | file://openvswitch-add-more-target-python-substitutions.patch \ |
34 | file://openvswitch-add-ptest.patch \ | ||
35 | file://run-ptest \ | ||
30 | " | 36 | " |
31 | 37 | ||
32 | SRC_URI[md5sum] = "7d7a58350e634e515e0fe43c64d64f44" | 38 | SRC_URI[md5sum] = "7d7a58350e634e515e0fe43c64d64f44" |
@@ -60,7 +66,13 @@ FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \ | |||
60 | FILES_${PN} += "${datadir}/ovsdbmonitor" | 66 | FILES_${PN} += "${datadir}/ovsdbmonitor" |
61 | FILES_${PN} += "/run" | 67 | FILES_${PN} += "/run" |
62 | 68 | ||
63 | inherit autotools update-rc.d | 69 | inherit autotools update-rc.d ptest |
70 | |||
71 | EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" | ||
72 | |||
73 | do_install_ptest() { | ||
74 | oe_runmake test-install | ||
75 | } | ||
64 | 76 | ||
65 | INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller" | 77 | INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller" |
66 | INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch" | 78 | INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch" |