Merge pull request #38 from Kamoppl/kamilg/fix_paths_type

test-framework: force TF to use linux path
This commit is contained in:
Katarzyna Treder 2025-04-08 07:42:59 +02:00 committed by GitHub
commit ace1ff49d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View File

@ -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}")

View File

@ -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(
"""