ESP_AH_test_automation_scripts rev1
[vpp.git] / test / Makefile
index 870d2af..4f090a1 100644 (file)
@@ -19,6 +19,8 @@ ifeq ($(DEBUG),gdb)
 FORCE_FOREGROUND=1
 else ifeq ($(DEBUG),gdbserver)
 FORCE_FOREGROUND=1
+else ifeq ($(DEBUG),core)
+FORCE_FOREGROUND=1
 else
 FORCE_FOREGROUND=0
 endif
@@ -45,7 +47,7 @@ UNITTEST_EXTRA_OPTS=$(UNITTEST_FAILFAST_OPTS) -d $(EXTERN_TESTS)
 endif
 
 PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv
-PYTHON_DEPENDS=faulthandler six scapy==2.3.3 pexpect subprocess32 cffi git+https://github.com/klement/py-lispnetworking@setup
+PYTHON_DEPENDS=faulthandler six scapy==2.3.3 pexpect pycrypto subprocess32 cffi git+https://github.com/klement/py-lispnetworking@setup
 SCAPY_SOURCE=$(shell find $(PYTHON_VENV_PATH) -name site-packages)
 BUILD_COV_DIR=$(BR)/test-cov
 
@@ -91,8 +93,16 @@ 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
-       @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python sanity_import_vpp_papi.py ||\
+       @bash -c "$(SANITY_IMPORT_VPP_PAPI_CMD) ||\
                (echo \"*******************************************************************\" &&\
                 echo \"* Sanity check failed, cannot import vpp_papi\" &&\
                 echo \"* to debug: \" &&\
@@ -100,7 +110,7 @@ sanity: verify-no-running-vpp
                 echo \"* 2. execute debugger:   gdb python -ex 'run sanity_import_vpp_papi.py'\" &&\
                 echo \"*******************************************************************\" &&\
                 false)"
-       @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python sanity_run_vpp.py ||\
+       @bash -c "$(SANITY_RUN_VPP_CMD) ||\
                (echo \"*******************************************************************\" &&\
                 echo \"* Sanity check failed, cannot run vpp\" &&\
                 echo \"*******************************************************************\" &&\
@@ -200,6 +210,7 @@ help:
        @echo ""
        @echo "Arguments controlling test runs:"
        @echo " V=[0|1|2]            - set test verbosity level"
+       @echo " CACHE_OUTPUT=[0|1]   - cache VPP stdout/stderr and log as one block after test finishes (default: 1)"
        @echo " FAILFAST=[0|1]       - fail fast if 1, complete all tests if 0"
        @echo " TIMEOUT=<timeout>    - fail test suite if any single test takes longer than <timeout> to finish"
        @echo " RETRIES=<n>          - retry failed tests <n> times"
@@ -211,6 +222,7 @@ help:
        @echo "    DEBUG=gdbserver   - run gdb inside a gdb server, otherwise "
        @echo "                        same as above"
        @echo " STEP=[yes|no]        - ease debugging by stepping through a testcase "
+       @echo " SANITY=[yes|no]      - perform sanity import of vpp-api/sanity vpp run before running tests (default: yes)"
        @echo " TEST=<filter>        - filter the set of tests:"
        @echo "    by file-name      - only run tests from specified file, e.g. TEST=test_bfd selects all tests from test_bfd.py"
        @echo "    by file-suffix    - same as file-name, but 'test_' is omitted e.g. TEST=bfd selects all tests from test_bfd.py"