Beispiel #1
0
def test_silly_mounts(fs: fake_filesystem.FakeFilesystem) -> None:
    fs.add_real_file(
        source_path=os.path.join(DATA_DIR, "mounts_silly.raw"),
        target_path="/proc/mounts",
    )

    from gravel.controllers.nodes.systemdisk import MountEntry, get_mounts

    lst: List[MountEntry] = get_mounts()
    assert len(lst) == 2
    assert lst[0].source == "foo" and lst[0].dest == "bar"
    assert lst[1].source == "asd" and lst[1].dest == "fgh"
Beispiel #2
0
def test_get_mounts(fs: fake_filesystem.FakeFilesystem) -> None:

    fs.add_real_file(
        source_path=os.path.join(DATA_DIR, "mounts_with_aquarium.raw"),
        target_path="/proc/mounts",
    )

    from gravel.controllers.nodes.systemdisk import MountEntry, get_mounts

    lst: List[MountEntry] = get_mounts()
    found = False
    for entry in lst:
        if (entry.source == "/dev/mapper/aquarium-systemdisk"
                and entry.dest == "/var/lib/aquarium-system"):
            found = True
            break
    assert found