-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.py
56 lines (40 loc) · 1.32 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import argparse
from pathlib import Path
from ktoolbox import common
from testConfig import TestConfig
from testConfig import ConfigDescriptor
from trafficFlowTests import TrafficFlowTests
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="test Traffic Flows in an OVN-Kubernetes cluster."
)
parser.add_argument(
"config",
metavar="config",
type=str,
help="Yaml file with test configuration (see config.yaml)",
)
parser.add_argument(
"evaluator_config",
nargs="?",
metavar="evaluator_config",
type=str,
help="Yaml file with configuration for scoring test results (see eval-config.yaml)",
)
common.log_argparse_add_argument_verbosity(parser)
args = parser.parse_args()
common.log_config_logger(args.verbosity, "tft", "ktoolbox")
if not Path(args.config).exists():
raise ValueError("Must provide a valid config.yaml file (see config.yaml)")
return args
def main() -> None:
args = parse_args()
tc = TestConfig(
config_path=args.config,
evaluator_config=args.evaluator_config,
)
tft = TrafficFlowTests()
for cfg_descr in ConfigDescriptor(tc).describe_all_tft():
tft.test_run(cfg_descr)
if __name__ == "__main__":
main()