-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Migrate agent-group files to wazuh-db - QA plan and execution #11240
Comments
Issues found
UPDATED 02/03/22: shared download deprecated for group assignment #11737
Click to expand
UPDATED 02/03/22: Expected behavior, agent needs a restart to dump the information into the client.keys |
WDB testing script. |
Test ID: gdbup2EnvironmentWazuh Manager:
Test cases:pre_upgrade backup generated. Upgrade schemas applied. 🟢pre_upgrade backup failed. 🟢Upgrade schema failed. Restoration success. 🟢
Upgrade schema failed. Restoration failed. 🟢 |
Test
|
Test
|
Test ID: gdbbak3EnvironmentWazuh Manager:
Issue foundThe global.db backup is not created at startup, fixed in #12128 Test : manual backups creation 🟢The following settings were used
Two manual backups were added Now that the maximum is reached, a new backup is requested and the oldest is removed The same happens when the default
We have the maximum allowed backups And the oldest is removed when a new one is requested Setting again a low limit cleans all the required snapshots when a new one is requested
Test : automatic backups creation 🟢When the automatic backup mechanism reaches to the
|
Test ID: iu1EnvironmentWazuh Manager:
Test case: |
Test ID: iu2EnvironmentWazuh Manager:
Wazuh Agents:
Test cases:Prior upgrade:Post upgrade: |
Having completed all the QA instances, we close this issue. |
Description
This is a tracking purposes issue to reflect all the work done on QA for the epic #10771. In this issue, we will expose the overall QA plan and the results of all the testing performed as well.
In the next sections, we add details and explain the criteria of all the QA instances.
Code reviews
For each PR created as part of this epic, the reviewer should take into account the next items.
Each reviewer will leave a comment in the review enumerating the criteria taken into account.
Static analysis of code
scan-build
execution.Coverity
analysis will be executed.For details, check the issue #11755.
Unit testing
As part of this epic, the implementation should have 100% of coverage for all the new functions included in the code, as well as the modified functions that already had 100% of coverage
For details, check the issue #11754.
Exploratory testing
After having the epic implemented, all the team will perform exploratory testing over the implementation.
Here we have a list of relevant tests collected during the development:
global.db
upgradeglobal.db
(lower than 3.10)pre_upgrade
backup should be generated. If the backup is created successfully, a newglobal.db
file should be generated. If the backup creation fails, an error log should be logged and theglobal.db
should be disabled.global.db
of version greater or equal than 3.10pre_upgrade
backup should be generated. If the backup is created successfully, all the schema upgrades should be applied up to version 4. If the backup creation fails, an error log should be logged and theglobal.db
should be disabled. On the other hand, if any of the upgrades up to version 4 fails, an error log should be logged and the database should be restored to the original state. If the restoration to the original state doesn't work, the database should be disabled.metadata
table verificationsqlite
fails checking if themetadata
table exists in the database. This is essentially asqlite
error so, we should evaluate whether is possible to force this scenario. If this is possible, an error log should be logged and theglobal.db
should be disabled.metadata
table and theversion
written in that table. We should evaluate whether is possible to force this scenario. If this is possible, a warning log should be logged and theglobal.db
should be disabled.global.db
backupsglobal.db
backups are created in the period specified in the settings. In addition, we should verify that the backup creation is informed in the log files.global.db
backups are enabled, we only keep the number of backups specified in the<max_files>
setting. In addition, we should verify that the oldest backup is removed when we create the backupmax_files+1
.Single manager agent groups management
agent_groups
tool, and using the Wazuh API. We should also verify that we can't assign an agent to a group that doesn't exist. Even when we specify a single group, or when we specify a list of groups and one of them doesn't exist. Finally, when we unassign agents from groups, we should verify that the agents always belong to a group. For all the cases we should verify thegroups_hash
column.agent_groups
tool, and using the Wazuh API, we can't assign an agent to more than 128 groups. In addition, we should verify that we can't create groups with an invalid name because of the size.agent_groups
tool and the Wazuh API as well, we can query the groups to which an agent is assigned.group
table should not allow repeated rows.Cluster agent groups management
master
, we can assign and unassign an agent to this group during the agent registration, using theagent_groups
tool, and using the Wazuh API. This should work even if the agent is in communication with the master and with the workers as well.master
and assigned to a group is removed, when it negotiates a new ID and key, in the first communication with theworker
, this performs a guessing operation and determines the groups to which the agent was assigned. With guess_agent_group disabled (default) the agent will be set to default when connects, with guess_agent_group enabled, the last assigned group must be restored. This information should be propagated to themaster
node.master
and others with theworkers
that are assigned to different groups, if we manually modify the agent groups information in the workers, this causes an integrity check failure and triggers an agent groups data synchronization.Installation and upgrade
backup/db
folder and Removal ofbackup/groups
folderbackup/db
folder should be created to be used by the periodicalglobal.db
backup creation. We should verify that during clean installations thebackup/groups
folder is no longer created. In addition, during an upgrade, this folder should be removed.agent-group
folderagent-group
files to theglobal.db
. After this, theagent-group
folder and its content shouldn't exist.The text was updated successfully, but these errors were encountered: