-
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: Module (WAZUH-DB) - Agent registered with group "group_test" (agent_authd - disconnected) #2654
System Test: Module (WAZUH-DB) - Agent registered with group "group_test" (agent_authd - disconnected) #2654
Conversation
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.
GJ Cami
Tests Results
|
tests/system/test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py
Outdated
Show resolved
Hide resolved
tests/system/test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py
Outdated
Show resolved
Hide resolved
try: | ||
# Create group with agent_groups | ||
host_manager.run_command(test_infra_managers[0], f"/var/ossec/bin/agent_groups -q -a -g {id_group}") | ||
|
||
# Register agent with agent-auth | ||
agent_ip, agent_id, agent_name, manager_ip = register_agent(test_infra_agents[0], agent_target, | ||
host_manager, id_group) | ||
|
||
# Check that agent status is never_connected in cluster | ||
check_agent_status(agent_id, agent_name, agent_ip, 'never_connected', host_manager, test_infra_managers) | ||
|
||
# Check that agent has group set to group_test on Managers | ||
check_agent_groups(agent_id, id_group, test_infra_managers, host_manager) | ||
|
||
# Check that agent has client key file | ||
assert check_keys_file(test_infra_agents[0], host_manager) | ||
|
||
finally: | ||
# Delete group of agent | ||
delete_group_of_agents('wazuh-master', id_group, 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.
I saw the case defined to create in this issue, but you don't wait the X(10) seconds like was defined. Is there any reason for that?
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.
There is no timeout added, because the commands themselves take around 5 seconds to even start, so it gives the time necessary for it to work and get synced
tests/system/test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py
Outdated
Show resolved
Hide resolved
Tests Results
|
tests/system/test_cluster/test_agent_groups/test_assign_agent_never_connected_to_group.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Dámaris <[email protected]>
In this PR the test suite for
Agent registered with group Y (agent_authd - disconnected)
is added. A total of 2 new test cases covering different modes and combinations of options.Cases:
- The agent is never_connected and registers with group to the master node using agent-auth
- The agent is never_connected and registers with group to the worker node using agent-auth
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
.