diff options
author | Rob Austein <sra@hactrn.net> | 2012-06-16 22:13:17 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2012-06-16 22:13:17 +0000 |
commit | a590075c9225dce5695571ec27204aab3c2bb671 (patch) | |
tree | 48e600caeafcd2d7a0e81823fda0e205e8c2b045 /rpkid/tests | |
parent | 6f020d4066f9f2cbe31d47573468052923b5ab7f (diff) |
Add "--flat_publication" option to yamltest, and corresponding
"--flat" option to rpkic configure_publication_client. These are for
testing and simulation, do not use them in production.
svn path=/trunk/; revision=4545
Diffstat (limited to 'rpkid/tests')
-rw-r--r-- | rpkid/tests/yamltest.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py index 12fd7f85..acac876b 100644 --- a/rpkid/tests/yamltest.py +++ b/rpkid/tests/yamltest.py @@ -352,9 +352,10 @@ class allocation(object): """ path = [] s = self - while not s.runs_pubd: - path.append(s) - s = s.parent + if not flat_publication: + while not s.runs_pubd: + path.append(s) + s = s.parent path.append(s) return ".".join(i.name for i in reversed(path)) @@ -430,7 +431,8 @@ class allocation(object): """ Run rpkic for this entity. """ - cmd = (prog_rpkic, "-i", self.name, "-c", self.path("rpki.conf")) + args + cmd = [prog_rpkic, "-i", self.name, "-c", self.path("rpki.conf")] + cmd.extend(a for a in args if a is not None) print 'Running "%s"' % " ".join(cmd) subprocess.check_call(cmd, cwd = self.host.path()) @@ -488,14 +490,17 @@ cfg_file = None pidfile = None keep_going = False skip_config = False +flat_publication = False -opts, argv = getopt.getopt(sys.argv[1:], "c:hkp:s?", ["config=", "help", "keep_going", "pidfile=", "skip_config"]) +opts, argv = getopt.getopt(sys.argv[1:], "c:fhkp:s?", ["config=", "flat_publication", "help", "keep_going", "pidfile=", "skip_config"]) for o, a in opts: if o in ("-h", "--help", "-?"): print __doc__ sys.exit(0) if o in ("-c", "--config"): cfg_file = a + elif o in ("-f", "--flat_publication"): + flat_publication = True elif o in ("-k", "--keep_going"): keep_going = True elif o in ("-p", "--pidfile"): @@ -646,6 +651,7 @@ try: if d.is_root: assert not d.is_hosted d.run_rpkic("configure_publication_client", + "--flat" if flat_publication else None, d.path("%s.%s.repository-request.xml" % (d.name, d.name))) print d.run_rpkic("configure_repository", @@ -658,6 +664,7 @@ try: d.parent.path("%s.%s.parent-response.xml" % (d.parent.name, d.name))) print d.pubd.run_rpkic("configure_publication_client", + "--flat" if flat_publication else None, d.path("%s.%s.repository-request.xml" % (d.name, d.parent.name))) print d.run_rpkic("configure_repository", |