sssd_test_framework.roles.nfs

NFS multihost role.

Classes

NFS(*args, **kwargs)

NFS role.

NFSExport(role, path)

NFS shared folder management.

class sssd_test_framework.roles.nfs.NFS(*args, **kwargs)

Bases: BaseLinuxRole[NFSHost]

NFS role.

Provides unified Python API for managing shared folders on the NFS server.

Creating user and group
@pytest.mark.topology(KnownTopology.LDAP)
def test_example(nfs: NFS):
    nfs.export('test').add()

Note

The role object is instantiated automatically as a dynamic pytest fixture by the multihost plugin. You should not create the object manually.

hostname: str

NFS server hostname.

exports_dir: str

Top level exports directory.

exportfs_reload() None

Reexport all directories.

export(path: str) NFSExport

Get export object.

Parameters:

path (str) – Path relative to the top level exports directory.

Returns:

New export object.

Return type:

NFSExport

class sssd_test_framework.roles.nfs.NFSExport(role: NFS, path: str)

Bases: BaseObject[NFSHost, NFS]

NFS shared folder management.

hostname: str

NFS server hostname.

path: str

Exported path relative to the top level exports directory.

fullpath: str

Absolute path of the exported directory.

exports_file

NFS exports file that manages this directory.

opts: str

NFS export options, defaults to rw,sync,no_root_squash.

add(*, opts: str = 'rw,sync,no_root_squash', reload: bool = True) NFSExport

Start sharing this directory.

Parameters:
  • opts (str, optional) – NFS export options, defaults to ‘rw,sync,no_root_squash’

  • reload (bool, optional) – Immediately reexport all directories, defaults to True

Returns:

Self.

Return type:

NFSExport

get() str

Get NFS export specification for automounter.

Return type:

str