mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

For "individually different but deterministic" runs specifying Zeek's seed as an environment variable eases setups as one can avoid creating extra seed files for each of the individual processes. It is an error to specify the new ZEEK_SEED_VALUES variable together with the existing ZEEK_SEED_FILE and -G. ZEEK_SEED takes precedence over deterministic mode (-D) like ZEEK_SEED_FILE does today already.
16 lines
1,022 B
Text
16 lines
1,022 B
Text
# @TEST-DOC: Test specifying the same seeds via ZEEK_SEED
|
|
# @TEST-EXEC: seq 21 > random.seed
|
|
# @TEST-EXEC: echo "file does not exist" >> output
|
|
# @TEST-EXEC-FAIL: ZEEK_SEED_FILE=./does/not-exist zeek -b %INPUT >> output 2>&1
|
|
# @TEST-EXEC: echo "cannot use ZEEK_SEED_FILE and ZEEK_SEED" >> output
|
|
# @TEST-EXEC-FAIL: ZEEK_SEED_FILE=./does/not-exist ZEEK_SEED_VALUES="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" zeek -b %INPUT >> output 2>&1
|
|
# @TEST-EXEC: echo "cannot use -G and ZEEK_SEED" >> output
|
|
# @TEST-EXEC-FAIL: ZEEK_SEED_FILE= ZEEK_SEED_VALUES="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" zeek -G ./random.seed -b %INPUT >> output 2>&1
|
|
# @TEST-EXEC: echo "wrong format (1)" >> output
|
|
# @TEST-EXEC-FAIL: ZEEK_SEED_FILE= ZEEK_SEED_VALUES="a b c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" zeek -b %INPUT >> output 2>&1
|
|
# @TEST-EXEC: echo "wrong format (2)" >> output
|
|
# @TEST-EXEC-FAIL: ZEEK_SEED_FILE= ZEEK_SEED_VALUES="0 0 0" zeek -b %INPUT >> output 2>&1
|
|
|
|
# @TEST-EXEC: btest-diff output
|
|
|
|
print rand(500000), unique_id("C");
|