]> arthur.barton.de Git - bup.git/commitdiff
wvtest.py: respect BUP_TEST_SEED
authorRob Browning <rlb@defaultvalue.org>
Sat, 14 Nov 2020 17:28:50 +0000 (11:28 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 26 Nov 2020 21:53:09 +0000 (15:53 -0600)
Without this, the test counts can vary given (for example) the
tests in validate_vfs_{streaming,seeking}* in tvfs.py.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
wvtest.py

index 8451b3e45378d0055f11534f321eebc657e70706..0f284bfc9314b617ae058dee097989880c8659d3 100755 (executable)
--- a/wvtest.py
+++ b/wvtest.py
@@ -14,10 +14,17 @@ exec "$bup_python" "$0" ${1+"$@"}
 #
 
 from __future__ import absolute_import, print_function
+
+import os
+import random
+
+_wvtest_random_seed = os.environ.get('BUP_TEST_SEED')
+if _wvtest_random_seed:
+    random.seed(int(_wvtest_random_seed))
+
 from os.path import relpath
 import atexit
 import inspect
-import os
 import re
 import sys
 import traceback