aboutsummaryrefslogtreecommitdiff
path: root/rpkid/tests
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2011-10-05 17:45:34 +0000
committerRob Austein <sra@hactrn.net>2011-10-05 17:45:34 +0000
commitf7c79af8743b7142e438e5db0af960cf91938b23 (patch)
treece7c8521f681db0d45800f0231c0de596b27499a /rpkid/tests
parent72e42a6508ff19a315a0257dda4a710bc195dffa (diff)
Stop abusing RuntimeError. This closes #52.
svn path=/rpkid/portal-gui/scripts/load_csv.py; revision=4015
Diffstat (limited to 'rpkid/tests')
-rw-r--r--rpkid/tests/smoketest.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py
index 127e3f79..4c767409 100644
--- a/rpkid/tests/smoketest.py
+++ b/rpkid/tests/smoketest.py
@@ -146,6 +146,16 @@ pubd_irbe_key = None
pubd_irbe_cert = None
pubd_pubd_cert = None
+class CantRekeyYAMLLeaf(Exception):
+ """
+ Can't rekey YAML leaf.
+ """
+
+class CouldntIssueBSCEECertificate(Exception):
+ """
+ Couldn't issue BSC EE certificate
+ """
+
def main():
"""
Main program.
@@ -580,7 +590,7 @@ class allocation(object):
cb()
if self.is_leaf:
- raise RuntimeError, "Can't rekey YAML leaf %s, sorry" % self.name
+ raise CantRekeyYAMLLeaf, "Can't rekey YAML leaf %s, sorry" % self.name
elif target is None:
rpki.log.info("Rekeying <self/> %s" % self.name)
self.call_rpkid([rpki.left_right.self_elt.make_pdu(action = "set", self_handle = self.name, rekey = "yes")], cb = done)
@@ -983,7 +993,7 @@ class allocation(object):
signed = signer.communicate(input = b.pkcs10_request.get_PEM())
if not signed[0]:
rpki.log.warn(signed[1])
- raise RuntimeError, "Couldn't issue BSC EE certificate"
+ raise CouldntIssueBSCEECertificate, "Couldn't issue BSC EE certificate"
s.bsc_ee = rpki.x509.X509(PEM = signed[0])
s.bsc_crl = rpki.x509.CRL(PEM_file = s.name + "-SELF.crl")
rpki.log.info("BSC EE cert for %s SKI %s" % (s.name, s.bsc_ee.hSKI()))