Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame^] | 1 | Add test-install rule to support ptest execution |
| 2 | |
| 3 | Signed-off-by: Radu Patriu <radu.patriu@enea.com> |
| 4 | |
| 5 | Index: openvswitch-2.1.2/Makefile.am |
| 6 | =================================================================== |
| 7 | --- openvswitch-2.1.2.orig/Makefile.am |
| 8 | +++ openvswitch-2.1.2/Makefile.am |
| 9 | @@ -300,3 +300,5 @@ |
| 10 | include python/compat/automake.mk |
| 11 | include tutorial/automake.mk |
| 12 | include vtep/automake.mk |
| 13 | +include test.mk |
| 14 | + |
| 15 | Index: openvswitch-2.1.2/test.mk |
| 16 | =================================================================== |
| 17 | --- /dev/null |
| 18 | +++ openvswitch-2.1.2/test.mk |
| 19 | @@ -0,0 +1,49 @@ |
| 20 | +TEST_DEST ?= ${prefix}/lib/openvswitch |
| 21 | +TEST_ROOT ?= ${prefix}/lib/openvswitch |
| 22 | +TEST_DEPEND = |
| 23 | + |
| 24 | +if HAVE_OPENSSL |
| 25 | +TEST_DEPEND += $(TESTPKI_FILES) |
| 26 | +endif |
| 27 | + |
| 28 | +test-install: $(TEST_DEPEND) |
| 29 | + @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ |
| 30 | + install -d $(TEST_DEST)/tests ;\ |
| 31 | + install -d $(TEST_DEST)/python ;\ |
| 32 | + install -d $(TEST_DEST)/python/ovs ;\ |
| 33 | + install -d $(TEST_DEST)/python/ovs/db ;\ |
| 34 | + install -d $(TEST_DEST)/python/ovs/unixctl ;\ |
| 35 | + install -d $(TEST_DEST)/vswitchd ;\ |
| 36 | + install vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ |
| 37 | + install -d $(TEST_DEST)/debian ;\ |
| 38 | + install debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ |
| 39 | + install -d $(TEST_DEST)/build-aux ;\ |
| 40 | + install build-aux/check-structs $(TEST_DEST)/build-aux ;\ |
| 41 | + install -d $(TEST_DEST)/xenserver ;\ |
| 42 | + install xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ |
| 43 | + install xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ |
| 44 | + install xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ |
| 45 | + install xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ |
| 46 | + install xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ |
| 47 | + install -d $(TEST_DEST)/vtep ;\ |
| 48 | + install vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ |
| 49 | + for p in $$list ; do \ |
| 50 | + echo $$p ;\ |
| 51 | + p=$${p#./} ;\ |
| 52 | + pre=$${p#tests\/} ;\ |
| 53 | + if test $$pre != $$p ; then \ |
| 54 | + echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ |
| 55 | + install $$p $(TEST_DEST)/tests/$$pre ;\ |
| 56 | + continue ;\ |
| 57 | + fi ;\ |
| 58 | + pre=$${p#python\/ovs\/} ;\ |
| 59 | + if test $$pre != $$p ; then \ |
| 60 | + echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ |
| 61 | + install $$p $(TEST_DEST)/python/ovs/$$pre ;\ |
| 62 | + continue ;\ |
| 63 | + fi; \ |
| 64 | + done ;\ |
| 65 | + sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 66 | + sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 67 | + sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig |
| 68 | + sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig |