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
Failure installing upgrade_package_nonvulnerable_to_vulnerable windows agent test case in E2E VD tests #5344
Comments
Manual installation was performed in the Windows agent. Node package was installed without any error: It is required to research under which conditions reported error is produced After investigating the matter, it appears that the issue may stem from a potentially corrupted node package downloaded during testing. To address this, it's prudent to incorporate some additional validation steps within the installation process. |
It tested the installation of the Windows package using framework. More than 30 times the node package was installed, upgraded, and removed but errors were not replicated Force windows package install scriptfrom wazuh_testing.tools.system import HostManager
hm = HostManager("inv.yaml")
for i in range(30):
print("Installing node 18")
hm.install_package("agent2", "https://nodejs.org/dist/v18.20.0/node-v18.20.0-x64.msi",
"windows")
print("Installing node 20")
hm.install_package("agent2", "https://nodejs.org/dist/v20.5.1/node-v20.5.1-x64.msi",
"windows")
print("Removing node")
hm.remove_package("agent2", "windows", "{5674EEF9-AA04-4DEC-9191-67D745D090A2}") |
Proposed fix: d38ffe4 It has included a simple retry logic for certain error events in the environment for package installation. |
Currently testing fix in tests environment |
To evaluate the new development, it's been suggested that we conduct some fundamental tests import pytest
import testinfra
import wazuh_testing.tools.system
hm = wazuh_testing.tools.system.HostManager("INV.yaml")
def test_install_package():
hm.install_package("agent3", "https://nodejs.org/dist/v18.20.0/node-v18.20.0-x64.msi", "windows")
hm.install_package("agent1", "https://dl.grafana.com/oss/release/grafana-8.5.5-1.x86_64.rpm", "centos")
hm.install_package("agent2", "https://dl.grafana.com/oss/release/grafana_8.5.6_amd64.deb", "ubuntu")
def test_remove_package():
hm.remove_package("agent1", "centos", "grafana*")
hm.remove_package("agent2", "ubuntu", "grafana*")
hm.remove_package("agent3", "windows", "{ED801E31-1556-48A1-AC38-BADEF42169B0}")
def test_install_package_fail_retry():
with pytest.raises(Exception):
hm.install_package("agent3", "C:/Users/qa/YourCorruptedFile.msi", "windows") Result
Note These tests shouldn't be uploaded to the repository because they require specific environmental conditions and may not be universally applicable. However, in future functional testing, we should design tests to ensure the framework's consistency, including mocking system results |
LGTM |
Description
It has been detected in Release 4.8.0 - RC 1 - Vulnerability Detection E2E tests, that the node package for
upgrade_package_nonvulnerable_to_vulnerable
test case fails to be installed in the environment:This fails seems to be erratic and only affects to the Windows agent. Further research is required.
The text was updated successfully, but these errors were encountered: