Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions framework/test_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3

"""Wrapper for the TestRun that simplifies
virtual testing procedure by allowing direct calling
from the command line.
Expand All @@ -16,11 +15,15 @@

LOGGER = logger.get_logger("runner")


class TestRunner:
"""Controls and starts the Test Run application."""

def __init__(self, config_file=None, validate=True,
net_only=False, single_intf=False):
def __init__(self,
config_file=None,
validate=True,
net_only=False,
single_intf=False):
self._register_exits()
self.test_run = TestRun(config_file=config_file,
validate=validate,
Expand Down Expand Up @@ -50,22 +53,34 @@ def start(self):
self.test_run.start()
LOGGER.info("Test Run has finished")

def parse_args(argv):
parser = argparse.ArgumentParser(description="Test Run",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-f", "--config-file", default=None,
help="Define the configuration file for Test Run and Network Orchestrator")
parser.add_argument("--no-validate", action="store_true",
help="Turn off the validation of the network after network boot")
parser.add_argument("-net", "--net-only", action="store_true",
help="Run the network only, do not run tests")
parser.add_argument("--single-intf", action="store_true",
help="Single interface mode (experimental)")

def parse_args():
parser = argparse.ArgumentParser(
description="Test Run",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"-f",
"--config-file",
default=None,
help="Define the configuration file for Test Run and Network Orchestrator"
)
parser.add_argument(
"--no-validate",
action="store_true",
help="Turn off the validation of the network after network boot")
parser.add_argument("-net",
"--net-only",
action="store_true",
help="Run the network only, do not run tests")
parser.add_argument("--single-intf",
action="store_true",
help="Single interface mode (experimental)")
parsed_args = parser.parse_known_args()[0]
return parsed_args


if __name__ == "__main__":
args = parse_args(sys.argv)
args = parse_args()
runner = TestRunner(config_file=args.config_file,
validate=not args.no_validate,
net_only=args.net_only,
Expand Down
307 changes: 0 additions & 307 deletions net_orc/network/modules/ntp/ntp-server.py

This file was deleted.

9 changes: 4 additions & 5 deletions net_orc/network/modules/ovs/python/src/logger.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/usr/bin/env python3

"""Sets up the logger to be used for the ovs modules."""
import logging

LOGGERS = {}
_LOG_FORMAT = "%(asctime)s %(name)-8s %(levelname)-7s %(message)s"
_LOG_FORMAT = '%(asctime)s %(name)-8s %(levelname)-7s %(message)s'
_DATE_FORMAT = '%b %02d %H:%M:%S'

# Set level to debug if set as runtime flag
logging.basicConfig(format=_LOG_FORMAT,
datefmt=_DATE_FORMAT,
logging.basicConfig(format=_LOG_FORMAT,
datefmt=_DATE_FORMAT,
level=logging.INFO)

def get_logger(name):
Expand Down
Loading