-
Notifications
You must be signed in to change notification settings - Fork 32
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
System Test: WAZUH-DB - 2507: agent with state different than never_connected is added to a "group_test" group by CLI #2652
System Test: WAZUH-DB - 2507: agent with state different than never_connected is added to a "group_test" group by CLI #2652
Conversation
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
@pytest.fixture(scope='function') | ||
def clean_environment(): | ||
|
||
clean_cluster_logs(test_infra_agents + test_infra_managers, host_manager) | ||
|
||
yield | ||
# Remove the agent once the test has finished | ||
remove_cluster_agents(test_infra_managers[0], test_infra_agents, host_manager) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it defined here and not the same aggregate method used in conftes.py?
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Dámaris <seyla.gomez@wazuh.com>
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_to_a_group.py
Outdated
Show resolved
Hide resolved
Tests Results
|
WAZUH_SERVICES_STOPPED = 'stopped' | ||
WAZUH_SERVICE_PREFIX = 'wazuh' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should define in the deps/wazuh_testing/wazuh_testing/modules/__init__.py
.
Remember that this file deps/wazuh_testing/wazuh_testing/wazuh_variables.py will remove in the future.
from system import (AGENT_NO_GROUPS, AGENT_STATUS_ACTIVE, AGENT_STATUS_DISCONNECTED, check_agent_groups, | ||
check_agent_status, restart_cluster, check_keys_file, assign_agent_to_new_group, | ||
delete_group_of_agents, ERR_MSG_CLIENT_KEYS_IN_MASTER_NOT_FOUND) | ||
from wazuh_testing.wazuh_variables import WAZUH_SERVICES_STOPPED, WAZUH_SERVICE_PREFIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from wazuh_testing.wazuh_variables import WAZUH_SERVICES_STOPPED, WAZUH_SERVICE_PREFIX | |
from wazuh_testing.modules import WAZUH_SERVICES_STOPPED, WAZUH_SERVICE_PREFIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WAZUH_SERVICE_PREFIX should define in the deps/wazuh_testing/wazuh_testing/modules/__init__.py
. Remember that this file deps/wazuh_testing/wazuh_testing/wazuh_variables.py will remove in the future.
Tests Results
|
Description
In this PR the test suite for
agent with state different than never_connected is added to a "Y" group by CLI
is added. A total of 4 new test cases covering different modes and combinations of options.Cases:
- The agent is active and connects with master is assigned to a group with CLI
- The agent is disconnected and connects with master is assigned to a group with CLI
- The agent is active and connects with worker is assigned to a group with CLI
- The agent is disconnected and connects with worker is assigned to a group with CLI
Configuration options
In order to run the test, first the environment located in
/test/system/provisioning/enrollment_cluster
must be enabled with:sudo ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"wazuh_branch": "dev-10771-agent-groups-files-to-wazuh-db"}'
Local Internal Options: No Local Internal Options used
Tests Results
Required
pycodestyle --max-line-length=120 --show-source --show-pep8 file.py
.