xfstests: add new generic xfstests for ext4 filesystem (#3527)

* add generic xfstests for ext4 filesystem

* fix formatting
This commit is contained in:
Sudipta Pandit 2024-11-22 20:22:33 +05:30 коммит произвёл GitHub
Родитель fa952fe602
Коммит 2951df2a3f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 74 добавлений и 3 удалений

Просмотреть файл

@ -178,6 +178,44 @@ class Xfstesting(TestSuite):
excluded_tests=self.excluded_tests,
)
@TestCaseMetadata(
description="""
This test case will run generic xfstests testing against
standard data disk with ext4 type system.
""",
requirement=simple_requirement(
disk=schema.DiskOptionSettings(
data_disk_type=schema.DiskType.StandardHDDLRS,
os_disk_type=schema.DiskType.StandardHDDLRS,
data_disk_iops=500,
data_disk_count=search_space.IntRange(min=1),
),
unsupported_os=[BSD, Windows],
),
timeout=TIME_OUT,
use_new_environment=True,
priority=3,
)
def verify_generic_ext4_standard_datadisk(
self, log_path: Path, result: TestResult
) -> None:
environment = result.environment
assert environment, "fail to get environment from testresult"
node = cast(RemoteNode, environment.nodes[0])
xfstests = self._install_xfstests(node)
disk = node.features[Disk]
data_disks = disk.get_raw_data_disks()
self._execute_xfstests(
log_path,
xfstests,
result,
data_disks[0],
f"{data_disks[0]}1",
f"{data_disks[0]}2",
file_system=FileSystem.ext4,
excluded_tests=self.excluded_tests,
)
@TestCaseMetadata(
description="""
This test case will run xfs xfstests testing against
@ -320,6 +358,38 @@ class Xfstesting(TestSuite):
excluded_tests=self.excluded_tests,
)
@TestCaseMetadata(
description="""
This test case will run generic xfstests testing against
nvme data disk with ext4 type system.
""",
timeout=TIME_OUT,
priority=3,
use_new_environment=True,
requirement=simple_requirement(
supported_features=[Nvme], unsupported_os=[BSD, Windows]
),
)
def verify_generic_ext4_nvme_datadisk(
self, log_path: Path, result: TestResult
) -> None:
environment = result.environment
assert environment, "fail to get environment from testresult"
node = cast(RemoteNode, environment.nodes[0])
xfstests = self._install_xfstests(node)
nvme_disk = node.features[Nvme]
nvme_data_disks = nvme_disk.get_raw_data_disks()
self._execute_xfstests(
log_path,
xfstests,
result,
nvme_data_disks[0],
f"{nvme_data_disks[0]}p1",
f"{nvme_data_disks[0]}p2",
file_system=FileSystem.ext4,
excluded_tests=self.excluded_tests,
)
@TestCaseMetadata(
description="""
This test case will run xfs xfstests testing against
@ -547,6 +617,7 @@ class Xfstesting(TestSuite):
test_dev,
_test_folder,
test_type,
file_system.name,
mount_opts,
)
xfstests.set_excluded_tests(excluded_tests)

Просмотреть файл

@ -304,14 +304,14 @@ class Xfstests(Tool):
test_dev: str,
test_folder: str,
test_type: str,
fs_type: str,
mount_opts: str = "",
) -> None:
xfstests_path = self.get_xfstests_path()
config_path = xfstests_path.joinpath("local.config")
if self.node.shell.exists(config_path):
self.node.shell.remove(config_path)
if "generic" == test_type:
test_type = "xfs"
echo = self.node.tools[Echo]
if mount_opts:
content = "\n".join(
@ -326,7 +326,7 @@ class Xfstests(Tool):
content = "\n".join(
[
f"[{test_type}]",
f"FSTYP={test_type}",
f"FSTYP={fs_type}",
]
)
echo.write_to_file(content, config_path, append=True)