aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-08-26 11:15:50 +0200
committerKarel Kočí <cynerd@email.cz>2015-08-26 11:32:06 +0200
commit8b0ebe5a478fae92a49f12b5ac6090ba9d15bcbb (patch)
tree3a5824e80e15909c50f842bded5f29cb037e1afc
parent0688647f2f69d1bee1ecc76338190e6a12209da5 (diff)
downloadlinux-conf-perf-8b0ebe5a478fae92a49f12b5ac6090ba9d15bcbb.tar.gz
linux-conf-perf-8b0ebe5a478fae92a49f12b5ac6090ba9d15bcbb.tar.bz2
linux-conf-perf-8b0ebe5a478fae92a49f12b5ac6090ba9d15bcbb.zip
Fix random configuration generator
Picosat is as default using 0 as seed for random generator. This lead on same configuration every time.
-rw-r--r--scripts/configurations.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/configurations.py b/scripts/configurations.py
index ed81ef2..aaf7ad0 100644
--- a/scripts/configurations.py
+++ b/scripts/configurations.py
@@ -5,6 +5,7 @@ import shutil
import subprocess
import time
import hashlib
+import struct
import utils
from conf import conf
@@ -203,7 +204,7 @@ def __generate_single__(var_num, conf_num):
def __generate_random__(var_num, conf_num):
tfile = __buildtempcnf__(var_num, (sf(conf.rules_file), sf(conf.fixed_file)), set())
try:
- confs = __exec_sat__(tfile, ['-i', '3'], conf_num)
+ confs = __exec_sat__(tfile, ['-i', '3', '-s', struct.unpack('<L', os.urandom(4))[0]], conf_num)
for con in confs:
if not __register_conf__(con, conf_num, 'random-sat'):
__generate_random__(var_num, conf_num)