aboutsummaryrefslogtreecommitdiff
path: root/ca/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ca/tests')
-rw-r--r--ca/tests/smoketest.py7
-rw-r--r--ca/tests/testpoke.py2
-rw-r--r--ca/tests/yamlconf.py6
-rwxr-xr-xca/tests/yamltest.py13
4 files changed, 18 insertions, 10 deletions
diff --git a/ca/tests/smoketest.py b/ca/tests/smoketest.py
index 6479883e..2bce936b 100644
--- a/ca/tests/smoketest.py
+++ b/ca/tests/smoketest.py
@@ -158,8 +158,11 @@ def main():
Main program.
"""
- rpki.log.init(smoketest_name, argparse.Namespace(log_level = logging.DEBUG,
- log_handler = lambda: logging.StreamHandler(sys.stdout)))
+ log_handler = logging.StreamHandler(sys.stdout)
+ log_handler.setFormatter(rpki.config.Formatter("smoketest", log_handler, logging.DEBUG))
+ logging.getLogger().addHandler(log_handler)
+ logging.getLogger().setLevel(logging.DEBUG)
+
logger.info("Starting")
rpki.http.http_client.timeout = rpki.sundial.timedelta(hours = 1)
diff --git a/ca/tests/testpoke.py b/ca/tests/testpoke.py
index 60cc5690..7ebe7d44 100644
--- a/ca/tests/testpoke.py
+++ b/ca/tests/testpoke.py
@@ -51,8 +51,6 @@ parser.add_argument("-d", "--debug",
help = "enable debugging")
args = parser.parse_args()
-rpki.log.init("testpoke")
-
yaml_data = yaml.load(args.yaml)
yaml_cmd = args.request
diff --git a/ca/tests/yamlconf.py b/ca/tests/yamlconf.py
index 2963a61f..db368320 100644
--- a/ca/tests/yamlconf.py
+++ b/ca/tests/yamlconf.py
@@ -670,8 +670,10 @@ def main():
quiet = args.quiet
yaml_file = args.yaml_file
- rpki.log.init("yamlconf", argparse.Namespace(log_level = logging.DEBUG,
- log_handler = lambda: logging.StreamHandler(sys.stdout)))
+ log_handler = logging.StreamHandler(sys.stdout)
+ log_handler.setFormatter(rpki.config.Formatter("yamlconf", log_handler, logging.DEBUG))
+ logging.getLogger().addHandler(log_handler)
+ logging.getLogger().setLevel(logging.DEBUG)
# Allow optional config file for this tool to override default
# passwords: this is mostly so that I can show a complete working
diff --git a/ca/tests/yamltest.py b/ca/tests/yamltest.py
index d467384a..c2959dc9 100755
--- a/ca/tests/yamltest.py
+++ b/ca/tests/yamltest.py
@@ -54,6 +54,7 @@ import rpki.log
import rpki.csv_utils
import rpki.x509
import rpki.relaxng
+import rpki.config
# pylint: disable=W0621
@@ -673,8 +674,10 @@ class allocation(object):
"""
basename = os.path.splitext(os.path.basename(prog))[0]
- cmd = [prog, "--foreground", "--log-level", "debug",
- "--log-file", self.path(basename + ".log")]
+ cmd = [prog, "--foreground",
+ "--log-level", "debug",
+ "--log-destination", "file",
+ "--log-filename", self.path(basename + ".log")]
if args.profile:
cmd.extend((
"--profile", self.path(basename + ".prof")))
@@ -831,8 +834,10 @@ try:
print "Writing pidfile", f.name
f.write("%s\n" % os.getpid())
- rpki.log.init("yamltest", argparse.Namespace(log_level = logging.DEBUG,
- log_handler = lambda: logging.StreamHandler(sys.stdout)))
+ log_handler = logging.StreamHandler(sys.stdout)
+ log_handler.setFormatter(rpki.config.Formatter("yamltest", log_handler, logging.DEBUG))
+ logging.getLogger().addHandler(log_handler)
+ logging.getLogger().setLevel(logging.DEBUG)
allocation.base_port = args.base_port