Exemple #1
0
def test_check_sansymphony_pool_status_running_cache_mode_readwrite() -> None:
    section = {
        "Disk_pool_1":
        SansymphonyPool(
            name="Disk_pool_1",
            percent_allocated=57.0,
            status="Running",
            cache_mode="ReadWrite",
            pool_type="Dynamic",
        ),
    }
    assert list(
        check_sansymphony_pool(
            item="Disk_pool_1",
            params={"allocated_pools_percentage_upper": (80.0, 90.0)},
            section=section,
        )
    ) == [
        Result(
            state=State.OK,
            summary=
            "Dynamic pool Disk_pool_1 is Running, its cache is in ReadWrite mode",
        ),
        Result(state=State.OK, summary="Pool allocation: 57.00%"),
        Metric("pool_allocation",
               57.0,
               levels=(80.0, 90.0),
               boundaries=(0.0, 100.0)),
    ]
Exemple #2
0
def test_check_sansymphony_pool_item_not_found() -> None:
    section = {
        "Disk_pool_1":
        SansymphonyPool(
            name="Disk_pool_1",
            percent_allocated=57.0,
            status="Running",
            cache_mode="ReadWrite",
            pool_type="Dynamic",
        ),
    }
    assert (list(
        check_sansymphony_pool(
            item="Disk_pool_2",
            params={"allocated_pools_percentage_upper": (80.0, 90.0)},
            section=section,
        )) == [])