Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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
Beispiel #5
0
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
Beispiel #6
0
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
Beispiel #7
0
def test_no_mounts(tmpdir):
    mount_file = _create_mount_file(tmpdir, [])

    mounts = watchdog.get_current_local_nfs_mounts(mount_file)

    assert {} == mounts