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 - WDB - 2532- Test set_agent_groups WDB command #2602

Merged
merged 8 commits into from
Feb 25, 2022

Conversation

Deblintrake09
Copy link
Contributor

@Deblintrake09 Deblintrake09 commented Feb 23, 2022

Description

In this PR the test suite for set_agent_groups command is added. A total of 23 new test cases covering different modes and combinations of options.

Related issues #2532 #10771 (Wazuh)

Cases for set_agent_groups command:

  • Append
    - Add TestGroup1
    - Empty groups - Agent has no groups - No groups added
    - Empty groups - Agent has default group - No groups affected
    - Add same group twice - Has only one group
    - Two groups - Agent Has two groups
  • Empty-Only
    - Agent Has no groups. One Group is Added
    - Agent Has no groups. No new groups added
  • Override
    - Agent Has one group. New group replaces old group
    - Agent has Group - Pass no new group. Error - groups not affected
  • Remove
    - Agent has one Group - Remove the group. Agent has default assigned
    - Agent has TestGroup1 and TestGroup2 - Remove Tesgroup1. Agent has TestGroup2 assigned
    - Agent has no groups - Try remove a group. Agent has default assigned
  • Invalid Mode - use an Invalid mode - no groups added
  • No Mode - No mode is passed - no groups affected
  • sync_status
    - sync_status Synced - Assign a group using Synced Sync Status - agent has TestGroup1 assigned
    - Wrong sync_status - Assign a group using and invalid Sync_Status - agent has no group
    - No sync_status - Assign a group using and empty Sync_Status field - agent has no group assigned
  • Missing Fields
    - Assign a group using without data field - agent has no group assigned
    - Assign a group using without data groups field - agent has no group assigned
    - Assign a group using without data id field - agent has no group assigned
    - Assign a group using without source field - agent has TestGroup1 assigned
    - Assign a group using without mode field - agent has no group assigned
    - Assign a group using without sync_status field - agent has TestGroup1 assigned

Note: Form more case details, it can be checked in set_agent_groups.yaml file.


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


Tests Results

Test Path Os/Type Execution Type Results Date By
test_wazuh_db/test_set_agent_groups Manager Local 🟢 🟢 🟢 2022/02/23 @Deblintrake09
test_wazuh_db/test_set_agent_groups Manager Jenkins 🟢 🟢 🟢 2022/02/23 @Deblintrake09

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 2 commits February 24, 2022 17:29
Co-authored-by: Dámaris  <seyla.gomez@wazuh.com>
Copy link
Member

@damarisg damarisg left a comment

Choose a reason for hiding this comment

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

GJ!
I attach test results:

Test Path OS Component Type Status Date Executed by
test_wazuh_db/test_set_agent_groups/ Linux Manager Local 🟢 🟢 🟢 2022/02/25 seyla

@damarisg damarisg removed the request for review from DProvinciani February 25, 2022 13:40
@damarisg damarisg merged commit 7b12117 into 2532-wazuh-db-commands Feb 25, 2022
@damarisg damarisg deleted the tmp-set-agent-groups-tests branch February 25, 2022 14:54
@Deblintrake09 Deblintrake09 changed the title IT 2532- Test set_agent_groups WDB command IT - WDB - 2532- Test set_agent_groups WDB command Feb 25, 2022
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.

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