diff options
author | Klement Sekera <ksekera@cisco.com> | 2019-11-05 11:18:25 +0000 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-11-18 13:17:57 +0000 |
commit | fc000f0e1d61a9361e364a8f757e416fad7883b7 (patch) | |
tree | c579b945cd990f477d9c55c66c24893da6205e1a /test/run_tests.py | |
parent | 329c884aa27398523377736f51a2694ec2c4820d (diff) |
tests: support setting random seed
Log the random seed used when running tests and provide means to re-use
it in a later run.
Type: feature
Change-Id: I18d2a36ee802b901d4cca5577df41cec07f09cc0
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 45a95dd782b91e9ae5665b5f95be4b6d7f99b879)
Diffstat (limited to 'test/run_tests.py')
-rw-r--r-- | test/run_tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/run_tests.py b/test/run_tests.py index c9c5bdb8a6e..8b9ff907296 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -732,6 +732,11 @@ def parse_digit_env(env_var, default): 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 |