diff --git a/README.md b/README.md index a3a020d..c3d5e79 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,7 @@ that should be excluded from the execution; if both include and exclude match a test, the test will not be run * `-n|--no-delete` - do not delete the resources after run (**NOTICE**: you will have to manually delete both containers and networks) +* `-x|--no-trace` - do not trace call * `-v|--version` - prints the current version ### Scenarios diff --git a/sipssert/controller.py b/sipssert/controller.py index 05f2e0a..8c6b39c 100644 --- a/sipssert/controller.py +++ b/sipssert/controller.py @@ -52,6 +52,7 @@ def __init__(self, args): tests_filters.ParseTestsFilters(exclude_filters)) self.logs_dir = args.logs_dir self.no_delete = args.no_delete + self.no_trace = args.no_trace current_date = datetime.now().strftime("%Y-%m-%d.%H:%M:%S.%f") self.run_logs_dir = os.path.join(self.logs_dir, current_date) self.link_file = os.path.join(self.logs_dir, "latest") diff --git a/sipssert/main.py b/sipssert/main.py index 1fb3fff..d041b87 100644 --- a/sipssert/main.py +++ b/sipssert/main.py @@ -61,6 +61,11 @@ default=False, action='store_true') +arg_parser.add_argument('-x', '--no-trace', + help='Do not trace call', + default=False, + action='store_true') + arg_parser.add_argument('-v', '--version', action='version', help='Returns the version of the tool', diff --git a/sipssert/scenario.py b/sipssert/scenario.py index 4923b1a..1ac7398 100644 --- a/sipssert/scenario.py +++ b/sipssert/scenario.py @@ -55,7 +55,9 @@ def __init__(self, scenario_file, controller, test_set, set_logs_dir, set_defaul nets = self.networks if self.networks else [] if self.network: nets.append(self.network) - self.tracer = tracer.Tracer(self.scen_logs_dir, "capture", nets, self.name) + self.no_trace = self.controller.no_trace + if not self.no_trace: + self.tracer = tracer.Tracer(self.scen_logs_dir, "capture", nets, self.name) self.timeout = self.config.get("timeout", 0) container_prefix = f"{test_set.name}/{self.name}" self.tasks = tasks_list.TasksList("tasks", self.dirname, self.scen_logs_dir, @@ -81,7 +83,8 @@ def run(self): """Runs a scenario with all its prerequisits""" start_time = time.time() self.tlogger.test_start(self.name) - self.tracer.start() + if not self.no_trace: + self.tracer.start() try: self.init_tasks.run() try: @@ -94,7 +97,8 @@ def run(self): self.cleanup_tasks.run(force_all=True) except Exception: logger.slog.exception("Error occured during cleanup task") - self.tracer.stop() + if not self.no_trace: + self.tracer.stop() logger.slog.debug("scenario executed in {:.3f}s".format(time.time() - start_time)) self.tlogger.status(self.tasks.status)