Example #1
0
def _main(options):
    'Command line entry point.'
    hrdw = []
    detect_areca(hrdw)
    detect_hpa(hrdw)
    detect_megacli(hrdw)
    detect_disks(hrdw)
    if not detect_system(hrdw):
        sys.exit(1)
    detect_ipmi(hrdw)
    detect_infiniband(hrdw)
    detect_temperatures(hrdw)
    detect_utils.get_ddr_timing(hrdw)
    detect_utils.ipmi_sdr(hrdw)
    detect_rtc_clock(hrdw)
    _, output = cmd("dmesg")
    parse_dmesg(hrdw, output)
    bios_hp.dump_hp_bios(hrdw)

    if "benchmark_cpu" in options:
        bm_cpu.cpu_perf(hrdw)

    if "benchmark_mem" in options:
        bm_mem.mem_perf(hrdw)

    if "benchmark_disk" in options:
        bm_disk.disk_perf(hrdw,
                          destructive=options['benchmark_disk_destructive'])

    hrdw = clean_tuples(hrdw)

    if "human" in options.keys():
        pprint.pprint(hrdw)
    else:
        print(json.dumps(hrdw))
Example #2
0
def _main(options):
    'Command line entry point.'
    hrdw = []
    detect_hpa(hrdw)
    detect_megacli(hrdw)
    detect_disks(hrdw)
    if not detect_system(hrdw):
        sys.exit(1)
    detect_ipmi(hrdw)
    detect_infiniband(hrdw)
    detect_temperatures(hrdw)
    detect_utils.get_ddr_timing(hrdw)
    detect_utils.ipmi_sdr(hrdw)
    _, output = cmd("dmesg")
    parse_dmesg(hrdw, output)

    if "benchmark_cpu" in options:
        bm_cpu.cpu_perf(hrdw)

    if "benchmark_mem" in options:
        bm_mem.mem_perf(hrdw)

    if "benchmark_disk" in options:
        bm_disk.disk_perf(hrdw,
                          destructive=options['benchmark_disk_destructive'])

    if "human" in options.keys():
        pprint.pprint(hrdw)
    else:
        print(json.dumps(hrdw))
Example #3
0
    def test_mem_perf_text(self, mock_popen, mock_cpu_socket, mock_get_memory):
        mock_get_memory.return_value = 123456789012
        mock_popen.return_value = mock.Mock(
            stdout=SYSBENCH_OUTPUT.splitlines())
        mock_cpu_socket.return_value = range(2)
        mem.mem_perf(self.hw_data)

        expected = EXPECTED_RESULT
        self.assertEqual(sorted(expected), sorted(self.hw_data))
Example #4
0
def main():
    """Command line entry point."""

    os.environ["LANG"] = "en_US.UTF-8"
    args = parse_args(sys.argv[1:])

    hrdw = []

    hrdw.extend(areca.detect())
    hrdw.extend(hpacucli.detect())
    hrdw.extend(megacli.detect())
    hrdw.extend(diskinfo.detect())

    system_info = system.detect()
    if not system_info:
        sys.exit(1)
    hrdw.extend(system_info)

    hrdw.extend(ipmi.detect())
    hrdw.extend(ib.detect())
    hrdw.extend(sensors.detect_temperatures())

    detect_utils.get_ddr_timing(hrdw)
    detect_utils.ipmi_sdr(hrdw)
    detect_rtc_clock(hrdw)
    detect_auxv(hrdw)
    parse_dmesg(hrdw)
    bios_hp.dump_hp_bios(hrdw)

    if args.benchmark:
        if 'cpu' in args.benchmark:
            bm_cpu.cpu_perf(hrdw)
        if 'mem' in args.benchmark:
            bm_mem.mem_perf(hrdw)
        if 'disk' in args.benchmark:
            bm_disk.disk_perf(hrdw,
                              destructive=args.benchmark_disk_destructive)

    hrdw = detect_utils.clean_tuples(hrdw)

    hrdw = list(filter(None, hrdw))

    if args.human:
        pprint.pprint(hrdw)
    else:
        print(json.dumps(hrdw))
    def test_mem_perf(self, mock_popen, mock_cpu_socket, mock_get_memory):
        mock_get_memory.return_value = 123456789012
        mock_popen.return_value = mock.Mock(stdout=SYSBENCH_OUTPUT)
        mock_cpu_socket.return_value = range(2)
        mem.mem_perf(self.hw_data)

        expected = [
            ('cpu', 'logical', 'number', 2),
            ('cpu', 'physical', 'number', 2),
            ('cpu', 'logical_0', 'bandwidth_1K', '382'),
            ('cpu', 'logical_0', 'bandwidth_4K', '382'),
            ('cpu', 'logical_0', 'bandwidth_1M', '382'),
            ('cpu', 'logical_0', 'bandwidth_16M', '382'),
            ('cpu', 'logical_0', 'bandwidth_128M', '382'),
            ('cpu', 'logical_0', 'bandwidth_1G', '382'),
            ('cpu', 'logical_0', 'bandwidth_2G', '382'),
            ('cpu', 'logical_1', 'bandwidth_1K', '382'),
            ('cpu', 'logical_1', 'bandwidth_4K', '382'),
            ('cpu', 'logical_1', 'bandwidth_1M', '382'),
            ('cpu', 'logical_1', 'bandwidth_16M', '382'),
            ('cpu', 'logical_1', 'bandwidth_128M', '382'),
            ('cpu', 'logical_1', 'bandwidth_1G', '382'),
            ('cpu', 'logical_1', 'bandwidth_2G', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_1K', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_4K', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_1M', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_16M', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_128M', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_1G', '382'),
            ('cpu', 'logical', 'threaded_bandwidth_2G', '382'),
            ('cpu', 'logical', 'forked_bandwidth_1K', '382'),
            ('cpu', 'logical', 'forked_bandwidth_4K', '382'),
            ('cpu', 'logical', 'forked_bandwidth_1M', '382'),
            ('cpu', 'logical', 'forked_bandwidth_16M', '382'),
            ('cpu', 'logical', 'forked_bandwidth_128M', '382'),
            ('cpu', 'logical', 'forked_bandwidth_1G', '382'),
            ('cpu', 'logical', 'forked_bandwidth_2G', '382')
        ]
        self.assertEqual(sorted(expected), sorted(self.hw_data))
Example #6
0
def main():
    """Command line entry point."""

    os.environ["LANG"] = "en_US.UTF-8"
    args = parse_args(sys.argv[1:])

    hrdw = []
    detect_areca(hrdw)
    detect_hpa(hrdw)
    detect_megacli(hrdw)
    detect_disks(hrdw)
    if not detect_system(hrdw):
        sys.exit(1)
    detect_ipmi(hrdw)
    detect_infiniband(hrdw)
    detect_temperatures(hrdw)
    detect_utils.get_ddr_timing(hrdw)
    detect_utils.ipmi_sdr(hrdw)
    detect_rtc_clock(hrdw)
    detect_auxv(hrdw)
    parse_dmesg(hrdw)
    bios_hp.dump_hp_bios(hrdw)

    if args.benchmark:
        if 'cpu' in args.benchmark:
            bm_cpu.cpu_perf(hrdw)
        if 'mem' in args.benchmark:
            bm_mem.mem_perf(hrdw)
        if 'disk' in args.benchmark:
            bm_disk.disk_perf(hrdw,
                              destructive=args.benchmark_disk_destructive)

    hrdw = clean_tuples(hrdw)

    if args.human:
        pprint.pprint(hrdw)
    else:
        print(json.dumps(hrdw))
Example #7
0
    def test_mem_perf(self, mock_popen, mock_cpu_socket, mock_get_memory):
        mock_get_memory.return_value = 123456789012
        mock_popen.return_value = mock.Mock(stdout=SYSBENCH_OUTPUT)
        mock_cpu_socket.return_value = range(2)
        mem.mem_perf(self.hw_data)

        expected = [('cpu', 'logical', 'number', 2),
                    ('cpu', 'physical', 'number', 2),
                    ('cpu', 'logical_0', 'bandwidth_1K', '382'),
                    ('cpu', 'logical_0', 'bandwidth_4K', '382'),
                    ('cpu', 'logical_0', 'bandwidth_1M', '382'),
                    ('cpu', 'logical_0', 'bandwidth_16M', '382'),
                    ('cpu', 'logical_0', 'bandwidth_128M', '382'),
                    ('cpu', 'logical_0', 'bandwidth_1G', '382'),
                    ('cpu', 'logical_0', 'bandwidth_2G', '382'),
                    ('cpu', 'logical_1', 'bandwidth_1K', '382'),
                    ('cpu', 'logical_1', 'bandwidth_4K', '382'),
                    ('cpu', 'logical_1', 'bandwidth_1M', '382'),
                    ('cpu', 'logical_1', 'bandwidth_16M', '382'),
                    ('cpu', 'logical_1', 'bandwidth_128M', '382'),
                    ('cpu', 'logical_1', 'bandwidth_1G', '382'),
                    ('cpu', 'logical_1', 'bandwidth_2G', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_1K', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_4K', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_1M', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_16M', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_128M', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_1G', '382'),
                    ('cpu', 'logical', 'threaded_bandwidth_2G', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_1K', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_4K', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_1M', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_16M', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_128M', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_1G', '382'),
                    ('cpu', 'logical', 'forked_bandwidth_2G', '382')]
        self.assertEqual(sorted(expected), sorted(self.hw_data))