aboutsummaryrefslogtreecommitdiff
path: root/rpkid/tests
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2011-10-08 00:34:51 +0000
committerRob Austein <sra@hactrn.net>2011-10-08 00:34:51 +0000
commit1b0816c8a7a22639838c47cf3542b71dbcd09bd8 (patch)
tree2fdb8536dd28a4449a2b374890f591cc9556c01c /rpkid/tests
parente8f358b61a15348c0d3ea69bd8ed512fde3e8da9 (diff)
rcynic's new timestamped output directory code gets grumpy when rcynic
is run twice in less than a second. Granted that this shouldn't happen in the first place, but having seen it happen in testing when something else was broken, detect the problem and handle it by sleeping for one second if and only if necessary. svn path=/rpkid/tests/smoketest.py; revision=4029
Diffstat (limited to 'rpkid/tests')
-rw-r--r--rpkid/tests/smoketest.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py
index 4c767409..8145a0eb 100644
--- a/rpkid/tests/smoketest.py
+++ b/rpkid/tests/smoketest.py
@@ -1244,6 +1244,8 @@ def set_pubd_crl(cb):
call_pubd([rpki.publication.config_elt.make_pdu(action = "set", bpki_crl = rpki.x509.CRL(Auto_file = pubd_name + "-TA.crl"))],
cb = lambda ignored: cb())
+last_rcynic_run = None
+
def run_rcynic():
"""
Run rcynic to see whether what was published makes sense.
@@ -1251,8 +1253,12 @@ def run_rcynic():
rpki.log.info("Running rcynic")
env = os.environ.copy()
env["TZ"] = ""
+ global last_rcynic_run
+ if int(time.time()) == last_rcynic_run:
+ time.sleep(1)
subprocess.check_call((prog_rcynic, "-c", rcynic_name + ".conf"), env = env)
subprocess.call(rcynic_stats, shell = True, env = env)
+ last_rcynic_run = int(time.time())
def mangle_sql(filename):
"""