Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/common/devices/sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,15 @@ def is_container_running(self, service):

return len(status["stdout_lines"]) > 1

def is_host_service_running(self, service):
"""
Check if the specified service is running or not
@param service: Service name
@return: True if specified service is running, else False
"""
service_status = self.shell("sudo systemctl status {} | grep 'Active'".format(service))
return "active (running)" in service_status['stdout']

def critical_services_status(self):
# Initialize service status
services = {}
Expand Down