make test: add make test-shell[-debug] targets 87/5687/2
authorKlement Sekera <ksekera@cisco.com>
Thu, 9 Mar 2017 07:01:52 +0000 (08:01 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Thu, 9 Mar 2017 20:06:58 +0000 (20:06 +0000)
This starts a bash with the same environment as the test framework
uses, allowing easy debugging.

Change-Id: I956deda913b73dae5b1e1976417834ae4731f88a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Makefile
test/Makefile

index 7faba3b..f0173cc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,8 @@ help:
        @echo " test-debug          - build and run (basic) functional tests (debug build)"
        @echo " test-all            - build and run (all) functional tests"
        @echo " test-all-debug      - build and run (all) functional tests (debug build)"
+       @echo " test-shell          - enter shell with test environment"
+       @echo " test-shell-debug    - enter shell with test environment (debug build)"
        @echo " test-wipe           - wipe files generated by unit tests"
        @echo " retest              - run functional tests"
        @echo " retest-debug        - run functional tests (debug build)"
@@ -247,6 +249,12 @@ test-help:
 test-wipe:
        @make -C test wipe
 
+test-shell: bootstrap
+       $(call test,vpp_lite,vpp_lite,shell)
+
+test-shell-debug: bootstrap
+       $(call test,vpp_lite,vpp_lite_debug,shell)
+
 test-doc:
        @make -C test doc
 
index 1bb3c6c..0214980 100644 (file)
@@ -68,6 +68,17 @@ test: verify-python-path verify-no-running-vpp reset $(PAPI_INSTALL_DONE)
 retest: verify-python-path verify-no-running-vpp 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 </dev/tty" | bash -i
+
 .PHONY: wipe doc
 
 reset:
@@ -126,6 +137,8 @@ help:
        @echo " retest              - run functional tests"
        @echo " retest-debug        - run functional tests (debug build)"
        @echo " test-wipe           - wipe (temporary) files generated by unit tests"
+       @echo " test-shell          - enter shell with test environment"
+       @echo " test-shell-debug    - enter shell with test environment (debug build)"
        @echo ""
        @echo "Arguments controlling test runs:"
        @echo " V=[0|1|2]            - set test verbosity level"