diff --git a/test_tools/fstab.py b/test_tools/fstab.py index 8d53f33..1b0b669 100644 --- a/test_tools/fstab.py +++ b/test_tools/fstab.py @@ -4,18 +4,17 @@ # SPDX-License-Identifier: BSD-3-Clause # -from test_tools import fs_utils -from test_utils import systemd +from test_tools import fs_utils, systemctl def add_mountpoint(device, mount_point, fs_type, mount_now=True): fs_utils.append_line("/etc/fstab", f"{device.path} {mount_point} {fs_type.name} defaults 0 0") - systemd.reload_daemon() + systemctl.reload_daemon() if mount_now: - systemd.restart_service("local-fs.target") + systemctl.restart_service("local-fs.target") def remove_mountpoint(device): fs_utils.remove_lines("/etc/fstab", device.path) - systemd.reload_daemon() + systemctl.reload_daemon() diff --git a/test_utils/systemd.py b/test_tools/systemctl.py similarity index 92% rename from test_utils/systemd.py rename to test_tools/systemctl.py index dc4bcfd..db31c7f 100644 --- a/test_utils/systemd.py +++ b/test_tools/systemctl.py @@ -1,10 +1,10 @@ # # Copyright(c) 2019-2022 Intel Corporation +# Copyright(c) 2024 Huawei Technologies Co., Ltd. # SPDX-License-Identifier: BSD-3-Clause # from pathlib import Path - from core.test_run import TestRun systemd_service_directory = Path("/usr/lib/systemd/system/") diff --git a/test_utils/emergency_escape.py b/test_utils/emergency_escape.py index a997032..8378ab0 100644 --- a/test_utils/emergency_escape.py +++ b/test_utils/emergency_escape.py @@ -7,7 +7,7 @@ from textwrap import dedent from string import Template from pathlib import Path -from .systemd import enable_service, reload_daemon, systemd_service_directory, disable_service +from test_tools.systemctl import enable_service, reload_daemon, systemd_service_directory from test_tools.fs_utils import ( create_file, write_file,