diff --git a/test_tools/systemctl.py b/test_tools/systemctl.py index 5098208..12051fd 100644 --- a/test_tools/systemctl.py +++ b/test_tools/systemctl.py @@ -1,13 +1,15 @@ # # Copyright(c) 2019-2022 Intel Corporation -# Copyright(c) 2024 Huawei Technologies Co., Ltd. +# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd. # SPDX-License-Identifier: BSD-3-Clause # -from pathlib import Path +from pathlib import PurePosixPath + from core.test_run import TestRun -systemd_service_directory = Path("/usr/lib/systemd/system/") +systemd_service_directory = PurePosixPath("/usr/lib/systemd/system/") + def enable_service(name): TestRun.executor.run_expect_success(f"systemctl enable {name}") diff --git a/test_utils/emergency_escape.py b/test_utils/emergency_escape.py index 1f0ce74..ba98167 100644 --- a/test_utils/emergency_escape.py +++ b/test_utils/emergency_escape.py @@ -1,11 +1,12 @@ # # Copyright(c) 2022 Intel Corporation +# Copyright(c) 2025 Huawei Corporation # SPDX-License-Identifier: BSD-3-Clause # from textwrap import dedent from string import Template -from pathlib import Path +from pathlib import PurePosixPath from test_tools.systemctl import enable_service, reload_daemon, systemd_service_directory from test_tools.fs_tools import ( @@ -17,7 +18,7 @@ from test_tools.fs_tools import ( class EmergencyEscape: escape_marker = "EMERGENCY_ESCAPE" - escape_service = Path("emergency-escape.service") + escape_service = PurePosixPath("emergency-escape.service") escape_service_template = Template( dedent( f""" @@ -38,7 +39,7 @@ class EmergencyEscape: """ ).strip() ) - cleanup_service = Path("emergency-escape-cleanup.service") + cleanup_service = PurePosixPath("emergency-escape-cleanup.service") cleanup_service_template = Template( dedent( """