From 177bbdcd8fa4e7621c5bdd3afd8c6e74b603e096 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 15 Nov 2016 09:46:51 +0000 Subject: GRE tests and fixes Change-Id: I234240e9bdd4b69ad64a17b1449ae1e81c0edaca Signed-off-by: Neale Ranns --- test/Makefile | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'test/Makefile') diff --git a/test/Makefile b/test/Makefile index aac637d3..de6aaa7a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -6,23 +6,45 @@ ifndef VPP_PYTHON_PREFIX endif PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv -PYTHON_DEPENDS=scapy pexpect +PYTHON_DEPENDS=scapy==2.3.3 pexpect +SCAPY_SOURCE=$(WS_ROOT)/build-root/python/virtualenv/lib/python2.7/site-packages/ -test: wipe verify-python-path + +.pip-install.ok: @virtualenv $(PYTHON_VENV_PATH) @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS)" + @touch $@ + +.pip-patch.ok: .pip-install.ok + @echo --- patching --- + for f in $(CURDIR)/patches/scapy-2.3.3/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(SCAPY_SOURCE) < $$f ; \ + done + @touch $@ + +.install.ok: .pip-patch.ok @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && cd $(WS_ROOT)/vpp-api/python && python setup.py install" + @touch $@ + +PHONIES=.install.ok .pip-patch.ok .pip-install.ok +.PHONY: $(PHONIES) + +test: reset verify-python-path .install.ok @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\"" -retest: wipe verify-python-path +retest: reset verify-python-path @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\"" .PHONY: wipe doc -wipe: +reset: @rm -f /dev/shm/vpp-unittest-* @rm -rf /tmp/vpp-unittest-* +wipe: reset + @rm -f $(PHONIES) + doc: verify-python-path @virtualenv $(PYTHON_VENV_PATH) @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS) sphinx" -- cgit 1.2.3-korg