Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | From a2a656e6976a60e5df3ade0d17a40b4ebdc2b41a Mon Sep 17 00:00:00 2001 |
| 2 | From: He Zhe <zhe.he@windriver.com> |
| 3 | Date: Wed, 30 Mar 2016 06:23:45 -0400 |
| 4 | Subject: [PATCH] openvswitch: Add test-install rule to support ptest execution |
| 5 | |
| 6 | Signed-off-by: Radu Patriu <radu.patriu@enea.com> |
| 7 | |
| 8 | Fix ptest for v2.5 |
| 9 | - Copy certain files from srcdir since it has been different from |
| 10 | build directory. |
| 11 | - Copy more necessary files for new added test cases. |
| 12 | - Modify config files for running on target. |
| 13 | |
| 14 | Signed-off-by: He Zhe <zhe.he@windriver.com> |
| 15 | --- |
| 16 | Makefile.am | 1 + |
| 17 | test.mk | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 18 | 2 files changed, 73 insertions(+) |
| 19 | create mode 100644 test.mk |
| 20 | |
| 21 | diff --git a/Makefile.am b/Makefile.am |
| 22 | index a4dd7b8..0bd32c7 100644 |
| 23 | --- a/Makefile.am |
| 24 | +++ b/Makefile.am |
| 25 | @@ -429,3 +429,4 @@ include windows/automake.mk |
| 26 | include ovn/automake.mk |
| 27 | include selinux/automake.mk |
| 28 | include build-aux/automake.mk |
| 29 | +include test.mk |
| 30 | diff --git a/test.mk b/test.mk |
| 31 | new file mode 100644 |
| 32 | index 0000000..b10a581 |
| 33 | --- /dev/null |
| 34 | +++ b/test.mk |
| 35 | @@ -0,0 +1,72 @@ |
| 36 | +TEST_DEST ?= ${prefix}/lib/openvswitch |
| 37 | +TEST_ROOT ?= ${prefix}/lib/openvswitch |
| 38 | +TEST_DEPEND = |
| 39 | + |
| 40 | +if HAVE_OPENSSL |
| 41 | +TEST_DEPEND += $(TESTPKI_FILES) |
| 42 | +endif |
| 43 | + |
| 44 | +test-install: $(TEST_DEPEND) |
| 45 | + @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ |
| 46 | + install -d $(TEST_DEST)/tests ;\ |
| 47 | + install $(srcdir)/vtep/ovs-vtep $(TEST_DEST)/tests ;\ |
| 48 | + install -d $(TEST_DEST)/python ;\ |
| 49 | + install -d $(TEST_DEST)/python/ovs ;\ |
| 50 | + install -d $(TEST_DEST)/python/ovs/db ;\ |
| 51 | + install -d $(TEST_DEST)/python/ovs/unixctl ;\ |
| 52 | + install -d $(TEST_DEST)/vswitchd ;\ |
| 53 | + install $(srcdir)/vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ |
| 54 | + install vswitchd/ovs-vswitchd $(TEST_DEST)/vswitchd ;\ |
| 55 | + install -d $(TEST_DEST)/debian ;\ |
| 56 | + install $(srcdir)/debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ |
| 57 | + install -d $(TEST_DEST)/build-aux ;\ |
| 58 | + install $(srcdir)/build-aux/check-structs $(TEST_DEST)/build-aux ;\ |
| 59 | + install -d $(TEST_DEST)/xenserver ;\ |
| 60 | + install $(srcdir)/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ |
| 61 | + install $(srcdir)/xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ |
| 62 | + install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ |
| 63 | + install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ |
| 64 | + install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ |
| 65 | + install -d $(TEST_DEST)/vtep ;\ |
| 66 | + install $(srcdir)/vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ |
| 67 | + install -d $(TEST_DEST)/ovn ;\ |
| 68 | + install $(srcdir)/ovn/ovn-nb.ovsschema $(TEST_DEST)/ovn ;\ |
| 69 | + install $(srcdir)/ovn/ovn-sb.ovsschema $(TEST_DEST)/ovn ;\ |
| 70 | + install -d $(TEST_DEST)/utilities ;\ |
| 71 | + install $(srcdir)/utilities/ovs-pcap.in $(TEST_DEST)/utilities ;\ |
| 72 | + install $(srcdir)/utilities/ovs-pki.in $(TEST_DEST)/utilities ;\ |
| 73 | + for p in $$list ; do \ |
| 74 | + echo $$p ;\ |
| 75 | + p=$${p#../git/} ;\ |
| 76 | + pre=$${p#tests\/} ;\ |
| 77 | + if test $$pre != $$p ; then \ |
| 78 | + echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ |
| 79 | + if test -f $$p ; then \ |
| 80 | + install $$p $(TEST_DEST)/tests/$$pre ;\ |
| 81 | + else \ |
| 82 | + install $(srcdir)/$$p $(TEST_DEST)/tests/$$pre ;\ |
| 83 | + fi ;\ |
| 84 | + continue ;\ |
| 85 | + fi ;\ |
| 86 | + pre=$${p#python\/ovs\/} ;\ |
| 87 | + if test $$pre != $$p ; then \ |
| 88 | + echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ |
| 89 | + if test -f $$p ; then \ |
| 90 | + install $$p $(TEST_DEST)/python/ovs/$$pre ;\ |
| 91 | + else \ |
| 92 | + install $(srcdir)/$$p $(TEST_DEST)/python/ovs/$$pre ;\ |
| 93 | + fi ;\ |
| 94 | + continue ;\ |
| 95 | + fi; \ |
| 96 | + done ;\ |
| 97 | + sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 98 | + sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 99 | + sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 100 | + sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 101 | + sed -i 's|at_srcdir=.*|at_srcdir='"'"'.'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 102 | + sed -i 's|at_top_srcdir=.*|at_top_srcdir='"'"'..'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 103 | + sed -i 's|at_top_build_prefix=.*|at_top_build_prefix='"'"'../'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 104 | + sed -i 's|^\(.*config\.log.*\)|#\1|g' $(TEST_DEST)/tests/testsuite |
| 105 | + sed -i 's|$$srcdir|$$abs_srcdir|g' $(TEST_DEST)/tests/testsuite |
| 106 | + sed -i 's|ovs-appctl-bashcomp\.bash|/etc/bash_completion.d/ovs-appctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite |
| 107 | + sed -i 's|ovs-vsctl-bashcomp\.bash|/etc/bash_completion.d/ovs-vsctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite |
| 108 | -- |
| 109 | 2.7.4 |
| 110 | |