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

IT Wazuh DB: Add coverage to new commands #2653

Merged

Conversation

damarisg
Copy link
Member

@damarisg damarisg commented Mar 9, 2022

Description

New changes in Wazuh DB add new commands to cover:
Attached is the list of PRs who worked on each of the commands, there you can find in detail each of the implemented cases.

Command PR Detailed
sync-agent-groups-get #2626
set-agent-groups #2602
get-groups-integrity #2607
global backup #2637
wazuhdb getconfig #2627
Related issues #10771 (wazuh)

Configuration options

OS Version Branch Type
Centos 4.4.0 dev-10771-agent-groups-files-to-wazuh-db Manager

Local Internal Options: No Local Internal Options used


Required

  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py.
  • Python codebase is documented following the Google Style for Python docstrings.
  • The test is documented in wazuh-qa/docs.

Deblintrake09 and others added 30 commits February 23, 2022 18:30
Co-authored-by: Dámaris  <seyla.gomez@wazuh.com>
IT 2532- Test set_agent_groups WDB command
IT 2532 - Test get-groups-integrity WDB command
@Deblintrake09
Copy link
Contributor

Tests Results

Test Path Os/Type Execution Type Results Date By Notes
test/integration/test_wazuh_db/ CentOS - Manager Local 🟢🟢 🟢 16/03/2022 @Deblintrake09 Run all folder except test_wazuh_db.py
test/integration/test_wazuh_db/ CentOS - Manager Jenkins 🟢🟢 🟢 16/03/2022 @Deblintrake09 Run all folder except test_wazuh_db.py

Deblintrake09
Deblintrake09 previously approved these changes Mar 16, 2022
Comment on lines 54 to 69
def get_list_of_content_yml(file_path, filter, list=[]):
"""Read a YAML file from a given path, return a list with the YAML data
after apply filter

Args:
file_path (str): Path of the YAML file to be readed
filter (str): filder to extract some part of yaml
list: a list with previous information

Returns:
list: Yaml structure.
"""
list.append((read_yaml(file_path), file_path + filter))
return list


Copy link
Member Author

Choose a reason for hiding this comment

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

If we don't use this method but this block is repeat on each test,

with open(messages_file) as f:
module_tests.append((yaml.safe_load(f), messages_file.split('_')[0]))

Could we add this content on a this method an use it on each test?

Copy link
Contributor

@Deblintrake09 Deblintrake09 left a comment

Choose a reason for hiding this comment

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

applied requested change. refactored function that opens yaml file.
Approved

@damarisg
Copy link
Member Author

Tests Results

Test Path Os/Type Execution Type Results Date By Notes
test/integration/test_wazuh_db/ CentOS - Manager Jenkins 🟢🟢 🟢 17/03/2022 Seyla Run all folder except test_wazuh_db.py. There are still some tests to be fixed in another branch and they will fail here.

@damarisg damarisg changed the base branch from master to it-wazuh-db-migration-of-agent-groups-files March 17, 2022 12:33
@damarisg damarisg merged commit ebfb6e3 into it-wazuh-db-migration-of-agent-groups-files Mar 17, 2022
@damarisg damarisg deleted the 2532-wazuh-db-commands branch March 17, 2022 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IT - Wazuh DB (T0): Successful behavior of wazuh DB commands
3 participants