Type: test
Change-Id: I4c54121b76b341381a819cee928c3c2455a83503
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
libexpand = $(subst $(subst ,, ),:,$(foreach lib,$(1),$(BR)/install-$(2)-native/vpp/$(lib)/$(3)))
export TEST_DIR ?= $(WS_ROOT)/test
libexpand = $(subst $(subst ,, ),:,$(foreach lib,$(1),$(BR)/install-$(2)-native/vpp/$(lib)/$(3)))
export TEST_DIR ?= $(WS_ROOT)/test
+export RND_SEED ?= $(shell python3 -c 'import time; print(time.time())')
define test
$(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-install,)
define test
$(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-install,)
EXTENDED_TESTS=$(EXTENDED_TESTS) \
PYTHON=$(PYTHON) \
OS_ID=$(OS_ID) \
EXTENDED_TESTS=$(EXTENDED_TESTS) \
PYTHON=$(PYTHON) \
OS_ID=$(OS_ID) \
CACHE_OUTPUT=$(CACHE_OUTPUT) \
$(3)
endef
CACHE_OUTPUT=$(CACHE_OUTPUT) \
$(3)
endef
@echo "source $(VENV_PATH)/bin/activate;\
cd $(BUILD_TEST_SRC);\
export PYTHONPATH=$(BUILD_TEST_SRC);\
@echo "source $(VENV_PATH)/bin/activate;\
cd $(BUILD_TEST_SRC);\
export PYTHONPATH=$(BUILD_TEST_SRC);\
+ export RND_SEED=$(RND_SEED);\
echo '***';\
echo PYTHONPATH=$(BUILD_TEST_SRC);\
echo '***';\
echo PYTHONPATH=$(BUILD_TEST_SRC);\
+ echo RND_SEED=$(RND_SEED);\
echo VPP_BUILD_DIR=$(VPP_BUILD_DIR);\
echo VPP_BIN=$(VPP_BIN);\
echo VPP_PLUGIN_PATH=$(VPP_PLUGIN_PATH);\
echo VPP_BUILD_DIR=$(VPP_BUILD_DIR);\
echo VPP_BIN=$(VPP_BIN);\
echo VPP_PLUGIN_PATH=$(VPP_PLUGIN_PATH);\
+ @classmethod
+ def _debug_quit(cls):
+ if (cls.debug_gdbserver or cls.debug_gdb):
+ try:
+ cls.vpp.poll()
+
+ if cls.vpp.returncode is None:
+ print()
+ print(double_line_delim)
+ print("VPP or GDB server is still running")
+ print(single_line_delim)
+ input("When done debugging, press ENTER to kill the "
+ "process and finish running the testcase...")
+ except AttributeError:
+ pass
+
@classmethod
def quit(cls):
"""
Disconnect vpp-api, kill vpp and cleanup shared memory files
"""
@classmethod
def quit(cls):
"""
Disconnect vpp-api, kill vpp and cleanup shared memory files
"""
- if (cls.debug_gdbserver or cls.debug_gdb) and hasattr(cls, 'vpp'):
- cls.vpp.poll()
- if cls.vpp.returncode is None:
- print()
- print(double_line_delim)
- print("VPP or GDB server is still running")
- print(single_line_delim)
- input("When done debugging, press ENTER to kill the "
- "process and finish running the testcase...")
# first signal that we want to stop the pump thread, then wake it up
if hasattr(cls, 'pump_thread_stop_flag'):
# first signal that we want to stop the pump thread, then wake it up
if hasattr(cls, 'pump_thread_stop_flag'):
cls.logger.debug("Waiting for pump thread to stop")
cls.pump_thread.join()
if hasattr(cls, 'vpp_stderr_reader_thread'):
cls.logger.debug("Waiting for pump thread to stop")
cls.pump_thread.join()
if hasattr(cls, 'vpp_stderr_reader_thread'):
- cls.logger.debug("Waiting for stdderr pump to stop")
+ cls.logger.debug("Waiting for stderr pump to stop")
cls.vpp_stderr_reader_thread.join()
if hasattr(cls, 'vpp'):
cls.vpp_stderr_reader_thread.join()
if hasattr(cls, 'vpp'):
if __name__ == '__main__':
if __name__ == '__main__':
- if "RND_SEED" not in os.environ:
- os.environ["RND_SEED"] = str(time.time())
- print("Setting RND_SEED=%s" % os.environ["RND_SEED"])
- else:
- print("Using provided RND_SEED=%s" % os.environ["RND_SEED"])
verbose = parse_digit_env("V", 0)
test_timeout = parse_digit_env("TIMEOUT", 600) # default = 10 minutes
verbose = parse_digit_env("V", 0)
test_timeout = parse_digit_env("TIMEOUT", 600) # default = 10 minutes
from __future__ import print_function
from multiprocessing import Pipe
from __future__ import print_function
from multiprocessing import Pipe
import os
from framework import VppDiedError, VppTestCase, KeepAliveReporter
import os
from framework import VppDiedError, VppTestCase, KeepAliveReporter
""" Sanity test case - verify whether VPP is able to start """
pass
""" Sanity test case - verify whether VPP is able to start """
pass
+ # don't ask to debug SanityTestCase
+ @classmethod
+ def wait_for_enter(cls, pid=0):
+ pass
+
+ @classmethod
+ def _debug_quit(cls):
+ try:
+ cls.vpp.poll()
+ except AttributeError:
+ pass
+
if __name__ == '__main__':
if __name__ == '__main__':
- os.environ["RND_SEED"] = "1"
rc = 0
tc = SanityTestCase
x, y = Pipe()
rc = 0
tc = SanityTestCase
x, y = Pipe()
else:
try:
tc.tearDownClass()
else:
try:
tc.tearDownClass()
+ except Exception:
+ rc = -1
x.close()
y.close()
if rc == 0:
x.close()
y.close()
if rc == 0:
- print('Sanity test case passed\n')
+ print('Sanity test case passed.\n')
- print('Sanity test case failed\n')
+ print('Sanity test case failed.\n')