open-cas-linux/test/functional/test-framework/test_utils/systemd.py
Robert Baldyga 849f59855c tests: Embed test framework within OCL repository
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-12-23 12:53:55 +01:00

26 lines
591 B
Python

#
# Copyright(c) 2019-2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
from pathlib import Path
from core.test_run import TestRun
systemd_service_directory = Path("/usr/lib/systemd/system/")
def enable_service(name):
TestRun.executor.run_expect_success(f"systemctl enable {name}")
def disable_service(name):
TestRun.executor.run_expect_success(f"systemctl disable {name}")
def reload_daemon():
TestRun.executor.run_expect_success("systemctl daemon-reload")
def restart_service(name):
TestRun.executor.run_expect_success(f"systemctl restart {name}")