Skip to content

Commit 57d401a

Browse files
author
Katarzyna Treder
committed
Fix for io class config fuzzy tests
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
1 parent cc61969 commit 57d401a

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

test/functional/tests/security/fuzzy/kernel/fuzzy_with_io/fuzzy_io_class/test_fuzzy_io_class_config_allocation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#
22
# Copyright(c) 2022 Intel Corporation
3-
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
3+
# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
66

7+
import posixpath
78
import pytest
89

910
from api.cas.cache_config import (
@@ -30,7 +31,7 @@
3031
mount_point,
3132
)
3233

33-
io_class_file_path = "/root/Fuzzy/ioclass.csv"
34+
io_class_file_path = posixpath.join(TestRun.TEST_RUN_DATA_PATH, "ioclass.csv")
3435

3536

3637
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))

test/functional/tests/security/fuzzy/kernel/fuzzy_with_io/fuzzy_io_class/test_fuzzy_io_class_config_io_class_id.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#
22
# Copyright(c) 2022 Intel Corporation
3-
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
3+
# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
66

7+
import posixpath
78
import pytest
89

910
from api.cas.cache_config import (
@@ -30,7 +31,7 @@
3031
mount_point,
3132
)
3233

33-
io_class_file_path = "/root/Fuzzy/ioclass.csv"
34+
io_class_file_path = posixpath.join(TestRun.TEST_RUN_DATA_PATH, "ioclass.csv")
3435

3536

3637
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))

test/functional/tests/security/fuzzy/kernel/fuzzy_with_io/fuzzy_io_class/test_fuzzy_io_class_config_io_class_name.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
66

7+
import posixpath
78
import random
89
import re
910
import pytest
@@ -32,7 +33,7 @@
3233
mount_point,
3334
)
3435

35-
io_class_file_path = "/root/Fuzzy/ioclass.csv"
36+
io_class_file_path = posixpath.join(TestRun.TEST_RUN_DATA_PATH, "ioclass.csv")
3637
parametrized_keywords = [
3738
"directory",
3839
"file_name_prefix",
@@ -218,8 +219,11 @@ def __validate_single_condition(value: str):
218219
if condition_key is None:
219220
return False
220221

221-
if condition_key in ["directory", "file_name_prefix", "extension", "process_name"]:
222-
if 0 < len(condition_value) <= 255:
222+
if condition_key in ["file_name_prefix", "extension", "process_name"]:
223+
if 0 < len(condition_value) <= 256:
224+
return True
225+
if condition_key is "directory":
226+
if 0 < len(condition_value) <= 1024:
223227
return True
224228
elif condition_key == "io_direction":
225229
return condition_value in ["read", "write"]

test/functional/tests/security/fuzzy/kernel/fuzzy_with_io/fuzzy_io_class/test_fuzzy_io_class_config_priority.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#
22
# Copyright(c) 2022 Intel Corporation
3-
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
3+
# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
44
# SPDX-License-Identifier: BSD-3-Clause
55
#
66

7+
import posixpath
78
import pytest
89

910
from api.cas.cache_config import (
@@ -30,7 +31,7 @@
3031
mount_point,
3132
)
3233

33-
io_class_file_path = "/root/Fuzzy/ioclass.csv"
34+
io_class_file_path = posixpath.join(TestRun.TEST_RUN_DATA_PATH, "ioclass.csv")
3435

3536

3637
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))

0 commit comments

Comments
 (0)