-
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
Full Yellow Local - Fix WazuhDB tests self-configuration in 4.2 #1643
Conversation
I have launched Tests results
Then, I have launched three times, when the wazuh manager was never started.
|
import subprocess | ||
import subprocess as sb |
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.
import subprocess | |
import subprocess as sb | |
import subprocess as sb |
It is imported twice, we can delete one import if it is not necessary.
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 d2419f5
|
||
|
||
def list_agents_ids(): | ||
wazuhdb_result = query_wdb("global get-all-agents last_id -1") |
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.
wazuhdb_result = query_wdb("global get-all-agents last_id -1") | |
wazuhdb_result = query_wdb('global get-all-agents last_id -1') |
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 d2419f5
agent_ids_list = list_agents_ids() | ||
remove_agents(agent_ids_list, remove_type) |
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.
agent_ids_list = list_agents_ids() | |
remove_agents(agent_ids_list, remove_type) | |
remove_agents(list_agents_ids(), remove_type) |
If it is possible, we could call the function list_agents_ids()
inside remove_agents
and the code would be simpler.
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 d2419f5
@@ -56,7 +58,16 @@ def regex_match(regex, string): | |||
return re.match(regex, string) | |||
|
|||
|
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.
# Fixtures |
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.
This comment follows the file standard, however, maybe they are not very useful. It should be necessary to standardize all tests structure and commentaries with the rest of the team in the future.
Fix minnor style error in wazuh_manager module
Tests results
|
Description
After research #1493, we could see that WazuhDB tests fail in case Wazuh Manager does not start for the first time. Also, it was detected that in case of the manager has already registered some agents, independently of the state of them, these tests produce false positives. This is error is commented in the original issue. This PR has been created In order to make all wazuh-qa tests independent.
Packages details
Local internal options
No local internal options are required.
Pytest args
No arguments are required.
Testing process
In order, to properly test, this issue is necessary to ensure:
Tests results
New provisioned environment
In progress.
Already registered agents
In progress.