-
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
Logcollector integration tests T0: reconnect_time option #1312
Conversation
return monitoring.make_callback(pattern=msg, prefix=prefix, escape=escape) | ||
|
||
|
||
|
||
def callback_event_log_service_down(location, severity='WARNING'): |
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.
return monitoring.make_callback(pattern=msg, prefix=prefix, escape=escape) | |
def callback_event_log_service_down(location, severity='WARNING'): | |
return monitoring.make_callback(pattern=msg, prefix=prefix, escape=escape) | |
def callback_event_log_service_down(location, severity='WARNING'): |
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.
Done 4d788e1
print(f"{log_format_message}") | ||
return monitoring.make_callback(pattern=log_format_message, prefix=monitoring.AGENT_DETECTOR_PREFIX) | ||
|
||
def callback_trying_to_reconnect(location, reconnect_time): |
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.
print(f"{log_format_message}") | |
return monitoring.make_callback(pattern=log_format_message, prefix=monitoring.AGENT_DETECTOR_PREFIX) | |
def callback_trying_to_reconnect(location, reconnect_time): | |
return monitoring.make_callback(pattern=log_format_message, prefix=monitoring.AGENT_DETECTOR_PREFIX) | |
def callback_trying_to_reconnect(location, reconnect_time): |
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.
Done 4d788e1
print(f"{log_format_message}") | ||
return monitoring.make_callback(pattern=log_format_message, prefix=monitoring.AGENT_DETECTOR_PREFIX) | ||
|
||
def callback_reconnect_eventchannel(location): |
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.
print(f"{log_format_message}") | |
return monitoring.make_callback(pattern=log_format_message, prefix=monitoring.AGENT_DETECTOR_PREFIX) | |
def callback_reconnect_eventchannel(location): | |
return monitoring.make_callback(pattern=log_format_message, prefix=monitoring.AGENT_DETECTOR_PREFIX) | |
def callback_reconnect_eventchannel(location): |
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.
Done 4d788e1
""" | ||
|
||
""" |
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.
Something is missing here 🤔
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.
Done 4d788e1
"""Control Windows event log service | ||
|
||
Args: | ||
control (str): Start or Stop |
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.
"""Control Windows event log service | |
Args: | |
control (str): Start or Stop | |
"""Control Windows event log service. | |
Args: | |
control (str): Start or Stop. |
Raises
section is missing here.
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.
Done 4d788e1
- Fail if Wazuh agent does not reconnect to Windows event log at the time specified by `reconnect_time ` | ||
- Fail if Wazuh agent does not generate a debug message when Windows event log is down |
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.
- Fail if Wazuh agent does not reconnect to Windows event log at the time specified by `reconnect_time ` | |
- Fail if Wazuh agent does not generate a debug message when Windows event log is down | |
- Fail if Wazuh agent does not reconnect to Windows event log at the time specified by `reconnect_time`. | |
- Fail if Wazuh agent does not generate a debug message when the Windows event log is down. |
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.
Done 4d788e1
if sys.platform != 'win32': | ||
pytestmark = [pytest.mark.skip, pytest.mark.tier(level=0)] | ||
else: | ||
pytestmark = pytest.mark.tier(level=0) |
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.
if sys.platform != 'win32': | |
pytestmark = [pytest.mark.skip, pytest.mark.tier(level=0)] | |
else: | |
pytestmark = pytest.mark.tier(level=0) | |
pytestmark = [pytest.mark.win32, pytest.mark.tier(level=0)] |
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.
Done 4d788e1
config = get_configuration['metadata'] | ||
|
||
if time_to_seconds(config['reconnect_time']) >= timeout_callback_reconnect_time: | ||
pytest.xfail("Expected fail: ") |
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.
Add more detail here explaining why the error is expected.
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.
Done 4d788e1
|
||
before = str(datetime.now()) | ||
|
||
if time_to_seconds(config['reconnect_time']) >= timeout_callback_reconnect_time: |
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.
if time_to_seconds(config['reconnect_time']) >= timeout_callback_reconnect_time: | |
if time_to_seconds(config['reconnect_time']) >= timeout_callback_reconnect_time: |
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.
Done 4d788e1
Add issue to xfail case description for reconnect_time logcollector test Fix minnor documentation error
Description
This PR adds logcollector tests for reconnect_time option.
reconnect_time
value.This test is valid for Windows agents.
Every case of
reconnect_time
greater than 30 seconds will be marked as xfail due to this issue: wazuh/wazuh#8580Test results
Windows - Agent
Documentation
Test reconnect time