def test_no_local_nfs_mounts(tmpdir): mount_file = _create_mount_file(tmpdir, [ MOUNT_FMT_LINE.format( address='127.0.0.1', mountpoint='/mnt', fs_type='ext4') ]) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert {} == mounts
def test_local_nfs_mount(tmpdir): mount_file = _create_mount_file(tmpdir, [ MOUNT_FMT_LINE.format( address='127.0.0.1', mountpoint='/mnt', fs_type='nfs4') ]) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert 1 == len(mounts) assert 'mnt' in mounts
def test_no_local_mounts(tmpdir): mount_file = _create_mount_file(tmpdir, [ MOUNT_FMT_LINE.format(address='10.1.0.1', mountpoint='/mnt', fs_type='nfs4', options=DEFAULT_OPTS) ]) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert {} == mounts
def test_no_local_nfs_mounts(tmpdir): mount_file = _create_mount_file( tmpdir, [ MOUNT_FMT_LINE.format( address="127.0.0.1", mountpoint="/mnt", fs_type="ext4", options=DEFAULT_OPTS, ) ], ) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert {} == mounts
def test_local_nfs_mount_default_nfs_port(tmpdir): mount_file = _create_mount_file( tmpdir, [ MOUNT_FMT_LINE.format( address="127.0.0.1", mountpoint="/mnt", fs_type="nfs4", options="rw,noresvport", ) ], ) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert 1 == len(mounts) assert "mnt.2049" in mounts
def test_local_nfs_mount(tmpdir): mount_file = _create_mount_file( tmpdir, [ MOUNT_FMT_LINE.format( address="127.0.0.1", mountpoint="/mnt", fs_type="nfs4", options=DEFAULT_OPTS, ) ], ) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert 1 == len(mounts) assert "mnt.12345" in mounts
def test_no_mounts(tmpdir): mount_file = _create_mount_file(tmpdir, []) mounts = watchdog.get_current_local_nfs_mounts(mount_file) assert {} == mounts