-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Added stopping and restarting analysisd daemon implementation #1850
- Loading branch information
Fernando
committed
Dec 21, 2021
1 parent
1f7657c
commit b1623e0
Showing
1 changed file
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
import subprocess | ||
|
||
from wazuh_testing.tools import WAZUH_PATH | ||
from wazuh_testing.tools.services import control_service, check_daemon_status | ||
|
||
|
||
|
||
# Marks | ||
|
@@ -15,11 +17,21 @@ | |
command_exec = f'{analysisd_path} -t' | ||
|
||
|
||
|
||
def test_queue_socket_status(): | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
# Check if analysisd daemon is running | ||
check_daemon_status(running_condition=True, target_daemon='wazuh-analysisd') | ||
This comment has been minimized.
Sorry, something went wrong.
mauromalara
Contributor
|
||
|
||
current_inode_file = os.stat(ANALYSISD_SOCKET).st_ino | ||
current_status_time = os.path.getmtime(ANALYSISD_SOCKET) | ||
|
||
# Stop analysisd daemon | ||
control_service('stop', daemon='wazuh-analysisd') | ||
check_daemon_status(running_condition=False, target_daemon='wazuh-analysisd') | ||
|
||
control_service('start', daemon='wazuh-analysisd') | ||
|
||
|
||
# Updating Analysisd | ||
run = subprocess.Popen(['/bin/bash', '-c', command_exec]) | ||
run.communicate() | ||
|
1 comment
on commit b1623e0
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.
@fernandolojano check the lines 40 and 45. You can simply do: assert something, f"The inode value for the socket {SOCKET} has changed." Instead of the try-except block.
Change it with a more descriptive name