From 5584a69747aa5f1b01210855e43f3c2d37149b1d Mon Sep 17 00:00:00 2001 From: Hossam <74155898+hossam1522@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:22:13 +0200 Subject: [PATCH 1/5] Changed agent start from install test to registration test --- deployability/modules/testing/tests/helpers/agent.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/deployability/modules/testing/tests/helpers/agent.py b/deployability/modules/testing/tests/helpers/agent.py index 671303cadc..c82f0aecd0 100644 --- a/deployability/modules/testing/tests/helpers/agent.py +++ b/deployability/modules/testing/tests/helpers/agent.py @@ -62,7 +62,6 @@ def install_agent(inventory_path, agent_name, wazuh_version, wazuh_revision, liv system_commands = [ "systemctl daemon-reload", "systemctl enable wazuh-agent", - "systemctl start wazuh-agent", "systemctl status wazuh-agent" ] @@ -78,7 +77,6 @@ def install_agent(inventory_path, agent_name, wazuh_version, wazuh_revision, liv f"WAZUH_AGENT_NAME='{agent_name}' " f"WAZUH_REGISTRATION_SERVER='MANAGER_IP' " ]) - commands.extend(["NET START WazuhSvc"]) elif os_type == 'macos': if architecture == 'amd64': @@ -90,7 +88,6 @@ def install_agent(inventory_path, agent_name, wazuh_version, wazuh_revision, liv f'curl -so wazuh-agent.pkg https://{s3_url}.wazuh.com/{release}/macos/wazuh-agent-{wazuh_version}-1.arm64.pkg && echo "WAZUH_MANAGER=\'MANAGER_IP\' && WAZUH_AGENT_NAME=\'{agent_name}\'" > /tmp/wazuh_envs && sudo installer -pkg ./wazuh-agent.pkg -target /' ]) system_commands = [ - '/Library/Ossec/bin/wazuh-control start', '/Library/Ossec/bin/wazuh-control status' ] commands.extend(system_commands) @@ -124,7 +121,8 @@ def register_agent(inventory_path, manager_path): host_ip = HostInformation.get_internal_ip_from_aws_dns(manager_host) if 'amazonaws' in manager_host else manager_host commands = [ f"sed -i 's/
MANAGER_IP<\/address>/
{host_ip}<\/address>/g' {WAZUH_CONF}", - "systemctl restart wazuh-agent" + "systemctl start wazuh-agent", + "systemctl status wazuh-agent" ] ConnectionManager.execute_commands(inventory_path, commands) except Exception as e: @@ -141,7 +139,8 @@ def register_agent(inventory_path, manager_path): host_ip = HostInformation.get_public_ip_from_aws_dns(manager_host) commands = [ f"sed -i '.bak' 's/
MANAGER_IP<\/address>/
{host_ip}<\/address>/g' {WAZUH_MACOS_CONF}", - "/Library/Ossec/bin/wazuh-control restart" + "/Library/Ossec/bin/wazuh-control start", + "/Library/Ossec/bin/wazuh-control status" ] ConnectionManager.execute_commands(inventory_path, commands) except Exception as e: From 4edd88ecf9692f220ba34a5549a41e9ccb282c0f Mon Sep 17 00:00:00 2001 From: Hossam El Amraoui <74155898+hossam1522@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:06:31 +0200 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e95492f44..4b0d679239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## [4.10.0] - TBD +### Fixed + +- Changed wazuh-agent service start from install test to registration test ([#5762](https://github.com/wazuh/wazuh-qa/pull/5762)) \- (Tests) + ## [4.9.1] - TBD ### Added From 315d815910dd15968bd7a07b9b2f7ba57e6e024c Mon Sep 17 00:00:00 2001 From: Hossam El Amraoui <74155898+hossam1522@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:47:53 +0200 Subject: [PATCH 3/5] Update agent.py --- deployability/modules/testing/tests/helpers/agent.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/deployability/modules/testing/tests/helpers/agent.py b/deployability/modules/testing/tests/helpers/agent.py index c82f0aecd0..56c883139b 100644 --- a/deployability/modules/testing/tests/helpers/agent.py +++ b/deployability/modules/testing/tests/helpers/agent.py @@ -61,8 +61,7 @@ def install_agent(inventory_path, agent_name, wazuh_version, wazuh_revision, liv ]) system_commands = [ "systemctl daemon-reload", - "systemctl enable wazuh-agent", - "systemctl status wazuh-agent" + "systemctl enable wazuh-agent" ] commands.extend(system_commands) @@ -87,10 +86,6 @@ def install_agent(inventory_path, agent_name, wazuh_version, wazuh_revision, liv commands.extend([ f'curl -so wazuh-agent.pkg https://{s3_url}.wazuh.com/{release}/macos/wazuh-agent-{wazuh_version}-1.arm64.pkg && echo "WAZUH_MANAGER=\'MANAGER_IP\' && WAZUH_AGENT_NAME=\'{agent_name}\'" > /tmp/wazuh_envs && sudo installer -pkg ./wazuh-agent.pkg -target /' ]) - system_commands = [ - '/Library/Ossec/bin/wazuh-control status' - ] - commands.extend(system_commands) logger.info(f'Installing Agent in {HostInformation.get_os_name_and_version_from_inventory(inventory_path)}') ConnectionManager.execute_commands(inventory_path, commands) From ad8be105b74b2174411dee40125365cbba6d7686 Mon Sep 17 00:00:00 2001 From: Hossam El Amraoui <74155898+hossam1522@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:41:50 +0200 Subject: [PATCH 4/5] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com> --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fcc669750..15ffba38ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ All notable changes to this project will be documented in this file. - Fix E2E VD tests not working if the Python version is different to 3.9 ([#5787](https://github.com/wazuh/wazuh-qa/pull/5787)) \- (Framework) - Fix failed to disable wazuh-manager.service ([#5775])(https://github.com/wazuh/wazuh-qa/pull/5775)) \- (Tests) - ## [4.9.1] - TBD ### Added From ec22da98a155326f463b07873bf256a1ebad1d46 Mon Sep 17 00:00:00 2001 From: Hossam El Amraoui <74155898+hossam1522@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:45:27 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julia Magán <80041853+juliamagan@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15ffba38ee..f6120db779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. - Changed wazuh-agent service start from install test to registration test ([#5762](https://github.com/wazuh/wazuh-qa/pull/5762)) \- (Tests) - Fix E2E VD tests not working if the Python version is different to 3.9 ([#5787](https://github.com/wazuh/wazuh-qa/pull/5787)) \- (Framework) -- Fix failed to disable wazuh-manager.service ([#5775])(https://github.com/wazuh/wazuh-qa/pull/5775)) \- (Tests) +- Fix failed to disable wazuh-manager.service ([#5775](https://github.com/wazuh/wazuh-qa/pull/5775)) \- (Tests) ## [4.9.1] - TBD