X-Git-Url: http://git.ipfire.org/?p=nitsi.git;a=blobdiff_plain;f=src%2Fnitsi%2Ftest.py;h=ecbe5f059795731ab1151520b655eefdcc2c6d96;hp=0ddcdab5d4205c32056f454213b0f6d711ce0f96;hb=fc35cba132d7f8e993cf7d4d6880092dd8ca4bbd;hpb=2fa4467d63fa5da14ee0415dcb6d1f4802197f93 diff --git a/src/nitsi/test.py b/src/nitsi/test.py index 0ddcdab..ecbe5f0 100755 --- a/src/nitsi/test.py +++ b/src/nitsi/test.py @@ -7,6 +7,8 @@ import os import configparser +import time + from nitsi.virtual_environ import virtual_environ from nitsi.recipe import recipe @@ -15,7 +17,7 @@ import logging logger = logging.getLogger("nitsi.test") class test(): - def __init__(self, path): + def __init__(self, path, log_path): try: self.path = os.path.abspath(path) self.log = logger.getChild(os.path.basename(self.path)) @@ -24,6 +26,8 @@ class test(): self.log.debug("Path of this test is: {}".format(self.path)) + self.log_path = log_path + self.settings_file = "{}/settings".format(self.path) if not os.path.isfile(self.settings_file): self.log.error("No such file: {}".format(self.settings_file)) @@ -71,10 +75,18 @@ class test(): self.virtual_machines[name].copy_in(self.copy_from, self.copy_to) self.virtual_machines[name].start() + # Time to which all serial output log entries are relativ + log_start_time = time.time() + + # Number of chars of the longest machine name + longest_machine_name = self.virtual_environ.longest_machine_name + self.log.debug("Try to login on all machines") for name in self.virtual_environ.machine_names: self.log.debug("Try to login on {}".format(name)) - self.virtual_machines[name].login() + self.virtual_machines[name].login("{}/test.log".format(self.log_path), + log_start_time=log_start_time, + longest_machine_name=longest_machine_name) def load_recipe(self): self.log.info("Going to load the recipe")