aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-08-24 02:06:31 +0000
committerRob Austein <sra@hactrn.net>2012-08-24 02:06:31 +0000
commit59156463f514a64989c60623d9173a2b0a4ede44 (patch)
tree536024fb9921d487ca13f1707bf82dd54363e9ac
parent33f3a4bffd14d0f339127a82c5c4e9f6c132a561 (diff)
Cleanup, add timestamps.
svn path=/branches/tk274/; revision=4659
-rw-r--r--rpkid/tests/yamlconf.py46
-rw-r--r--rpkid/tests/yamltest.py14
2 files changed, 31 insertions, 29 deletions
diff --git a/rpkid/tests/yamlconf.py b/rpkid/tests/yamlconf.py
index fd91cd4b..bd538f80 100644
--- a/rpkid/tests/yamlconf.py
+++ b/rpkid/tests/yamlconf.py
@@ -456,6 +456,20 @@ class allocation(object):
os.makedirs(path)
+class timestamp(object):
+
+ def __init__(self, *args):
+ self.count = 0
+ self.start = self.tick = rpki.sundial.now()
+
+ def __call__(self, *args):
+ now = rpki.sundial.now()
+ print "[Count %s last %s total %s now %s]" % (
+ self.count, now - self.tick, now - self.start, now)
+ self.tick = now
+ self.count += 1
+
+
def main():
global flat_publication
@@ -532,6 +546,8 @@ def body():
global rpki
+ ts = timestamp()
+
for root, dirs, files in os.walk(test_dir, topdown = False):
for file in files:
os.unlink(os.path.join(root, file))
@@ -547,6 +563,9 @@ def body():
#db.dump()
+ # Perhaps we want to do something with plain old MySQLdb as MySQL
+ # root to create databases before dragging Django code into this?
+
# Fun with multiple databases in Django!
# https://docs.djangoproject.com/en/1.4/topics/db/multi-db/
@@ -564,27 +583,7 @@ def body():
dict(database_template, NAME = d.irdb_name))
for d in db if not d.is_hosted)
- # Django seems really desperate for a default database, even though
- # we have no intention of using it. Eventually, we may just let it
- # have, eg, a default entry pointing to the root IRDB to satisfy
- # this, but for now, we just waste an engine number so we can be
- # sure anything written to the other databases was done on purpose.
-
- if False:
- databases["default"] = dict(database_template,
- NAME = "thisdatabasedoesnotexist",
- USER = "thisusernamedoesnotexist",
- PASSWORD = "thispasswordisinvalid")
-
- elif False:
- databases["default"] = dict(database_template,
- NAME = "irdb%d" % allocation.allocate_engine())
-
- else:
- databases["default"] = databases[db.root.irdb_name]
-
- # Perhaps we want to do something with plain old MySQLdb as MySQL
- # root to create databases before dragging Django code into this?
+ databases["default"] = databases[db.root.irdb_name]
from django.conf import settings
@@ -595,6 +594,8 @@ def body():
import rpki.irdb
+ ts()
+
for d in db:
print
print "Configuring", d.name
@@ -638,6 +639,7 @@ def body():
with d.irdb:
d.zoo.write_bpki_files()
+ ts()
+
if __name__ == "__main__":
main()
-
diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py
index 8e54dad7..89a0c63d 100644
--- a/rpkid/tests/yamltest.py
+++ b/rpkid/tests/yamltest.py
@@ -655,16 +655,16 @@ try:
for d in db:
- print
- print "Running daemons for", d.name
- if d.is_root:
- progs.append(d.run_rootd())
if not d.is_hosted:
+ print
+ print "Running daemons for", d.name
+ if d.is_root:
+ progs.append(d.run_rootd())
progs.append(d.run_irdbd())
progs.append(d.run_rpkid())
- if d.runs_pubd:
- progs.append(d.run_pubd())
- progs.append(d.run_rsyncd())
+ if d.runs_pubd:
+ progs.append(d.run_pubd())
+ progs.append(d.run_rsyncd())
print
print "Giving daemons time to start up"