From 5582a5f3808a8680b84c8a2787334612ee57e2e6 Mon Sep 17 00:00:00 2001 From: Dylane Bengono Date: Thu, 12 Sep 2024 15:39:50 +0100 Subject: [PATCH] Refactor Snort test for macOS --- scripts/tests/test_macos.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/tests/test_macos.py b/scripts/tests/test_macos.py index e6eaac0..f5dcc19 100644 --- a/scripts/tests/test_macos.py +++ b/scripts/tests/test_macos.py @@ -17,31 +17,27 @@ def test_snort_is_installed_mac(host): snort = host.package("snort") assert snort.is_installed, "Snort should be installed" - def test_snort_conf_file_exists_mac(host): """Test if snort.lua file exists on macOS.""" snort_conf = host.file("/usr/local/etc/snort/snort.lua") assert snort_conf.exists, "snort.lua file should exist" - def test_snort_interface_configuration_mac(host): """Test if the network interface is correctly configured in the Snort configuration file on macOS.""" interface = host.run("ip route | grep default | awk '{print $5}'").stdout.strip() - - # Read the snort configuration file snort_conf = host.file("/usr/local/etc/snort/snort.lua") assert interface in snort_conf.content_string, "Interface should be present in snort.lua" - def test_update_ossec_conf_mac(host): """Test if ossec.conf is correctly updated on macOS.""" - ossec_conf_path = "/usr/local/etc/ossec.conf" + ossec_conf_path = "/opt/homebrew/etc/ossec.conf" expected_content = """ snort-full - /usr/local/var/log/snort/snort.alert.fast - """ + /var/log/snort/alert_fast.txt + + """ ossec_conf = host.file(ossec_conf_path) assert (