diff options
-rw-r--r-- | scripts/testdb.py | 18 | ||||
-rw-r--r-- | scripts/testdb1.yaml | 3 |
2 files changed, 11 insertions, 10 deletions
diff --git a/scripts/testdb.py b/scripts/testdb.py index e60311a6..fee0339e 100644 --- a/scripts/testdb.py +++ b/scripts/testdb.py @@ -166,19 +166,17 @@ def wakeup(signum, frame): signal.signal(signal.SIGALRM, wakeup) -def cmd_pause(): - """Do nothing until a signal arrives.""" - rpki.log.info("Pausing indefinitely, send a SIGALRM to wake me up") - signal.pause() - -def cmd_sleep(seconds): +def cmd_sleep(seconds = None): """Set an alarm, then wait for it to go off.""" - rpki.log.info("Sleeping %s seconds" % seconds) - signal.alarm(int(seconds)) + + if seconds is None: + rpki.log.info("Pausing indefinitely, send a SIGALRM to wake me up") + else: + rpki.log.info("Sleeping %s seconds" % seconds) + signal.alarm(int(seconds)) signal.pause() -cmds = { "pause" : cmd_pause, - "sleep" : cmd_sleep } +cmds = { "sleep" : cmd_sleep } class allocation_db(list): diff --git a/scripts/testdb1.yaml b/scripts/testdb1.yaml index 17f3c199..c1379808 100644 --- a/scripts/testdb1.yaml +++ b/scripts/testdb1.yaml @@ -10,6 +10,9 @@ kids: ipv4: 192.0.2.1-192.0.2.33 asn: 64533 --- +- sleep +--- +- sleep 5 - name: Alice add_as: 33 valid_until: 2009-07-14T12:30:00Z |