support nfs client and server on mariner

This commit is contained in:
Lili Deng 2022-10-14 15:06:12 +08:00 коммит произвёл LiliDeng
Родитель 6bd75c756a
Коммит f6b1196a8b
3 изменённых файлов: 9 добавлений и 9 удалений

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

@ -2,7 +2,7 @@
# Licensed under the MIT license.
from lisa.executable import Tool
from lisa.operating_system import SLES, Debian, Redhat
from lisa.operating_system import SLES, CBLMariner, Debian, Redhat
from lisa.tools import Firewall, Mount
from lisa.tools.mkfs import FileSystem
from lisa.tools.rm import Rm
@ -25,13 +25,13 @@ class NFSClient(Tool):
server_ip: str,
server_shared_dir: str,
mount_dir: str,
protocol: str = "tcp",
options: str = "",
) -> None:
# skip test if protocol is udp and CONFIG_NFS_DISABLE_UDP_SUPPORT is
# set in kernel
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1964093
if protocol == "udp":
if "udp" in options:
if self.node.tools[KernelConfig].is_built_in(
"CONFIG_NFS_DISABLE_UDP_SUPPORT"
):
@ -45,7 +45,7 @@ class NFSClient(Tool):
name=f"{server_ip}:{server_shared_dir}",
point=mount_dir,
type=FileSystem.nfs,
options=f"proto={protocol},vers=3",
options=options,
)
def stop(self, mount_dir: str) -> None:
@ -53,7 +53,7 @@ class NFSClient(Tool):
self.node.tools[Rm].remove_directory(mount_dir, sudo=True)
def _install(self) -> bool:
if isinstance(self.node.os, Redhat):
if isinstance(self.node.os, Redhat) or isinstance(self.node.os, CBLMariner):
self.node.os.install_packages("nfs-utils")
elif isinstance(self.node.os, Debian):
self.node.os.install_packages("nfs-common")

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

@ -5,7 +5,7 @@ from pathlib import PurePosixPath
from typing import List
from lisa.executable import Tool
from lisa.operating_system import SLES, Debian, Redhat
from lisa.operating_system import SLES, CBLMariner, Debian, Redhat
from lisa.tools import Echo, Firewall
from lisa.tools.service import Service
from lisa.util import UnsupportedDistroException
@ -80,7 +80,7 @@ class NFSServer(Tool):
raise UnsupportedDistroException(self.node.os)
def _install(self) -> bool:
if isinstance(self.node.os, Redhat):
if isinstance(self.node.os, Redhat) or isinstance(self.node.os, CBLMariner):
self.node.os.install_packages("nfs-utils")
elif isinstance(self.node.os, Debian):
self.node.os.install_packages("nfs-kernel-server")
@ -92,7 +92,7 @@ class NFSServer(Tool):
return self._check_exists()
def _check_exists(self) -> bool:
if isinstance(self.node.os, Redhat):
if isinstance(self.node.os, Redhat) or isinstance(self.node.os, CBLMariner):
return self.node.tools[Service].check_service_exists("nfs-utils")
elif isinstance(self.node.os, Debian):
return self.node.tools[Service].check_service_exists("nfs-kernel-server")

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

@ -213,7 +213,7 @@ class StoragePerformance(TestSuite):
server.internal_address,
server_raid_disk_mount_dir,
client_nfs_mount_dir,
protocol,
f"proto={protocol},vers=3",
)
def _run_fio_on_nfs(