mcp-agent mode for mcp-checker with web-info and REST API
New:
- agent index page serving on 0.0.0.0:8765
- REST API with modular approach to modules
- 'fio' module working via thread-safe Thread able to return
real-time info on its status
- 'fio' module scheduled run option
- ability to preserve multiple testrun results while active
- dockerfile for agent image
Fixed:
- Network report fixes to work on Kube envs
- Fixed function for running commands inside daemonset pods
Related-PROD: PROD-36669
Change-Id: I57e73001247af9187680bfc5744590eef219d93c
diff --git a/cfg_checker/modules/network/__init__.py b/cfg_checker/modules/network/__init__.py
index a99fa9e..736be50 100644
--- a/cfg_checker/modules/network/__init__.py
+++ b/cfg_checker/modules/network/__init__.py
@@ -69,6 +69,14 @@
help="HTML filename to save report"
)
+ net_report_parser.add_argument(
+ '--skip-ifs',
+ metavar='skip_ifs', default="docker",
+ help="String with keywords to skip networks which has interfaces "
+ "names with keywords as substrings. Example: 'eno' keyword will "
+ "cause to skip interface named 'eno1np0'. Example: 'docker'"
+ )
+
net_ping_parser = net_subparsers.add_parser(
'ping',
help="Ping all nodes with each other using network CIDR"
@@ -149,13 +157,22 @@
# Network Report
# Check if there is supported env found
_env = args_utils.check_supported_env(
- [ENV_TYPE_SALT],
+ [ENV_TYPE_SALT, ENV_TYPE_KUBE],
args,
config
)
# Start command
logger_cli.info("# Network report (check, node map)")
+ _skip_ifs_keywords = []
+ for _str in args.skip_ifs.split(","):
+ _skip_ifs_keywords.append(_str)
+ logger_cli.info(
+ "-> Interface keywords skip list is '{}'".format(
+ ", ".join(_skip_ifs_keywords)
+ )
+ )
+
_filename = args_utils.get_arg(args, 'html')
_skip, _skip_file = args_utils.get_skip_args(args)
_class = _selectClass(_env)
@@ -164,7 +181,7 @@
skip_list=_skip,
skip_list_file=_skip_file
)
- netChecker.check_networks(map=False)
+ netChecker.check_networks(skip_keywords=_skip_ifs_keywords, map=False)
# save what was collected
netChecker.errors.save_iteration_data()
diff --git a/cfg_checker/modules/network/mapper.py b/cfg_checker/modules/network/mapper.py
index 875f633..dea7d4e 100644
--- a/cfg_checker/modules/network/mapper.py
+++ b/cfg_checker/modules/network/mapper.py
@@ -798,10 +798,11 @@
_daemonset = self.get_daemonset()
logger_cli.info("-> Running script on daemonset")
# exec script on all pods in daemonset
- _result = self.master.execute_script_on_daemon_set(
+ _result = self.master.execute_cmd_on_daemon_set(
_daemonset,
script,
- args=args
+ args=args,
+ is_script=True
)
# delete daemonset