X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2FMakefile;h=4338e09675e0f57b73332fa63fab530dc41400ab;hb=3cc4971882235a539bc6177e8e4b4d92129b3a12;hp=fd1bc0a4d62728b6b0fe766c1cc7738ce2446f0b;hpb=770e89e6b916319eedd91c6edf16f0d7e89f556c;p=vpp.git diff --git a/test/Makefile b/test/Makefile index fd1bc0a4d62..4338e09675e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -5,6 +5,24 @@ ifndef VPP_PYTHON_PREFIX $(error VPP_PYTHON_PREFIX is not set) endif +.PHONY: verify-no-running-vpp + +ifdef VPP_ZOMBIE_NOCHECK +VPP_PIDS= +else +VPP_PIDS=$(shell pgrep -d, -x vpp_main) +endif + +verify-no-running-vpp: + @if [ "$(VPP_PIDS)" != "" ]; then \ + echo; \ + echo "*** Existing vpp processes detected (PID(s): $(VPP_PIDS)). Running tests under these conditions is not supported. ***"; \ + echo; \ + ps -fp $(VPP_PIDS);\ + echo; \ + false; \ + fi + UNITTEST_EXTRA_OPTS="" ifeq ($(FAILFAST),1) @@ -12,7 +30,7 @@ UNITTEST_EXTRA_OPTS="-f" endif PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv -PYTHON_DEPENDS=scapy==2.3.3 pexpect subprocess32 git+https://github.com/klement/py-lispnetworking@setup +PYTHON_DEPENDS=scapy==2.3.3 pexpect subprocess32 cffi git+https://github.com/klement/py-lispnetworking@setup SCAPY_SOURCE=$(PYTHON_VENV_PATH)/lib/python2.7/site-packages/ BUILD_COV_DIR = $(BR)/test-cov @@ -44,12 +62,35 @@ define retest-func @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover $(UNITTEST_EXTRA_OPTS) -p test_\"*.py\"" endef -test: reset verify-python-path $(PAPI_INSTALL_DONE) +.PHONY: sanity + +sanity: verify-no-running-vpp + @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python sanity_import_vpp_papi.py ||\ + (echo \"*******************************************************************\" &&\ + echo \"* Sanity check failed, cannot import vpp_papi\" &&\ + echo \"* to debug: \" &&\ + echo \"* 1. enter test shell: make test-shell\" &&\ + echo \"* 2. execute debugger: gdb python -ex 'run sanity_import_vpp_papi.py'\" &&\ + echo \"*******************************************************************\" &&\ + false)" + +test: verify-python-path $(PAPI_INSTALL_DONE) sanity reset $(call retest-func) -retest: reset verify-python-path +retest: verify-python-path sanity reset $(call retest-func) +shell: verify-python-path $(PAPI_INSTALL_DONE) + @echo "source $(PYTHON_VENV_PATH)/bin/activate;\ + echo '***';\ + echo VPP_TEST_BUILD_DIR=$(VPP_TEST_BUILD_DIR);\ + echo VPP_TEST_BIN=$(VPP_TEST_BIN);\ + echo VPP_TEST_PLUGIN_PATH=$(VPP_TEST_PLUGIN_PATH);\ + echo VPP_TEST_INSTALL_PATH=$(VPP_TEST_INSTALL_PATH);\ + echo LD_LIBRARY_PATH=$(LD_LIBRARY_PATH);\ + echo '***';\ + exec - pass as unix { coredump-size } argument to vpp" + @echo " e.g. COREDUMP_SIZE=4g" + @echo " COREDUMP_SIZE=unlimited" + @echo "" @echo "Creating test documentation" @echo " test-doc - generate documentation for test framework" @echo " test-wipe-doc - wipe documentation for test framework"