summaryrefslogtreecommitdiffstats
path: root/test/run_tests.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-07-03 08:38:38 -0400
committerNeale Ranns <nranns@cisco.com>2019-07-09 07:16:16 +0000
commit0cbc71d783b9ad385e3d9efba181b75e37265318 (patch)
tree598afa71c693f616381dd21cf10e298a0363647e /test/run_tests.py
parenta089ae1294c8a49555fd95a905e2caa04cb7f900 (diff)
tests: treat all truthy env vars the same way
Introduce a new class, that returns the truthiness of a env var. Since an environment variable is just a string, it would normally be true if not unset. The new class returns true when the env var is set to a string that would be considered true. Type: test Depends-on: https://gerrit.fd.io/r/20484 Change-Id: I90ef010156f6fec246bde5c0e208ced1869b180f Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/run_tests.py')
-rw-r--r--test/run_tests.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/run_tests.py b/test/run_tests.py
index 58ca7d53e39..aee05c65157 100644
--- a/test/run_tests.py
+++ b/test/run_tests.py
@@ -14,6 +14,7 @@ import re
from multiprocessing import Process, Pipe, cpu_count
from multiprocessing.queues import Queue
from multiprocessing.managers import BaseManager
+import framework
from framework import VppTestRunner, running_extended_tests, VppTestCase, \
get_testcase_doc_name, get_test_description, PASS, FAIL, ERROR, SKIP, \
TEST_RUN
@@ -729,12 +730,10 @@ if __name__ == '__main__':
debug = os.getenv("DEBUG", "n").lower() in ["gdb", "gdbserver"]
debug_core = os.getenv("DEBUG", "").lower() == "core"
- compress_core = os.getenv("CORE_COMPRESS", "").lower() in ("y", "yes", "1")
+ compress_core = framework.BoolEnvironmentVariable("CORE_COMPRESS")
- step = os.getenv("STEP", "n").lower() in ("y", "yes", "1")
-
- force_foreground = os.getenv("FORCE_FOREGROUND", "").lower() in \
- ("y", "yes", "1")
+ step = framework.BoolEnvironmentVariable("STEP")
+ force_foreground = framework.BoolEnvironmentVariable("FORCE_FOREGROUND")
run_interactive = debug or step or force_foreground