Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multigroups guess system test #5396

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ All notable changes to this project will be documented in this file.

### Fixed

- Fix multigroups guess system test ([#5396](https:/wazuh/wazuh-qa/pull/5396)) \- (Tests)
- Fix restart agent in change manager Vulnerability Detector E2E test case ([#5355](https:/wazuh/wazuh-qa/pull/5355)) \- (Tests)
- Fix E2E Vulnerability Detection Windows package installation error ([#5363](https:/wazuh/wazuh-qa/pull/5363)) \- (Framework)
- Fix shutdown messages system test ([#5298](https:/wazuh/wazuh-qa/pull/5298)) \- (Framework + Tests)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from system import (ERR_MSG_CLIENT_KEYS_IN_MASTER_NOT_FOUND, check_agent_groups, check_keys_file,
create_new_agent_group, delete_agent_group, remove_cluster_agents,
assign_agent_to_new_group, restart_cluster)
from wazuh_testing import T_10, T_20
from wazuh_testing.tools.system import HostManager
from wazuh_testing.tools.file import replace_regex_in_file
from wazuh_testing.tools.system_monitoring import HostMonitor
Expand All @@ -73,8 +74,6 @@
# Variables
group_id = 'group_test'
multigroups_id = 'default,group_test'
# this timeout is temporality, this test will be update
timeout = 20


# Fixtures
Expand Down Expand Up @@ -135,7 +134,7 @@ def test_guess_single_group(target_node, status_guess_agent_group, clean_environ
'''
# Restart master to apply local internal options
restart_cluster([test_infra_managers[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Create new group
create_new_agent_group(test_infra_managers[0], group_id, host_manager)
Expand All @@ -156,7 +155,7 @@ def test_guess_single_group(target_node, status_guess_agent_group, clean_environ
# Remove agent from default to test single group guess (not multigroup)
host_manager.run_command(test_infra_managers[0], f"/var/ossec/bin/agent_groups -q -r -i {agent_id} -g default")

time.sleep(timeout)
time.sleep(T_20)

# Check that agent has group set to group_test on Managers
check_agent_groups(agent_id, group_id, test_infra_managers, host_manager)
Expand All @@ -173,7 +172,7 @@ def test_guess_single_group(target_node, status_guess_agent_group, clean_environ

# Restart agent
restart_cluster([test_infra_agents[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Check if remoted.guess_agent_group is disabled
expected_group = 'default' if int(status_guess_agent_group) == 0 else group_id
Expand Down Expand Up @@ -228,7 +227,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea
'''
# Restart master to apply local internal options
restart_cluster([test_infra_managers[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Create new group
create_new_agent_group(test_infra_managers[0], group_id, host_manager)
Expand All @@ -241,6 +240,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea

# Restart agent
restart_cluster(test_infra_agents, host_manager)
time.sleep(T_10)

# Check that agent has client key file
for agent in range(n_agents):
Expand All @@ -250,7 +250,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea
# Create new group and assing agent
for agent in range(n_agents):
assign_agent_to_new_group(test_infra_managers[0], group_id, agents_data[agent][1], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Check that agent has group set to group_test on Managers
for agent in range(n_agents):
Expand All @@ -268,7 +268,7 @@ def test_guess_multigroups(n_agents, target_node, status_guess_agent_group, clea

# Restart agent
restart_cluster([test_infra_agents[0]], host_manager)
time.sleep(timeout)
time.sleep(T_20)

# Check if remoted.guess_agent_group is disabled
expected_group = 'default' if int(status_guess_agent_group) == 0 or n_agents == 1 else multigroups_id
Expand Down
Loading