Ejemplo n.º 1
0
def test_inv_solaris_pkginfo() -> None:
    plugin = register.get_inventory_plugin(
        InventoryPluginName('solaris_pkginfo'))
    assert plugin
    with set_timezone("ETC-2"):
        result = list(plugin.inventory_function(INFO))
    assert result == RESULT
Ejemplo n.º 2
0
 def test_parse_rfc5424_syslog_info(
     self,
     event_creator: cmk.ec.main.EventCreator,
     line: str,
     expected_result: Mapping[str, Any],
 ) -> None:
     # this is currently needed because we do not use the timezone information from the log message
     with set_timezone("UTC"):
         assert event_creator._parse_rfc5424_syslog_info(
             line) == expected_result
def test_inventory():
    # Setting the timezone is needed, otherwise test results will differ between jenkins and local
    # runs
    with set_timezone("UTC"):
        actual = list(inv_esx_vsphere_hostsystem(section))
    assert actual == [
        Attributes(path=['hardware', 'cpu'],
                   inventory_attributes={
                       'max_speed': '2.93 GHz',
                       'cpus': '2',
                       'cores': '12',
                       'threads': '24',
                       'model': 'Intel(R) Xeon(R) CPU X5670 @ 2.93GHz',
                       'vendor': 'intel',
                       'bus_speed': '133 MHz',
                       'cores_per_cpu': '6',
                       'threads_per_cpu': '12'
                   },
                   status_attributes={}),
        Attributes(path=['software', 'bios'],
                   inventory_attributes={
                       'version': '-[ABIOSVERSION-1.0]-',
                       'date': '2000-01-26'
                   },
                   status_attributes={}),
        Attributes(path=['hardware', 'system'],
                   inventory_attributes={
                       'product': 'System x1 M3 -[123456]-',
                       'vendor': 'IBM',
                       'uuid': 'bar-foo'
                   },
                   status_attributes={}),
        Attributes(path=['hardware', 'memory'],
                   inventory_attributes={'total_ram_usable': '136 GiB'},
                   status_attributes={}),
    ]
Ejemplo n.º 4
0
def set_fixed_timezone():
    with set_timezone("UTC"):
        yield