-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
137 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
path = panther/plugins/testers/panther_ivy | ||
url = [email protected]:ElNiak/PANTHER-Ivy.git | ||
[submodule "panther/plugins/testers/BinFuzz"] | ||
path = panther/plugins/testers/BinFuzz | ||
path = panther/plugins/testers/panther_binfuzz/ | ||
url = [email protected]:ElNiak/BinFuzz.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
panther/core/results/result_handlers/local_storage_handler.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
from core.results.result_handler import ResultHandler | ||
|
||
|
||
class LocalStorageHandler(ResultHandler): | ||
""" | ||
Concrete implementation of ResultHandler for storing results in a local database. | ||
Attributes: | ||
db (Database): The local database to store the results in. | ||
Methods: | ||
__init__(db: Database) -> None: | ||
Initializes the StorageHandler with the given local database. | ||
handle(request) -> None: | ||
Stores the request in the local database. | ||
""" | ||
|
||
def __init__(self, db) -> None: | ||
self.db = db | ||
|
||
def handle(self, request) -> None: | ||
self.db.store(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
from omegaconf import DictConfig | ||
from core.test_interface import ITestCase | ||
|
||
|
||
class TestCase(ITestCase): | ||
def __init__(self, test_config: DictConfig, logger: logging.Logger): | ||
super().__init__(test_config, logger) | ||
|
||
def run(self): | ||
"""Runs the test case based on the provided configuration.""" | ||
try: | ||
self.logger.info(f"Starting test: {self.test_config.name}") | ||
self._run_services() | ||
self._execute_steps() | ||
self._validate_assertions() | ||
self.logger.info(f"Test '{self.test_config.name}' completed successfully.") | ||
except Exception as e: | ||
self.logger.error(f"Test '{self.test_config.name}' failed: {e}") | ||
raise | ||
|
||
def _run_services(self): | ||
"""Starts the services defined in the test configuration.""" | ||
# Placeholder for starting services logic, e.g., Docker containers | ||
self.logger.info("Services started.") | ||
|
||
def _execute_steps(self): | ||
"""Executes steps defined in the test configuration.""" | ||
# Placeholder for executing steps, such as waiting or recording | ||
self.logger.info("Test steps executed.") | ||
|
||
def _validate_assertions(self): | ||
"""Validates assertions defined in the test configuration.""" | ||
# Placeholder for validating assertions, such as service responsiveness | ||
self.logger.info("Assertions validated.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# PANTHER-SCP/panther/core/test_case_interface.py | ||
|
||
from abc import ABC, abstractmethod | ||
import logging | ||
|
||
class ITestCase(ABC): | ||
def __init__(self, logger: logging.Logger): | ||
self.logger = logger | ||
|
||
@abstractmethod | ||
def run(self): | ||
"""Runs the test case.""" | ||
pass | ||
|
||
@abstractmethod | ||
def run_services(self): | ||
"""Starts the services defined in the test configuration.""" | ||
pass | ||
|
||
@abstractmethod | ||
def execute_steps(self): | ||
"""Executes steps defined in the test configuration.""" | ||
pass | ||
|
||
@abstractmethod | ||
def validate_assertions(self): | ||
"""Validates assertions defined in the test configuration.""" | ||
pass |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""panther package. | ||
This package contains the panther application and its modules. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule panther_binfuzz
updated
from 000000 to 17e920