Files
test/keywords/linux/systemctl/systemctl_status_keywords.py
Guntaka Umashankar Reddy 49367cb58c Verify PTP operation and status changes during GNSS loss, phc_ctl adjustments, and service stop, start, and restart events.
Change-Id: I5734135d1871531dee265ff81d75b12656e3907a
Signed-off-by: Guntaka Umashankar Reddy <umashankarguntaka.reddy@windriver.com>
2025-05-29 11:48:45 -04:00

24 lines
751 B
Python

from framework.ssh.ssh_connection import SSHConnection
from keywords.base_keyword import BaseKeyword
class SystemCTLStatusKeywords(BaseKeyword):
"""
Keywords for systemctl status <service_name> cmds
"""
def __init__(self, ssh_connection: SSHConnection):
self.ssh_connection = ssh_connection
def get_status(self, service_name: str) -> list[str]:
"""
Gets the status of the given service name
Args:
service_name (str): the service name
Returns:
list[str]: the output as a list of strings - this should be consumed by a parser for the given output type
"""
output = self.ssh_connection.send(f"systemctl status {service_name}")
return output