Skip to content

Commit 17c51b0

Browse files
authored
Merge pull request #15 from KatharaFramework/develop
Version 0.1.4
2 parents ab24778 + 4955189 commit 17c51b0

38 files changed

+104
-97
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ directory containing all the results for each network scenario, including the re
4040

4141
The repository already provide a complete example with the results of the tests.
4242

43-
- Check the test configuration by inspecting: [configuration_palabra.json](examples/palabra/configuration_palabra.json).
43+
- Check the test configuration by inspecting: [configuration_palabra.json](examples/palabra/correction.json).
4444
- Check the network topology and requisites: [palabra.pdf](examples/palabra/palabra.pdf)
4545
- Check final results summary: [results.xlsx](examples/palabra/results.xlsx)
4646

4747
You can re-run the example by typing the following command in the root directory of the project:
4848

4949
```bash
50-
python3 -m kathara_lab_checker --config examples/palabra/configuration_palabra.json --no-cache --labs examples/palabra/labs
50+
python3 -m kathara_lab_checker --config examples/palabra/correction.json --no-cache --labs examples/palabra/labs
5151
```
5252

5353
The `--no-cache` flag force to repeat already executed tests.

examples/palabra/configuration_palabra.json renamed to examples/palabra/correction.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"convergence_time": 10,
3-
"structure": "examples/palabra/palabra.conf",
3+
"structure": "examples/palabra/structure",
44
"default_image": "kathara/frr",
55
"test": {
66
"requiring_startup": [

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kathara-lab-checker"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
description = "Tool to automatically check Kathará network scenarios based on a configuration file."
55
readme = "README.md"
66
requires-python = ">=3.11"
@@ -33,7 +33,7 @@ dependencies = [
3333
]
3434

3535
[project.scripts]
36-
kathara-lab-checker = "kathara_lab_checker:main"
36+
kathara_lab_checker = "kathara_lab_checker.__main__:main"
3737

3838
[project.urls]
3939
"Bug Reports" = "https://github.com/KatharaFramework/kathara-lab-checker/issues"
File renamed without changes.
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,32 @@
1616
from Kathara.setting.Setting import Setting
1717
from tqdm import tqdm
1818

19-
from lab_checker.TestCollector import TestCollector
20-
from lab_checker.checks.BridgeCheck import BridgeCheck
21-
from lab_checker.checks.CollisionDomainCheck import CollisionDomainCheck
22-
from lab_checker.checks.CustomCommandCheck import CustomCommandCheck
23-
from lab_checker.checks.DaemonCheck import DaemonCheck
24-
from lab_checker.checks.DeviceExistenceCheck import DeviceExistenceCheck
25-
from lab_checker.checks.IPv6EnabledCheck import IPv6EnabledCheck
26-
from lab_checker.checks.InterfaceIPCheck import InterfaceIPCheck
27-
from lab_checker.checks.KernelRouteCheck import KernelRouteCheck
28-
from lab_checker.checks.ReachabilityCheck import ReachabilityCheck
29-
from lab_checker.checks.StartupExistenceCheck import StartupExistenceCheck
30-
from lab_checker.checks.SysctlCheck import SysctlCheck
31-
from lab_checker.checks.applications.dns.DNSAuthorityCheck import DNSAuthorityCheck
32-
from lab_checker.checks.applications.dns.DNSRecordCheck import DNSRecordCheck
33-
from lab_checker.checks.applications.dns.LocalNSCheck import LocalNSCheck
34-
from lab_checker.checks.protocols.AnnouncedNetworkCheck import AnnouncedNetworkCheck
35-
from lab_checker.checks.protocols.ProtocolRedistributionCheck import ProtocolRedistributionCheck
36-
from lab_checker.checks.protocols.bgp.BGPPeeringCheck import BGPPeeringCheck
37-
from lab_checker.checks.protocols.evpn.AnnouncedVNICheck import AnnouncedVNICheck
38-
from lab_checker.checks.protocols.evpn.EVPNSessionCheck import EVPNSessionCheck
39-
from lab_checker.checks.protocols.evpn.VTEPCheck import VTEPCheck
40-
from lab_checker.excel_utils import write_final_results_to_excel, write_result_to_excel
41-
from lab_checker.utils import reverse_dictionary
42-
43-
VERSION = "0.1.3"
19+
from kathara_lab_checker.TestCollector import TestCollector
20+
from kathara_lab_checker.checks.BridgeCheck import BridgeCheck
21+
from kathara_lab_checker.checks.CheckResult import CheckResult
22+
from kathara_lab_checker.checks.CollisionDomainCheck import CollisionDomainCheck
23+
from kathara_lab_checker.checks.CustomCommandCheck import CustomCommandCheck
24+
from kathara_lab_checker.checks.DaemonCheck import DaemonCheck
25+
from kathara_lab_checker.checks.DeviceExistenceCheck import DeviceExistenceCheck
26+
from kathara_lab_checker.checks.IPv6EnabledCheck import IPv6EnabledCheck
27+
from kathara_lab_checker.checks.InterfaceIPCheck import InterfaceIPCheck
28+
from kathara_lab_checker.checks.KernelRouteCheck import KernelRouteCheck
29+
from kathara_lab_checker.checks.ReachabilityCheck import ReachabilityCheck
30+
from kathara_lab_checker.checks.StartupExistenceCheck import StartupExistenceCheck
31+
from kathara_lab_checker.checks.SysctlCheck import SysctlCheck
32+
from kathara_lab_checker.checks.applications.dns.DNSAuthorityCheck import DNSAuthorityCheck
33+
from kathara_lab_checker.checks.applications.dns.DNSRecordCheck import DNSRecordCheck
34+
from kathara_lab_checker.checks.applications.dns.LocalNSCheck import LocalNSCheck
35+
from kathara_lab_checker.checks.protocols.AnnouncedNetworkCheck import AnnouncedNetworkCheck
36+
from kathara_lab_checker.checks.protocols.ProtocolRedistributionCheck import ProtocolRedistributionCheck
37+
from kathara_lab_checker.checks.protocols.bgp.BGPPeeringCheck import BGPPeeringCheck
38+
from kathara_lab_checker.checks.protocols.evpn.AnnouncedVNICheck import AnnouncedVNICheck
39+
from kathara_lab_checker.checks.protocols.evpn.EVPNSessionCheck import EVPNSessionCheck
40+
from kathara_lab_checker.checks.protocols.evpn.VTEPCheck import VTEPCheck
41+
from kathara_lab_checker.excel_utils import write_final_results_to_excel, write_result_to_excel
42+
from kathara_lab_checker.utils import reverse_dictionary
43+
44+
VERSION = "0.1.4"
4445
CURRENT_LAB: Optional[Lab] = None
4546

4647

@@ -87,10 +88,14 @@ def run_on_single_network_scenario(
8788
CURRENT_LAB = lab
8889
except IOError as e:
8990
logger.warning(f"{str(e)} Skipping directory")
90-
return
91+
check_results = [CheckResult("The lab.conf cannot be parsed", False, str(e))]
92+
test_collector.add_check_results(lab_name, check_results)
93+
return test_collector
9194
except MachineCollisionDomainError as e:
9295
logger.warning(f"{str(e)} Skipping directory")
93-
return
96+
check_results = [CheckResult("The lab.conf cannot be parsed", False, str(e))]
97+
test_collector.add_check_results(lab_name, check_results)
98+
return test_collector
9499

95100
if not live:
96101
logger.info(f"Undeploying network scenario in case it was running...")
@@ -279,7 +284,9 @@ def run_on_multiple_network_scenarios(
279284

280285
def parse_arguments():
281286
parser = argparse.ArgumentParser(
282-
description="A tool for automatically check Kathará network scenarios", add_help=True
287+
description="A tool for automatically check Kathará network scenarios",
288+
prog="kathara_lab_checker",
289+
add_help=True
283290
)
284291

285292
parser.add_argument(
@@ -362,7 +369,7 @@ def main():
362369
if not os.path.exists(conf["structure"]):
363370
logger.error(f"The structure file {conf['structure']} does not exist")
364371
exit(1)
365-
372+
366373
template_lab = LabParser().parse(
367374
os.path.dirname(conf["structure"]),
368375
conf_name=os.path.basename(conf["structure"]),
File renamed without changes.

src/lab_checker/checks/BridgeCheck.py renamed to src/kathara_lab_checker/checks/BridgeCheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from Kathara.manager.Kathara import Kathara
55
from Kathara.model.Lab import Lab
66

7-
from lab_checker.utils import get_output
7+
from kathara_lab_checker.utils import get_output
88
from .AbstractCheck import AbstractCheck
99
from .CheckResult import CheckResult
1010

0 commit comments

Comments
 (0)