+$(PAPI_INSTALL_DONE): $(PIP_PATCH_DONE)
+ @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && cd $(WS_ROOT)/src/vpp-api/python && python setup.py install"
+ @touch $@
+
+define retest-func
+@env VPP_TEST_FAILED_DIR=$(VPP_TEST_FAILED_DIR) scripts/setsid_wrapper.sh $(FORCE_FOREGROUND) $(PYTHON_VENV_PATH)/bin/activate python run_tests.py -d $(TEST_DIR) $(UNITTEST_EXTRA_OPTS) || env VPP_TEST_FAILED_DIR=$(VPP_TEST_FAILED_DIR) COMPRESS_FAILED_TEST_LOGS=$(COMPRESS_FAILED_TEST_LOGS) scripts/compress_failed.sh
+endef
+
+.PHONY: sanity
+
+ifeq ($(SANITY),no)
+SANITY_IMPORT_VPP_PAPI_CMD=true
+SANITY_RUN_VPP_CMD=true
+else
+SANITY_IMPORT_VPP_PAPI_CMD=source $(PYTHON_VENV_PATH)/bin/activate && python sanity_import_vpp_papi.py
+SANITY_RUN_VPP_CMD=source $(PYTHON_VENV_PATH)/bin/activate && python sanity_run_vpp.py
+endif
+
+sanity: verify-no-running-vpp
+ @sys_req/dev_shm_size.sh
+ @sys_req/set_system_parameters.sh sys_req/system_parameters
+ @bash -c "$(SANITY_IMPORT_VPP_PAPI_CMD) ||\
+ (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)"
+ @bash -c "$(SANITY_RUN_VPP_CMD) ||\
+ (echo \"*******************************************************************\" &&\
+ echo \"* Sanity check failed, cannot run vpp\" &&\
+ echo \"*******************************************************************\" &&\
+ false)"
+
+.PHONY: ext
+ext:
+ make -C ext
+
+test: verify-python-path $(PAPI_INSTALL_DONE) ext sanity reset
+ $(call retest-func)
+
+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 EXTERN_TESTS=$(EXTERN_TESTS);\
+ echo EXTERN_PLUGINS=$(EXTERN_PLUGINS);\
+ echo EXTERN_COV_DIR=$(EXTERN_COV_DIR);\
+ echo LD_LIBRARY_PATH=$(LD_LIBRARY_PATH);\
+ echo '***';\
+ exec </dev/tty" | bash -i