@@ -38,9 +38,6 @@ import sugar
3838import traceback
3939from time import gmtime, strftime
4040
41- # Env variable used to run a single test
42- test_name = $TEST_NAME!'*'
43-
4441## HANDY UTILS AND GLOBAL VARS ##
4542SOCKET_PATH = '/tmp/bess_unix_'
4643SCRIPT_STARTTIME = strftime("%Y-%m-%d-%H-%M-%S", gmtime())
@@ -156,15 +153,19 @@ def monitor_task(module, wid):
156153def run_tests():
157154 DID_TESTS_FAIL = False
158155
159- path = os.path.dirname(os.path.realpath(sys.argv[0]))
156+ # Env variable used to run a subset of tests
157+ test_name = $TEST_NAME!'*'
158+
159+ default_path = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
160+ 'conf/testing/module_tests')
161+ test_path = $TEST_PATH!default_path
160162
161163 # Note: os.path.join will discard the leading parts if test
162164 # begins with '/', so callers should provide an absolute path
165+
163166 # if and only if they want to override the internal BESS
164167 # path prefixing.
165- for filename in glob.glob(os.path.join(path,
166- "conf/testing/module_tests",
167- test_name + ".py")):
168+ for filename in glob.glob(os.path.join(test_path, test_name + ".py")):
168169 bess.reset_all()
169170
170171 print("-- Running Module Tests for %s --" % filename.split("/")[-1])
0 commit comments