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 unattended test #2007

Merged
merged 3 commits into from
Dec 23, 2022
Merged
Changes from all 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
20 changes: 7 additions & 13 deletions tests/unattended/install/test_unattended.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_check_wazuh_manager_apid():

@pytest.mark.wazuh_cluster
def test_check_wazuh_manager_clusterd():
assert check_call("ps -xa | grep wazuh-clusterd | grep -v grep", shell=True) != ""
assert check_call("ps -xa | grep clusterd.py | grep -v grep", shell=True) != ""

@pytest.mark.wazuh
def test_check_filebeat_process():
Expand Down Expand Up @@ -211,12 +211,9 @@ def test_check_log_errors():
with open('/var/ossec/logs/ossec.log', 'r') as f:
for line in f.readlines():
if 'ERROR' in line:
found_error = True
if get_wazuh_version() == 'v4.4.0':
if 'ERROR: Cluster error detected' in line or 'agent-upgrade: ERROR: (8123): There has been an error executing the request in the tasks manager.' in line:
found_error = False
else:
break
if 'ERROR: Cluster error detected' not in line and 'agent-upgrade: ERROR: (8123): There has been an error executing the request in the tasks manager.' not in line:
found_error = True
break
assert found_error == False, line

@pytest.mark.wazuh_cluster
Expand All @@ -235,12 +232,9 @@ def test_check_cluster_log_errors():
with open('/var/ossec/logs/cluster.log', 'r') as f:
for line in f.readlines():
if 'ERROR' in line:
found_error = True
if get_wazuh_version() == 'v4.4.0':
if 'Could not connect to master' in line or 'Worker node is not connected to master' in line or 'Connection reset by peer' in line:
found_error = False
else:
break
if 'Could not connect to master' not in line and 'Worker node is not connected to master' not in line and 'Connection reset by peer' not in line:
found_error = True
break
assert found_error == False, line

@pytest.mark.wazuh_cluster
Expand Down