diff options
-rw-r--r-- | myrpki/yamltest.py | 5 | ||||
-rw-r--r-- | rpkid/testbed.clean.sql | 1 | ||||
-rw-r--r-- | rpkid/testbed.py | 20 | ||||
-rw-r--r-- | rpkid/testbed.setup.sql | 4 |
4 files changed, 16 insertions, 14 deletions
diff --git a/myrpki/yamltest.py b/myrpki/yamltest.py index cd951af1..9e349a0f 100644 --- a/myrpki/yamltest.py +++ b/myrpki/yamltest.py @@ -442,7 +442,10 @@ class allocation(object): m = section_regexp.match(line) if m: section = m.group(1) - if section is None or (self.is_hosted() and section in ("myirbe", "rpkid", "irdbd", "pubd", "rootd", "rootd_x509_extensions")): + if (section is None or + (self.is_hosted() and section in ("myirbe", "rpkid", "irdbd")) or + (not self.runs_pubd() and section == "pubd") or + (not self.is_root() and section in ("rootd", "rootd_x509_extensions"))): continue m = variable_regexp.match(line) if m is None else None variable = m.group(1) if m else None diff --git a/rpkid/testbed.clean.sql b/rpkid/testbed.clean.sql index baa5289f..583824ef 100644 --- a/rpkid/testbed.clean.sql +++ b/rpkid/testbed.clean.sql @@ -40,7 +40,6 @@ DROP DATABASE IF EXISTS rpki8; DROP DATABASE IF EXISTS rpki9; DROP DATABASE IF EXISTS rpki10; DROP DATABASE IF EXISTS rpki11; -DROP DATABASE IF EXISTS pubd; DROP DATABASE IF EXISTS pubd0; DROP DATABASE IF EXISTS pubd1; DROP DATABASE IF EXISTS pubd2; diff --git a/rpkid/testbed.py b/rpkid/testbed.py index 966ce29c..a9e6e3c5 100644 --- a/rpkid/testbed.py +++ b/rpkid/testbed.py @@ -106,6 +106,8 @@ testbed_dir = cfg.get("testbed_dir", testbed_name + ".dir") irdb_db_pass = cfg.get("irdb_db_pass", "fnord") rpki_db_pass = cfg.get("rpki_db_pass", "fnord") pubd_db_pass = cfg.get("pubd_db_pass", "fnord") +pubd_db_name = cfg.get("pubd_db_name", "pubd0") +pubd_db_user = cfg.get("pubd_db_user", "pubd") base_port = int(cfg.get("base_port", "4400")) @@ -1135,16 +1137,18 @@ def setup_publication(pubd_sql): global rsyncd_dir rsyncd_dir = pubd_dir.rstrip("/") + rootd_sia[i:] os.makedirs(rsyncd_dir) - db = MySQLdb.connect(user = "pubd", db = "pubd", passwd = pubd_db_pass) + db = MySQLdb.connect(db = pubd_db_name, user = pubd_db_user, passwd = pubd_db_pass) cur = db.cursor() db.autocommit(True) for sql in pubd_sql: cur.execute(sql) db.close() - d = { "pubd_name" : pubd_name, - "pubd_port" : pubd_port, - "pubd_pass" : pubd_db_pass, - "pubd_dir" : pubd_dir } + d = { "pubd_name" : pubd_name, + "pubd_port" : pubd_port, + "pubd_db_name" : pubd_db_name, + "pubd_db_user" : pubd_db_user, + "pubd_db_pass" : pubd_db_pass, + "pubd_dir" : pubd_dir } f = open(pubd_name + ".conf", "w") f.write(pubd_fmt_1 % d) f.close() @@ -1458,9 +1462,9 @@ comment = RPKI test pubd_fmt_1 = '''\ [pubd] -sql-database = %(pubd_name)s -sql-username = pubd -sql-password = %(pubd_pass)s +sql-database = %(pubd_db_name)s +sql-username = %(pubd_db_user)s +sql-password = %(pubd_db_pass)s bpki-ta = %(pubd_name)s-TA.cer pubd-cert = %(pubd_name)s-PUBD.cer pubd-key = %(pubd_name)s-PUBD.key diff --git a/rpkid/testbed.setup.sql b/rpkid/testbed.setup.sql index c5689fa5..929b3772 100644 --- a/rpkid/testbed.setup.sql +++ b/rpkid/testbed.setup.sql @@ -30,8 +30,6 @@ CREATE DATABASE rpki9; CREATE DATABASE rpki10; CREATE DATABASE rpki11; -CREATE DATABASE pubd; - CREATE DATABASE pubd0; CREATE DATABASE pubd1; CREATE DATABASE pubd2; @@ -71,8 +69,6 @@ GRANT ALL ON rpki9.* TO rpki@localhost IDENTIFIED BY 'fnord'; GRANT ALL ON rpki10.* TO rpki@localhost IDENTIFIED BY 'fnord'; GRANT ALL ON rpki11.* TO rpki@localhost IDENTIFIED BY 'fnord'; -GRANT ALL ON pubd.* TO pubd@localhost IDENTIFIED BY 'fnord'; - GRANT ALL ON pubd0.* TO pubd@localhost IDENTIFIED BY 'fnord'; GRANT ALL ON pubd1.* TO pubd@localhost IDENTIFIED BY 'fnord'; GRANT ALL ON pubd2.* TO pubd@localhost IDENTIFIED BY 'fnord'; |