Skip to content

Commit

Permalink
fix: handling authd process start result
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioDonda committed Jun 12, 2024
1 parent d24ef80 commit 6944027
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_agent_auth_enrollment(test_configuration, test_metadata, set_wazuh_conf
- Error logs related to the wrong configuration block
"""

launch_agent_auth(test_metadata.get('configuration', {}))
agent_auth_launch_result = launch_agent_auth(test_metadata.get('configuration', {}))

if 'expected_error' in test_metadata:
expected_error_dict = test_metadata['expected_error']
Expand All @@ -148,6 +148,9 @@ def test_agent_auth_enrollment(test_configuration, test_metadata, set_wazuh_conf
raise error

else:
if agent_auth_launch_result != 0:
pytest.xfail(f"Xfailing agent-auth did not start execution result: {agent_auth_launch_result}")

test_expected = test_metadata['message']['expected'].format(host_name=get_host_name(),
agent_version=get_version()).encode()
test_response = test_metadata['message']['response'].format(host_name=get_host_name()).encode()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_enrollment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ def launch_agent_auth(test_configuration):
if test_configuration.get('groups'):
parser.add_groups(test_configuration.get('groups'))

subprocess.call(parser.get_command(), timeout=AGENT_AUTH_LAUNCH_TIMEOUT)
return subprocess.call(parser.get_command(), timeout=AGENT_AUTH_LAUNCH_TIMEOUT)

0 comments on commit 6944027

Please sign in to comment.