Пример #1
0
def test_check_disk(value_store):
    with pytest.raises(IgnoreResultsError):
        list(aix_diskiod._check_disk({}, DISK))
    assert list(aix_diskiod._check_disk({}, DISK)) == [
        Result(state=state.OK, summary='Read: 0.00 B/s'),
        Metric('disk_read_throughput', 0.0),
        Result(state=state.OK, summary='Write: 0.00 B/s'),
        Metric('disk_write_throughput', 0.0),
    ]
Пример #2
0
def test_check_disk():
    with pytest.raises(IgnoreResultsError):
        list(aix_diskiod._check_disk({}, DISK))
    assert list(aix_diskiod._check_disk({}, DISK)) == [
        Result(state=state.OK, summary="Read: 0.00 B/s"),
        Metric("disk_read_throughput", 0.0),
        Result(state=state.OK, summary="Write: 0.00 B/s"),
        Metric("disk_write_throughput", 0.0),
    ]
Пример #3
0
def test_check_disk():
    value_store: dict[str, Any] = {}
    now = 1647029464.27418

    with pytest.raises(IgnoreResultsError):
        list(aix_diskiod._check_disk({}, DISK, value_store, now))

    assert list(aix_diskiod._check_disk({}, DISK, value_store, now + 60)) == [
        Result(state=state.OK, summary="Read: 0.00 B/s"),
        Metric("disk_read_throughput", 0.0),
        Result(state=state.OK, summary="Write: 0.00 B/s"),
        Metric("disk_write_throughput", 0.0),
    ]
Пример #4
0
def test_check_disk(value_store):
    with pytest.raises(IgnoreResultsError):
        list(aix_diskiod._check_disk(type_defs.Parameters({}), DISK))
    assert list(aix_diskiod._check_disk(type_defs.Parameters({}), DISK)) == [
        Result(state=state.OK,
               summary='Read throughput: 0.00 B/s',
               details='Read throughput: 0.00 B/s'),
        Metric('disk_read_throughput',
               0.0,
               levels=(None, None),
               boundaries=(None, None)),
        Result(state=state.OK,
               summary='Write throughput: 0.00 B/s',
               details='Write throughput: 0.00 B/s'),
        Metric('disk_write_throughput',
               0.0,
               levels=(None, None),
               boundaries=(None, None)),
    ]
Пример #5
0
def test__check_disk():
    with value_store.context(CheckPluginName('_check_disk'), 'item'):
        check_disk_1 = list(
            aix_diskiod._check_disk(type_defs.Parameters({}), DISK))
        assert len(check_disk_1)
        assert isinstance(check_disk_1[0], IgnoreResults)
        assert list(aix_diskiod._check_disk(type_defs.Parameters(
            {}), DISK)) == [
                Result(state=state.OK,
                       summary='Read: 0.00 B/s',
                       details='Read: 0.00 B/s'),
                Metric('disk_read_throughput',
                       0.0,
                       levels=(None, None),
                       boundaries=(None, None)),
                Result(state=state.OK,
                       summary='Write: 0.00 B/s',
                       details='Write: 0.00 B/s'),
                Metric('disk_write_throughput',
                       0.0,
                       levels=(None, None),
                       boundaries=(None, None)),
            ]