bicep_utils.tests package¶
Submodules¶
bicep_utils.tests.test_general_utilities module¶
- async app.bicep_utils.tests.test_general_utilities.test_create_and_activate_network_interface(mock_execute_command)[source]¶
- async app.bicep_utils.tests.test_general_utilities.test_mirror_network_traffic_to_interface(mock_execute_command)[source]¶
bicep_utils.tests.test_model module¶
- class app.bicep_utils.tests.test_model.MockIDS(container_id: int = None, container_name: str = None, ensemble_id: int = None, pids: list[int] = [], dataset_id: int = None, static_analysis_running: bool = False, send_alerts_periodically_task=None, tap_interface_name: str = None, background_tasks: set = {})[source]¶
Bases:
IDSBase- async configure(file_path)[source]¶
Configures the IDS with the provided configuration file. E.g. placing the configuration in the correct location.
- Parameters:
file_path (str) – Path to the configuration file.
- Returns:
str – Confirmation message.
- async configure_ruleset(file_path)[source]¶
Configures the IDS ruleset with the provided file. If not ruleset is required for the IDS, simply return a confirmation message saying so.
- Parameters:
file_path (str) – Path to the ruleset file.
- Returns:
str – Confirmation message.
- async execute_network_analysis_command()[source]¶
Method that takes all actions necessary to execute the IDS command for a network analysis on the self.tap_interface.
- Returns:
int – Process ID of the spawned IDS process.
- async app.bicep_utils.tests.test_model.test_finish_static_analysis_in_background(mock_tell_core, mock_send_alerts, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_send_alerts_to_core(mock_post, mock_get_env_variable, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_send_alerts_to_core_ensemble(mock_post, mock_get_env_variable, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_send_alerts_to_core_periodically(mock_post, mock_get_env_variable, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_send_alerts_to_core_periodically_ensemble(mock_post, mock_get_env_variable, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_send_alerts_to_core_periodically_exception(mock_post, mock_get_env_variable, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_start_network_analysis(mock_mirror, mock_create_interface, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_start_static_analysis(mock_wait_for_process, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_start_static_analysis_if_no_other_analysis_task_running_in_background(mock_wait_for_process, tell_core_has_finished_mock, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_stop_all_processes(mock_stop_process, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_stop_all_processes_without_process_numbers(mock_stop_process, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_stop_network_analysis(mock_tell_core, mock_stop_all, mock_remove_interface, mock_ids: MockIDS)[source]¶
- async app.bicep_utils.tests.test_model.test_stop_static_analysis(mock_tell_core, mock_stop_all, mock_ids: MockIDS)[source]¶
bicep_utils.tests.test_routes module¶
- async app.bicep_utils.tests.test_routes.test_static_analysis(copy_mock, save_file_mock, mock_ids)[source]¶