aboutsummaryrefslogtreecommitdiff
path: root/rpkid/tests/smoketest.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-10-25 20:33:49 +0000
committerRob Austein <sra@hactrn.net>2012-10-25 20:33:49 +0000
commit43d1e930f42d985012eaa769e854273d6a314342 (patch)
tree356350bf711886b03f6e521b4c98d5dc752b0d98 /rpkid/tests/smoketest.py
parentb03c819ec96938832d9a5e9acb857aa495d20348 (diff)
Add direct conversion of datetime (and subclasses) timestamps to
ASN1_TIME, so we can stop mucking about with this conversion in the Python code. svn path=/branches/tk274/; revision=4789
Diffstat (limited to 'rpkid/tests/smoketest.py')
-rw-r--r--rpkid/tests/smoketest.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py
index 07ad4d0e..4bc6e715 100644
--- a/rpkid/tests/smoketest.py
+++ b/rpkid/tests/smoketest.py
@@ -340,13 +340,14 @@ def main():
(pubd_process, "pubd"),
(rsyncd_process, "rsyncd")):
# pylint: disable=E1103
- if proc is not None:
+ if proc is not None and proc.poll() is None:
rpki.log.info("Killing %s, pid %s" % (name, proc.pid))
try:
- os.kill(proc.pid, signal.SIGTERM)
+ proc.terminate()
except OSError:
pass
- proc.wait()
+ if proc is not None:
+ rpki.log.info("Daemon %s, pid %s exited with code %s" % (name, proc.pid, proc.wait()))
def cmd_sleep(cb, interval):
"""
@@ -486,6 +487,8 @@ class allocation(object):
crl_interval = None
regen_margin = None
last_cms_time = None
+ rpkid_process = None
+ irdbd_process = None
def __init__(self, yaml, db, parent = None):
"""
@@ -798,17 +801,17 @@ class allocation(object):
Kill daemons for this entity.
"""
# pylint: disable=E1103
- rpki.log.info("Killing daemons for %s" % self.name)
- try:
- for proc in (self.rpkid_process, self.irdbd_process):
+ for proc, name in ((self.rpkid_process, "rpkid"),
+ (self.irdbd_process, "irdbd")):
+ if proc is not None and proc.poll() is None:
+ rpki.log.info("Killing daemon %s pid %s for %s" % (name, proc.pid, self.name))
try:
- rpki.log.info("Killing pid %d" % proc.pid)
- os.kill(proc.pid, signal.SIGTERM)
+ proc.terminate()
except OSError:
pass
- proc.wait()
- except AttributeError:
- pass
+ if proc is not None:
+ rpki.log.info("Daemon %s pid %s for %s exited with code %s" % (
+ name, proc.pid, self.name, proc.wait()))
def call_rpkid(self, pdus, cb):
"""