Skip to content

Commit

Permalink
add: Added stopping and restarting analysisd daemon implementation #1850
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando authored and mauromalara committed Sep 26, 2022
1 parent b4ab243 commit d0f5997
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,11 +17,21 @@
command_exec = f'{analysisd_path} -t'



def test_queue_socket_status():

# Check if analysisd daemon is running
check_daemon_status(running_condition=True, target_daemon='wazuh-analysisd')

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()
Expand Down

0 comments on commit d0f5997

Please sign in to comment.