1 .PHONY: verify-python-path
4 ifndef VPP_PYTHON_PREFIX
5 $(error VPP_PYTHON_PREFIX is not set)
8 PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv
9 PYTHON_DEPENDS=scapy==2.3.3 pexpect
10 SCAPY_SOURCE=$(WS_ROOT)/build-root/python/virtualenv/lib/python2.7/site-packages/
14 @virtualenv $(PYTHON_VENV_PATH)
15 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS)"
18 .pip-patch.ok: .pip-install.ok
19 @echo --- patching ---
20 for f in $(CURDIR)/patches/scapy-2.3.3/*.patch ; do \
21 echo Applying patch: $$(basename $$f) ; \
22 patch -p1 -d $(SCAPY_SOURCE) < $$f ; \
26 .install.ok: .pip-patch.ok
27 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && cd $(WS_ROOT)/vpp-api/python && python setup.py install"
30 PHONIES=.install.ok .pip-patch.ok .pip-install.ok
33 test: reset verify-python-path .install.ok
34 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
36 retest: reset verify-python-path
37 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
42 @rm -f /dev/shm/vpp-unittest-*
43 @rm -rf /tmp/vpp-unittest-*
48 doc: verify-python-path
49 @virtualenv $(PYTHON_VENV_PATH)
50 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS) sphinx"
51 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && make -C doc WS_ROOT=$(WS_ROOT) BR=$(BR) NO_VPP_PAPI=1 html"
54 @make -C doc wipe BR=$(BR)
57 @echo "Running tests:"
59 @echo " test - build and run functional tests"
60 @echo " test-debug - build and run functional tests (debug build)"
61 @echo " retest - run functional tests"
62 @echo " retest-debug - run functional tests (debug build)"
63 @echo " wipe-test - wipe (temporary) files generated by unit tests"
65 @echo "Arguments controlling test runs:"
66 @echo " V=[0|1|2] - set test verbosity level"
67 @echo " DEBUG=<type> - set VPP debugging kind"
68 @echo " DEBUG=core - detect coredump and load it in gdb on crash"
69 @echo " DEBUG=gdb - allow easy debugging by printing VPP PID "
70 @echo " and waiting for user input before running "
71 @echo " and tearing down a testcase"
72 @echo " DEBUG=gdbserver - run gdb inside a gdb server, otherwise "
73 @echo " same as above"
74 @echo " STEP=[yes|no] - ease debugging by stepping through a testcase "
75 @echo " TEST=<name> - only run specific test"
77 @echo "Creating test documentation"
78 @echo " test-doc - generate documentation for test framework"
79 @echo " wipe-test-doc - wipe documentation for test framework"