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

Extend QA Framework for Integration Testing of Journald Log Collection #134

Merged
merged 3 commits into from
May 3, 2024

Conversation

juliancnn
Copy link
Member

@juliancnn juliancnn commented Apr 15, 2024

Closes #130

Description

This PR addresses the need for rigorous integration testing of the journald log collection feature as outlined in Issue wazuh/wazuh#12862. The enhancements made to the Wazuh QA framework through this PR are designed to ensure that the journald log collection functionality is thoroughly tested, verifying its reliability and integration within the existing Wazuh ecosystem.

Objectives

The main goal of this PR is to adapt and expand the current Wazuh QA framework to support integration testing specifically tailored for the journald log collection feature. By doing so, we aim to safeguard the robustness and effectiveness of this new feature, ensuring it performs as expected in diverse scenarios and configurations.

Key Enhancements

  1. Regex-based File Manipulation:

    • Added functionality to replace complete blocks within files using multiline regex patterns. This allows for dynamic adjustments of configuration files during test setup, facilitating more complex test scenarios.
  2. Logreader Configuration Extraction:

    • Implemented a method to retrieve the logreader configuration block (localfile runtime configuration) directly from the logcollector API. This ensures that tests can verify and assert the configuration state accurately after various operations.
  3. File Monitor Modifications:

    • Modified the file monitoring tool to incorporate a timeout set to 0, enabling the reading of old logs immediately after running the monitor. This change is crucial for testing the only-future-event = no feature, as it allows for the collection of logs generated prior to the monitor's execution.
  4. Issue Resolution:

    • Conducted a thorough review and rectification of various issues identified during the initial testing phase, enhancing the stability and functionality of the tests.

Impact

These enhancements to the QA framework not only support the new journald log collection feature but also improve the overall testing capabilities of the Wazuh platform. By enabling more precise and varied testing scenarios, these changes contribute to the ongoing improvement of Wazuh's reliability and user trust.

Conclusion

With the integration of these enhancements into the Wazuh QA framework, we are better equipped to handle the complexities of testing the journald log collection feature. This PR represents a significant step forward in our commitment to delivering high-quality and dependable features to the Wazuh community.

JcabreraC
JcabreraC previously approved these changes Apr 25, 2024
Copy link
Member

@JcabreraC JcabreraC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Copy link
Member

@JcabreraC JcabreraC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@JcabreraC JcabreraC merged commit db4ccdd into 4.9.0 May 3, 2024
@TomasTurina TomasTurina deleted the 12862-logcollector-journald-support branch May 15, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Required Modifications to the Wazuh QA Framework for journald Log Collection Integration Tests
3 participants