Closed Rebits closed 2 weeks ago
Investigating the truncation process, we can see that:
In conftest.py file, clean_environment_logs and clean_environment_logs_function: both functions perform similar actions but have a different scope. They manage logs by deleting them at the end of their scope using truncate_remote_host_group_files.
In logs.py file, truncate_remote_host_group_files: this function directly handles log deletion. It takes parameters to decide which host group and file types should be truncated.
In file.py file, truncate_file: this function performs the action of opening the specified file in write mode, which automatically truncates the file.
To carry out this issue a conditional will be added to the clean_environment_logs function so that when the test_change_agent_manager
case is performed it avoids truncation.
test_change_agent_manager
casetest_change_agent_manager
caseChanges made in this branch: fix/5345-skip-truncate-test-change-agent-manager
In this PR: https://github.com/wazuh/wazuh-qa/pull/5355
Moved ETA due to final review
During a meeting with @santipadilla, we identified that the new agent configuration isn't properly applied after the configured agent is permuted because the agent isn't restarted following the change. It's likely that the restart agent call was inadvertently omitted during a merge or PR review.
The solution appears straightforward: ensure that agents are restarted after the permutate_manager
fixture is applied.
Updated the issue title accordingly
[!WARNING] It's imperative to rerun this test in the E2E environment. Unfortunately, a current bug in RC1 (https://github.com/wazuh/wazuh/issues/23301) is hindering the appearance of some vulnerabilities. Therefore, we'll need to wait until this issue is resolved before verifying if there are any product-related issues concerning the manager change.
permutate_agents_managers
fixturepermutate_agents_managers
fixturetest_change_agent_manager
caseNew changes made in this branch: fix/5345-skip-truncate-test-change-agent-manager
In this PR: https://github.com/wazuh/wazuh-qa/pull/5355
Description
It has been detected in Release 4.8.0 - RC 1 - Vulnerability Detection E2E tests, that the test case
test_change_agent_manager
is truncating the agent/manager logs, making difficult to get any information of the environment in case of failure.