Skip to content

Commit

Permalink
Refactor code structure + fix pip package issue (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcaiazzi committed Oct 17, 2024
1 parent bb6bc7c commit 0fa1f85
Show file tree
Hide file tree
Showing 42 changed files with 58 additions and 58 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The Kathará Lab Checker takes in input a configuration file specifying the test
To run the tool you only need to run the `main.py` passing the desired configuration file.

```bash
python3 -m kathara-lab-checker --config <path-to-the-configuration-file>
python3 -m kathara_lab_checker --config <path-to-the-configuration-file> --labs <path-to-the-labs-directory>
```

At this point, the tool parses the provided configuration file and executes the tests. For each network scenario the
Expand All @@ -47,7 +47,7 @@ The repository already provide a complete example with the results of the tests.
You can re-run the example by typing the following command in the root directory of the project:

```bash
python3 -m kathara-lab-checker --config examples/configuration_palabra.json --no-cache
python3 -m kathara_lab_checker --config examples/palabra/configuration_palabra.json --no-cache --labs examples/palabra/labs
```

The `--no-cache` flag force to repeat already executed tests.
Expand Down
Binary file modified examples/palabra/labs/lab1/lab1_result.xlsx
Binary file not shown.
Binary file modified examples/palabra/labs/lab2/lab2_result.xlsx
Binary file not shown.
Binary file modified examples/palabra/labs/lab3/lab3_result.xlsx
Binary file not shown.
Binary file modified examples/palabra/labs/lab4/lab4_result.xlsx
Binary file not shown.
Binary file modified examples/palabra/labs/results.xlsx
Binary file not shown.
Binary file removed examples/palabra/results.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
]

[project.scripts]
kathara-lab-checker = "main:main"
kathara-lab-checker = "kathara_lab_checker:main"

[project.urls]
"Bug Reports" = "https://github.com/KatharaFramework/kathara-lab-checker/issues"
Expand Down
46 changes: 23 additions & 23 deletions src/main.py → src/kathara_lab_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
from Kathara.setting.Setting import Setting
from tqdm import tqdm

from kathara_lab_checker.TestCollector import TestCollector
from kathara_lab_checker.checks.BridgeCheck import BridgeCheck
from kathara_lab_checker.checks.CollisionDomainCheck import CollisionDomainCheck
from kathara_lab_checker.checks.CustomCommandCheck import CustomCommandCheck
from kathara_lab_checker.checks.DaemonCheck import DaemonCheck
from kathara_lab_checker.checks.DeviceExistenceCheck import DeviceExistenceCheck
from kathara_lab_checker.checks.IPv6EnabledCheck import IPv6EnabledCheck
from kathara_lab_checker.checks.InterfaceIPCheck import InterfaceIPCheck
from kathara_lab_checker.checks.KernelRouteCheck import KernelRouteCheck
from kathara_lab_checker.checks.ReachabilityCheck import ReachabilityCheck
from kathara_lab_checker.checks.StartupExistenceCheck import StartupExistenceCheck
from kathara_lab_checker.checks.SysctlCheck import SysctlCheck
from kathara_lab_checker.checks.applications.dns.DNSAuthorityCheck import DNSAuthorityCheck
from kathara_lab_checker.checks.applications.dns.DNSRecordCheck import DNSRecordCheck
from kathara_lab_checker.checks.applications.dns.LocalNSCheck import LocalNSCheck
from kathara_lab_checker.checks.protocols.AnnouncedNetworkCheck import AnnouncedNetworkCheck
from kathara_lab_checker.checks.protocols.ProtocolRedistributionCheck import ProtocolRedistributionCheck
from kathara_lab_checker.checks.protocols.bgp.BGPPeeringCheck import BGPPeeringCheck
from kathara_lab_checker.checks.protocols.evpn.AnnouncedVNICheck import AnnouncedVNICheck
from kathara_lab_checker.checks.protocols.evpn.EVPNSessionCheck import EVPNSessionCheck
from kathara_lab_checker.checks.protocols.evpn.VTEPCheck import VTEPCheck
from kathara_lab_checker.excel_utils import write_final_results_to_excel, write_result_to_excel
from kathara_lab_checker.utils import reverse_dictionary
from lab_checker.TestCollector import TestCollector
from lab_checker.checks.BridgeCheck import BridgeCheck
from lab_checker.checks.CollisionDomainCheck import CollisionDomainCheck
from lab_checker.checks.CustomCommandCheck import CustomCommandCheck
from lab_checker.checks.DaemonCheck import DaemonCheck
from lab_checker.checks.DeviceExistenceCheck import DeviceExistenceCheck
from lab_checker.checks.IPv6EnabledCheck import IPv6EnabledCheck
from lab_checker.checks.InterfaceIPCheck import InterfaceIPCheck
from lab_checker.checks.KernelRouteCheck import KernelRouteCheck
from lab_checker.checks.ReachabilityCheck import ReachabilityCheck
from lab_checker.checks.StartupExistenceCheck import StartupExistenceCheck
from lab_checker.checks.SysctlCheck import SysctlCheck
from lab_checker.checks.applications.dns.DNSAuthorityCheck import DNSAuthorityCheck
from lab_checker.checks.applications.dns.DNSRecordCheck import DNSRecordCheck
from lab_checker.checks.applications.dns.LocalNSCheck import LocalNSCheck
from lab_checker.checks.protocols.AnnouncedNetworkCheck import AnnouncedNetworkCheck
from lab_checker.checks.protocols.ProtocolRedistributionCheck import ProtocolRedistributionCheck
from lab_checker.checks.protocols.bgp.BGPPeeringCheck import BGPPeeringCheck
from lab_checker.checks.protocols.evpn.AnnouncedVNICheck import AnnouncedVNICheck
from lab_checker.checks.protocols.evpn.EVPNSessionCheck import EVPNSessionCheck
from lab_checker.checks.protocols.evpn.VTEPCheck import VTEPCheck
from lab_checker.excel_utils import write_final_results_to_excel, write_result_to_excel
from lab_checker.utils import reverse_dictionary

VERSION = "0.1.3"
CURRENT_LAB: Optional[Lab] = None
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.utils import get_output
from lab_checker.utils import get_output
from .AbstractCheck import AbstractCheck
from .CheckResult import CheckResult

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from kathara_lab_checker.utils import green, red
from lab_checker.utils import green, red


class CheckResult:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.utils import get_output
from lab_checker.utils import get_output
from .AbstractCheck import AbstractCheck
from .CheckResult import CheckResult

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from Kathara.exceptions import MachineNotRunningError
from Kathara.model.Lab import Lab

from kathara_lab_checker.utils import get_interfaces_addresses
from lab_checker.utils import get_interfaces_addresses
from .AbstractCheck import AbstractCheck
from .CheckResult import CheckResult

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.utils import get_output
from lab_checker.utils import get_output
from .AbstractCheck import AbstractCheck
from .CheckResult import CheckResult

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output, find_lines_with_string, find_device_name_from_ip
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output, find_lines_with_string, find_device_name_from_ip


class DNSAuthorityCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class DNSRecordCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class LocalNSCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class AnnouncedNetworkCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class ProtocolRedistributionCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class BGPPeeringCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class AnnouncedVNICheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class EVPNSessionCheck(AbstractCheck):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from Kathara.manager.Kathara import Kathara
from Kathara.model.Lab import Lab

from kathara_lab_checker.checks.AbstractCheck import AbstractCheck
from kathara_lab_checker.checks.CheckResult import CheckResult
from kathara_lab_checker.utils import get_output
from lab_checker.checks.AbstractCheck import AbstractCheck
from lab_checker.checks.CheckResult import CheckResult
from lab_checker.utils import get_output


class VTEPCheck(AbstractCheck):
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 0fa1f85

Please sign in to comment.