aboutsummaryrefslogtreecommitdiff
path: root/rpkid
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-10-16 02:58:36 +0000
committerRob Austein <sra@hactrn.net>2008-10-16 02:58:36 +0000
commitf1be919fbb6f780012ea55e5fd599852571999f3 (patch)
treec17cd0cc8847ddb90caf5f46b14b1f9ed3ac0109 /rpkid
parent5955ada37f18ad5dc1a482abf6451db1535d259f (diff)
Minor logging cleanups. Don't show backtrace in testpoke unless
debugging. "valid_until" -> "valid_for" in test suite. svn path=/rpkid/rpki/rpki_engine.py; revision=2021
Diffstat (limited to 'rpkid')
-rw-r--r--rpkid/rpki/rpki_engine.py6
-rw-r--r--rpkid/rpki/up_down.py2
-rw-r--r--rpkid/testbed.2.yaml4
-rw-r--r--rpkid/testbed.4.yaml28
-rw-r--r--rpkid/testpoke.py8
5 files changed, 42 insertions, 6 deletions
diff --git a/rpkid/rpki/rpki_engine.py b/rpkid/rpki/rpki_engine.py
index bff417d3..416163ae 100644
--- a/rpkid/rpki/rpki_engine.py
+++ b/rpkid/rpki/rpki_engine.py
@@ -231,7 +231,8 @@ class ca_obj(rpki.sql.sql_persistant):
ski = ca_detail.latest_ca_cert.get_SKI()
if ski not in cert_map:
- rpki.log.warn("Certificate in database missing from list_response, SKI %s, this should never happen" % ca_detail.latest_ca_cert.gSKI())
+ rpki.log.warn("Certificate in database missing from list_response, class %s, SKI %s, maybe parent certificate went away?"
+ % (repr(rc.class_name), ca_detail.latest_ca_cert.gSKI()))
ca_detail.delete(self, parent.repository())
continue
@@ -251,7 +252,8 @@ class ca_obj(rpki.sql.sql_persistant):
del cert_map[ski]
if cert_map:
- rpki.log.warn("Certificates in list_response missing from our database, SKIs %s" % ", ".join(c.cert.gSKI() for c in cert_map.values()))
+ rpki.log.warn("Certificates in list_response missing from our database, class %s, SKIs %s"
+ % (repr(rc.class_name), ", ".join(c.cert.gSKI() for c in cert_map.values())))
@classmethod
def create(cls, parent, rc):
diff --git a/rpkid/rpki/up_down.py b/rpkid/rpki/up_down.py
index a10c4c07..30085390 100644
--- a/rpkid/rpki/up_down.py
+++ b/rpkid/rpki/up_down.py
@@ -281,7 +281,7 @@ class issue_pdu(base_elt):
ca = child.ca_from_class_name(self.class_name)
ca_detail = ca.fetch_active()
if ca_detail is None:
- raise rpki.exceptions.NoActiveCA, "No active CA for class %s" % self.class_name
+ raise rpki.exceptions.NoActiveCA, "No active CA for class %s" % repr(self.class_name)
# Check current cert, if any
diff --git a/rpkid/testbed.2.yaml b/rpkid/testbed.2.yaml
index 9a99b3de..368b1b00 100644
--- a/rpkid/testbed.2.yaml
+++ b/rpkid/testbed.2.yaml
@@ -15,7 +15,7 @@
# PERFORMANCE OF THIS SOFTWARE.
name: RIR
-valid_until: 2008-09-14T12:30:00Z
+valid_for: 2d
kids:
- name: R0
kids:
@@ -89,4 +89,4 @@ kids:
sub_as: 33
---
- name: Alice
- valid_until: 2009-07-14T12:30:00Z
+ valid_for: 1y
diff --git a/rpkid/testbed.4.yaml b/rpkid/testbed.4.yaml
new file mode 100644
index 00000000..ee447daa
--- /dev/null
+++ b/rpkid/testbed.4.yaml
@@ -0,0 +1,28 @@
+# $Id$
+
+# Copyright (C) 2007--2008 American Registry for Internet Numbers ("ARIN")
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+# This is a test of what happens when certificates go missing in action.
+
+name: RIR
+valid_for: -10
+kids:
+ - name: R0
+ kids:
+ - name: Alice
+ ipv4: 192.0.2.1-192.0.2.33
+ asn: 64533
+---
+---
diff --git a/rpkid/testpoke.py b/rpkid/testpoke.py
index 00f3bab8..04517ce4 100644
--- a/rpkid/testpoke.py
+++ b/rpkid/testpoke.py
@@ -138,4 +138,10 @@ https_cert = get_PEM("ssl-cert", rpki.x509.X509)
https_certs = get_PEM_chain("ssl-cert-chain", https_cert)
https_ca_certs = get_PEM_chain("ssl-ca-certs")
-dispatch[yaml_req["type"]]()
+if debug:
+ dispatch[yaml_req["type"]]()
+else:
+ try:
+ dispatch[yaml_req["type"]]()
+ except Exception, edata:
+ print "Failed:", edata