コード例 #1
0
ファイル: test_areca.py プロジェクト: redhat-cip/hardware
 def test_hw_info(self):
     self.output = sample('areca_hw_info')
     self.assertEqual(areca.hw_info(),
                      {'Enclosure1/12V': '12.220',
                       'Enclosure1/12V/unit': 'V',
                       'Enclosure1/3.3V': '3.328',
                       'Enclosure1/3.3V/unit': 'V',
                       'Enclosure1/5V': '5.134',
                       'Enclosure1/5V/unit': 'V',
                       'Enclosure1/BatteryStatus': 100,
                       'Enclosure1/BatteryStatus/unit': '%',
                       'Enclosure1/ControllerTemp.': 37,
                       'Enclosure1/ControllerTemp./unit': 'C',
                       'Enclosure1/Cpu+1.2V': '1.216',
                       'Enclosure1/Cpu+1.2V/unit': 'V',
                       'Enclosure1/Cpu+1.8V': '1.856',
                       'Enclosure1/Cpu+1.8V/unit': 'V',
                       'Enclosure1/CpuFan': 2596,
                       'Enclosure1/CpuFan/unit': 'RPM',
                       'Enclosure1/CpuTemperature': 39,
                       'Enclosure1/CpuTemperature/unit': 'C',
                       'Enclosure1/Ddr-Ii+0.9V': '0.912',
                       'Enclosure1/Ddr-Ii+0.9V/unit': 'V',
                       'Enclosure1/Ddr-Ii+1.8V': '1.856',
                       'Enclosure1/Ddr-Ii+1.8V/unit': 'V',
                       'Enclosure1/Pci-E+1.8V': '1.856',
                       'Enclosure1/Pci-E+1.8V/unit': 'V'})
コード例 #2
0
ファイル: test_areca.py プロジェクト: redhat-cip/hardware
 def test_hddpwr_info(self):
     self.output = sample('areca_hddpwr_info')
     self.assertEqual(areca.hdd_pwr_info(),
                      {'StaggerPowerOnControl': '0.7',
                       'TimeToHddLowPowerIdle': 'Disabled',
                       'TimeToHddLowRpmMode': 'Disabled',
                       'TimeToSpinDownIdleHdd': 'Disabled'})
コード例 #3
0
ファイル: test_megacli.py プロジェクト: ErwanAliasr1/hardware
 def test_ld_get_info(self):
     self.output = sample('megacli_ld_get_info')
     self.assertEqual(megacli.ld_get_info(0, 0),
                      {'Adapter0--VirtualDriveInformation': '',
                       'BadBlocksExist': 'No',
                       'CacheCadeType': 'Read Only',
                       'CanSpinUpIn1Minute': 'Yes',
                       'CurrentAccessPolicy': 'Read/Write',
                       'CurrentCachePolicy':
                       'WriteBack, ReadAdaptive, Direct, '
                       'No Write Cache if Bad BBU',
                       'CurrentPowerSavingsPolicy': 'None',
                       'DefaultAccessPolicy': 'Read/Write',
                       'DefaultCachePolicy': 'WriteBack, ReadAdaptive, '
                       'Direct, No Write Cache if Bad BBU',
                       'DefaultPowerSavingsPolicy': 'Controller Defined',
                       'DiskCachePolicy': "Disk's Default",
                       'EncryptionType': 'None',
                       'IsVdCached': 'Yes',
                       "Ld'SIoProfileSupportsMaxPowerSavings"
                       "WithCachedWrites": 'No',
                       'LdHasDrivesThatSupportT10PowerConditions': 'No',
                       'MirrorData': '465.25 GB',
                       'Name': '',
                       'NumberOfDrives': 2,
                       'RaidLevel': 'Primary-1, Secondary-0, RAID Level '
                       'Qualifier-0',
                       'SectorSize': 512,
                       'Size': '465.25 GB',
                       'SpanDepth': 1,
                       'State': 'Optimal',
                       'StripSize': '64 KB'})
コード例 #4
0
ファイル: test_megacli.py プロジェクト: ErwanAliasr1/hardware
 def test_adp_all_info(self):
     self.output = sample('megacli_adp_all_info')
     self.assertEqual(megacli.adp_all_info(0),
                      {'CriticalDisks': 0,
                       'Degraded': 0,
                       'Disks': 6,
                       'FwPackageBuild': '21.1.0-0007',
                       'FailedDisks': 0,
                       'Offline': 0,
                       'PhysicalDevices': 7,
                       'ProductName': 'PERC H710 Mini',
                       'SerialNo': '29F026R',
                       'VirtualDrives': 1})
コード例 #5
0
ファイル: test_areca.py プロジェクト: redhat-cip/hardware
 def test_sys_info(self):
     self.output = sample('areca_sysinfo')
     self.assertEqual(areca.sys_info(),
                      {'MainProcessor': 800,
                       'MainProcessor/unit': 'MHz',
                       'CpuIcacheSize': 32,
                       'CpuIcacheSize/unit': 'KB',
                       'CpuDcacheSize': 32,
                       'CpuDcacheSize/unit': 'KB',
                       'CpuScacheSize': 512,
                       'CpuScacheSize/unit': 'KB',
                       'SystemMemory': '256MB/533MHz/ECC',
                       'FirmwareVersion': 'V1.49 2011-08-10',
                       'BootRomVersion': 'V1.49 2010-12-02',
                       'SerialNumber': 'Y106CABRAR200408',
                       'ControllerName': 'ARC-1222',
                       'CurrentIpAddress': '192.168.1.100'})
コード例 #6
0
ファイル: test_detect.py プロジェクト: redhat-cip/hardware
 def test_detect_system_3(self, mock_cmd, mock_get_uuid, mock_get_cpus, mock_output_lines):
     result = []
     detect.detect_system(result, sample('lshw3'))
     self.assertEqual(
         result,
         [('system', 'product', 'serial', 'Empty'),
          ('system', 'product', 'name', 'S2915'),
          ('system', 'product', 'vendor', 'Tyan Computer Corporation'),
          ('system', 'product', 'version', 'REFERENCE'),
          ('system', 'product', 'uuid', '83462C81-52BA-11CB-870F'),
          ('system', 'motherboard', 'name', 'S2915'),
          ('system', 'motherboard', 'vendor', 'Tyan Computer Corporation'),
          ('system', 'motherboard', 'version', 'REFERENCE'),
          ('system', 'motherboard', 'serial', 'Empty'),
          ('firmware', 'bios', 'version', 'v3.00.2915 (10/10/2008)'),
          ('firmware', 'bios', 'vendor', 'Phoenix Technologies Ltd.'),
          ('memory', 'total', 'size', '4294967296'),
          ('memory', 'bank:0:0', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:0', 'slot', 'C0_DIMM0'),
          ('memory', 'bank:0:1', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:1', 'slot', 'C0_DIMM1'),
          ('memory', 'bank:0:2', 'size', '1073741824'),
          ('memory', 'bank:0:2', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:2', 'slot', 'C0_DIMM2'),
          ('memory', 'bank:0:3', 'size', '1073741824'),
          ('memory', 'bank:0:3', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:3', 'slot', 'C0_DIMM3'),
          ('memory', 'bank:0:4', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:4', 'slot', 'C0_DIMM0'),
          ('memory', 'bank:0:5', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:5', 'slot', 'C1_DIMM1'),
          ('memory', 'bank:0:6', 'size', '1073741824'),
          ('memory', 'bank:0:6', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:6', 'slot', 'C1_DIMM2'),
          ('memory', 'bank:0:7', 'size', '1073741824'),
          ('memory', 'bank:0:7', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:7', 'slot', 'C1_DIMM3'),
          ('memory', 'banks', 'count', '8'),
          ('system', 'os', 'vendor', 'Ubuntu'),
          ('system', 'os', 'version', 'Ubuntu 14.04 LTS'),
          ('system', 'kernel', 'version', '3.13.0-24-generic'),
          ('system', 'kernel', 'arch', 'x86_64'),
          ('system', 'kernel', 'cmdline', 'BOOT_IMAGE=/boot/vmlinuz'),
          ]
     )
コード例 #7
0
ファイル: test_areca.py プロジェクト: redhat-cip/hardware
 def test_diskinfo(self):
     self.output = sample('areca_disks_info')
     self.assertEqual(areca.disk_info(1),
                      {'DeviceLocation': 'Enclosure#1 Slot#8',
                       'DeviceState': 'NORMAL',
                       'DeviceTemperature': 27,
                       'DeviceTemperature/unit': 'C',
                       'DeviceType': 'SATA(5001B4D4188DF017)',
                       'DiskCapacity': '1000.2',
                       'DiskCapacity/unit': 'GB',
                       'FirmwareRev.': 'JP4OA3MA',
                       'MediaErrorCount': 0,
                       'ModelName': 'Hitachi HDS721010CLA330',
                       'SerialNumber': 'JPS930N121H4YV',
                       'SmartCalibrationRetries': 'N.A.(N.A.)',
                       'SmartReadErrorRate': '100(16)',
                       'SmartReallocationCount': '100(5)',
                       'SmartSeekErrorRate': '100(67)',
                       'SmartSpinupRetries': '100(60)',
                       'SmartSpinupTime': '122(24)',
                       'TimeoutCount': 0})
コード例 #8
0
ファイル: test_areca.py プロジェクト: redhat-cip/hardware
 def test_sys_showcfg(self):
     self.output = sample('areca_sys_showcfg')
     self.assertEqual(areca.sys_showcfg(),
                      {'SystemBeeperSetting': 'Enabled',
                       'BackgroundTaskPriority': 'High(80%)',
                       'Jbod/RaidConfiguration': 'JBOD',
                       'SataNcqSupport': 'Enabled',
                       'HddReadAheadCache': 'Enabled',
                       'VolumeDataReadAhead': 'Normal',
                       'HddQueueDepth': 8,
                       'EmptyHddSlotLed': 'ON',
                       'CpuFanDetection': 'Disabled',
                       'SasMuxSetting': 'Auto',
                       'Ses2Support': 'Enabled',
                       'MaxCommandLength': '148K',
                       'AutoActivateIncompleteRaid': 'Disabled',
                       'DiskWriteCacheMode': 'Disabled',
                       'WriteSameForInitialization': 'SAS And SATA',
                       'HotPluggedDiskForRebuilding': 'Blank Disk Only',
                       'DiskCapacityTruncationMode': 'Multiples Of 10G',
                       'SmartOptionForHdd': 'Failed The Drive',
                       'SmartPollingInterval': 'On Demand'})
コード例 #9
0
ファイル: test_areca.py プロジェクト: redhat-cip/hardware
 def test_adsys_info(self):
     self.output = sample('areca_adsysinfo')
     self.assertEqual(areca.adsys_info(),
                      {'TlerSetting': 7,
                       'TlerSetting/unit': 'Seconds',
                       'TimeoutSetting': 8,
                       'TimeoutSetting/unit': 'Seconds',
                       'RetryCountSetting': 2,
                       'RetryCountSetting/unit': 'Times',
                       'BufferThreshold': 25,
                       'BufferThreshold/unit': '%',
                       'AmountOfReadAhead': 'Auto',
                       'NumberOfAvStreams': 6,
                       'OptimizeAvRecoding': 'Disabled',
                       'PhyStatus': 'Default',
                       'ReadPerformanceMargin': 0,
                       'ReadPerformanceMargin/unit': '%',
                       'WritePerformanceMargin': 0,
                       'WritePerformanceMargin/unit': '%',
                       'ReadAndDiscardParityData': 'Disabled',
                       'HitachiSataHddSpeed': 'Default',
                       'WdcSataHddSpeed': 'Default',
                       'SeagateSataHddSpeed': 'Default'})
コード例 #10
0
ファイル: test_megacli.py プロジェクト: ErwanAliasr1/hardware
                          'WriteBack, ReadAdaptive, Direct, '
                          'No Write Cache if Bad BBU',
                          'CurrentPowerSavingsPolicy': 'None',
                          'DefaultAccessPolicy': 'Read/Write',
                          'DefaultCachePolicy': 'WriteBack, ReadAdaptive, '
                          'Direct, No Write Cache if Bad BBU',
                          'DefaultPowerSavingsPolicy': 'Controller Defined',
                          'DiskCachePolicy': "Disk's Default",
                          'EncryptionType': 'None',
                          'IsVdCached': 'Yes',
                          "Ld'SIoProfileSupportsMaxPowerSavings"
                          "WithCachedWrites": 'No',
                          'LdHasDrivesThatSupportT10PowerConditions': 'No',
                          'MirrorData': '465.25 GB',
                          'Name': '',
                          'NumberOfDrives': 2,
                          'RaidLevel': 'Primary-1, Secondary-0, RAID Level '
                          'Qualifier-0',
                          'SectorSize': 512,
                          'Size': '465.25 GB',
                          'SpanDepth': 1,
                          'State': 'Optimal',
                          'StripSize': '64 KB'})

ENC_OUTPUT = sample('megacli_enc')

if __name__ == "__main__":
    unittest.main()

# test_megacli.py ends here
コード例 #11
0
         Model: ATA     MB2000GBUPB
         SATA NCQ Capable: True
         SATA NCQ Enabled: True
         Current Temperature (C): 32
         Maximum Temperature (C): 36
         PHY Count: 1
         PHY Transfer Rate: 6.0Gbps
         Drive Authentication Status: OK
         Carrier Application Version: 11
         Carrier Bootloader Version: 6


'''

# => ctrl slot=2 ld 1 show
CTRL_LD_SHOW_OUTPUT = sample('ctrl_ld_show')

CTRL_LD_SHOW_RESULT = {
    'Caching': 'Enabled',
    'Caching Association': 'None',
    'Cylinders': '23934',
    'Disk Name': '/dev/sda',
    'Drive Type': 'Data',
    'Fault Tolerance': '1',
    'Full Stripe Size': '256 KB',
    'Heads': '255',
    'Logical Drive': '1',
    'Logical Drive Label': 'A299BBB1PDKRH0ARH4F1R6D4B9',
    'Mirror Group 0': '2I:1:7',
    'Mirror Group 1': '2I:1:8',
    'Mount Points': 'None',
コード例 #12
0
 def test_parse_ipmi_sdr(self):
     hw = []
     detect_utils.parse_ipmi_sdr(hw, sample('parse_ipmi_sdr').split('\n'))
     self.assertEqual(hw, parse_ipmi_sdr.get_ipmi_sdr_result())
コード例 #13
0
ファイル: test_ethtool.py プロジェクト: ErwanAliasr1/hardware
        return self.assertEqual(
            detect_utils.parse_ethtool([], "enp0s25", ETHTOOL_K.split('\n')),
            ETHTOOL_K_RESULTS)


##############################################################################
# Output from real commands and expected results below
##############################################################################

ETHTOOL_A = '''Pause parameters for enp0s25:
Autonegotiate:	on
RX:		on
TX:		on
'''

ETHTOOL_K = sample('ethtool_k')

ETHTOOL_A_RESULTS = [('network', 'enp0s25', 'Autonegotiate', 'on'),
                     ('network', 'enp0s25', 'RX', 'on'),
                     ('network', 'enp0s25', 'TX', 'on')]

ETHTOOL_K_RESULTS = [
    ('network', 'enp0s25', 'rx-checksumming', 'on'),
    ('network', 'enp0s25', 'tx-checksumming', 'on'),
    ('network', 'enp0s25', 'tx-checksumming/tx-checksum-ipv4', 'off [fixed]'),
    ('network', 'enp0s25', 'tx-checksumming/tx-checksum-ip-generic', 'on'),
    ('network', 'enp0s25', 'tx-checksumming/tx-checksum-ipv6', 'off [fixed]'),
    ('network', 'enp0s25', 'tx-checksumming/tx-checksum-fcoe-crc',
     'off [fixed]'),
    ('network', 'enp0s25', 'tx-checksumming/tx-checksum-sctp', 'off [fixed]'),
    ('network', 'enp0s25', 'scatter-gather', 'on'),
コード例 #14
0
ファイル: test_detect.py プロジェクト: ErwanAliasr1/hardware
 def test_detect_system_2(self):
     l = []
     self._save_functions("4", 1)
     detect.detect_system(l, sample('lshw2'))
     self._restore_functions()
     self.assertEqual(
         l,
         [('system', 'product', 'serial', 'PB4F20N'),
          ('system', 'product', 'name', '2347GF8 (LENOVO_MT_2347)'),
          ('system', 'product', 'vendor', 'LENOVO'),
          ('system', 'product', 'version', 'ThinkPad T430'),
          ('system', 'product', 'uuid', '83462C81-52BA-11CB-870F'),
          ('system', 'motherboard', 'name', '2347GF8'),
          ('system', 'motherboard', 'vendor', 'LENOVO'),
          ('system', 'motherboard', 'version', 'Not Defined'),
          ('system', 'motherboard', 'serial', '1ZLMB31B1G6'),
          ('firmware', 'bios', 'version', 'G1ET73WW (2.09 )'),
          ('firmware', 'bios', 'date', '10/19/2012'),
          ('firmware', 'bios', 'vendor', 'LENOVO'),
          ('memory', 'total', 'size', '8589934592'),
          ('memory', 'bank:0', 'size', '4294967296'),
          ('memory', 'bank:0', 'clock', '1600000000'),
          ('memory', 'bank:0', 'description',
           'SODIMM DDR3 Synchrone 1600 MHz (0,6 ns)'),
          ('memory', 'bank:0', 'vendor', 'Samsung'),
          ('memory', 'bank:0', 'product', 'M471B5273CH0-CK0'),
          ('memory', 'bank:0', 'serial', '1222BCCE'),
          ('memory', 'bank:0', 'slot', 'ChannelA-DIMM0'),
          ('memory', 'bank:1', 'size', '4294967296'),
          ('memory', 'bank:1', 'clock', '1600000000'),
          ('memory', 'bank:1', 'description',
           'SODIMM DDR3 Synchrone 1600 MHz (0,6 ns)'),
          ('memory', 'bank:1', 'vendor', 'Samsung'),
          ('memory', 'bank:1', 'product', 'M471B5273CH0-CK0'),
          ('memory', 'bank:1', 'serial', '1222BCA2'),
          ('memory', 'bank:1', 'slot', 'ChannelB-DIMM0'),
          ('memory', 'banks', 'count', '2'),
          ('network', 'eth0', 'businfo', '[email protected]:00:19.0'),
          ('network', 'eth0', 'vendor', 'Intel Corporation'),
          ('network', 'eth0', 'product',
           '82579LM Gigabit Network Connection'),
          ('network', 'eth0', 'firmware', '0.13-3'),
          ('network', 'eth0', 'link', 'no'),
          ('network', 'eth0', 'driver', 'e1000e'),
          ('network', 'eth0', 'latency', '0'),
          ('network', 'eth0', 'autonegotiation', 'on'),
          ('network', 'eth0', 'serial', '00:21:cc:d9:bf:26'),
          ('network', 'wlan0', 'businfo', '[email protected]:03:00.0'),
          ('network', 'wlan0', 'vendor', 'Intel Corporation'),
          ('network', 'wlan0', 'product',
           'Centrino Advanced-N 6205 [Taylor Peak]'),
          ('network', 'wlan0', 'firmware', '18.168.6.1'),
          ('network', 'wlan0', 'ipv4', '192.168.1.185'),
          ('network', 'wlan0', 'ipv4-netmask', '255.255.255.0'),
          ('network', 'wlan0', 'ipv4-cidr', '24'),
          ('network', 'wlan0', 'ipv4-network', '192.168.1.0'),
          ('network', 'wlan0', 'link', 'yes'),
          ('network', 'wlan0', 'driver', 'iwlwifi'),
          ('network', 'wlan0', 'latency', '0'),
          ('network', 'wlan0', 'serial', '84:3a:4b:33:62:82'),
          ('network', 'wwan0', 'firmware',
           'Mobile Broadband Network Device'),
          ('network', 'wwan0', 'link', 'no'),
          ('network', 'wwan0', 'driver', 'cdc_ncm'),
          ('network', 'wwan0', 'serial', '02:15:e0:ec:01:00'),
          ('cpu', 'physical_0', 'physid', '1'),
          ('cpu', 'physical_0', 'product',
           'Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz'),
          ('cpu', 'physical_0', 'vendor', 'Intel Corp.'),
          ('cpu', 'physical_0', 'version',
           'Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz'),
          ('cpu', 'physical_0', 'frequency', '2601000000'),
          ('cpu', 'physical_0', 'clock', '100000000'),
          ('cpu', 'physical_0', 'cores', '2'),
          ('cpu', 'physical_0', 'enabled_cores', '2'),
          ('cpu', 'physical_0', 'threads', '4'),
          ('cpu', 'physical_0', 'flags',
           'x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 '
           'apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr '
           'sse sse2 ss ht tm pbe syscall nx rdtscp constant_tsc '
           'arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc '
           'aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx '
           'smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic '
           'popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm '
           'ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi '
           'flexpriority ept vpid fsgsbase smep erms cpufreq'),
          ('cpu', 'physical', 'number', '1'),
          ('cpu', 'logical', 'number', '4'),
          ('system', 'os', 'vendor', 'Ubuntu'),
          ('system', 'os', 'version', 'Ubuntu 14.04 LTS'),
          ('system', 'kernel', 'version', '3.13.0-24-generic'),
          ('system', 'kernel', 'arch', 'x86_64'),
          ('system', 'kernel', 'cmdline', 'BOOT_IMAGE=/boot/vmlinuz'),
          ]
         )
コード例 #15
0
ファイル: test_detect.py プロジェクト: ErwanAliasr1/hardware
 def test_parse_dmesg(self):
     hw = []
     detect.parse_dmesg(hw, sample('dmesg'))
     self.assertEqual(hw, [('ahci', '0000:00:1f.2:', 'flags',
                            '64bit apst clo ems led '
                            'ncq part pio slum sntf')])
コード例 #16
0
ファイル: test_detect.py プロジェクト: redhat-cip/hardware
 def test_detect_system_2(self, mock_cmd, mock_get_uuid, mock_get_cpus, mock_output_lines):
     result = []
     detect.detect_system(result, sample('lshw2'))
     self.assertEqual(
         result,
         [('system', 'product', 'serial', 'PB4F20N'),
          ('system', 'product', 'name', '2347GF8 (LENOVO_MT_2347)'),
          ('system', 'product', 'vendor', 'LENOVO'),
          ('system', 'product', 'version', 'ThinkPad T430'),
          ('system', 'product', 'uuid', '83462C81-52BA-11CB-870F'),
          ('system', 'motherboard', 'name', '2347GF8'),
          ('system', 'motherboard', 'vendor', 'LENOVO'),
          ('system', 'motherboard', 'version', 'Not Defined'),
          ('system', 'motherboard', 'serial', '1ZLMB31B1G6'),
          ('firmware', 'bios', 'version', 'G1ET73WW (2.09 )'),
          ('firmware', 'bios', 'date', '10/19/2012'),
          ('firmware', 'bios', 'vendor', 'LENOVO'),
          ('memory', 'total', 'size', '8589934592'),
          ('memory', 'bank:0', 'size', '4294967296'),
          ('memory', 'bank:0', 'clock', '1600000000'),
          ('memory', 'bank:0', 'description',
           'SODIMM DDR3 Synchrone 1600 MHz (0,6 ns)'),
          ('memory', 'bank:0', 'vendor', 'Samsung'),
          ('memory', 'bank:0', 'product', 'M471B5273CH0-CK0'),
          ('memory', 'bank:0', 'serial', '1222BCCE'),
          ('memory', 'bank:0', 'slot', 'ChannelA-DIMM0'),
          ('memory', 'bank:1', 'size', '4294967296'),
          ('memory', 'bank:1', 'clock', '1600000000'),
          ('memory', 'bank:1', 'description',
           'SODIMM DDR3 Synchrone 1600 MHz (0,6 ns)'),
          ('memory', 'bank:1', 'vendor', 'Samsung'),
          ('memory', 'bank:1', 'product', 'M471B5273CH0-CK0'),
          ('memory', 'bank:1', 'serial', '1222BCA2'),
          ('memory', 'bank:1', 'slot', 'ChannelB-DIMM0'),
          ('memory', 'banks', 'count', '2'),
          ('network', 'eth0', 'businfo', '[email protected]:00:19.0'),
          ('network', 'eth0', 'vendor', 'Intel Corporation'),
          ('network', 'eth0', 'product',
           '82579LM Gigabit Network Connection'),
          ('network', 'eth0', 'firmware', '0.13-3'),
          ('network', 'eth0', 'link', 'no'),
          ('network', 'eth0', 'driver', 'e1000e'),
          ('network', 'eth0', 'latency', '0'),
          ('network', 'eth0', 'autonegotiation', 'on'),
          ('network', 'eth0', 'serial', '00:21:cc:d9:bf:26'),
          ('network', 'wlan0', 'businfo', '[email protected]:03:00.0'),
          ('network', 'wlan0', 'vendor', 'Intel Corporation'),
          ('network', 'wlan0', 'product',
           'Centrino Advanced-N 6205 [Taylor Peak]'),
          ('network', 'wlan0', 'firmware', '18.168.6.1'),
          ('network', 'wlan0', 'ipv4', '192.168.1.185'),
          ('network', 'wlan0', 'ipv4-netmask', '255.255.255.0'),
          ('network', 'wlan0', 'ipv4-cidr', '24'),
          ('network', 'wlan0', 'ipv4-network', '192.168.1.0'),
          ('network', 'wlan0', 'link', 'yes'),
          ('network', 'wlan0', 'driver', 'iwlwifi'),
          ('network', 'wlan0', 'latency', '0'),
          ('network', 'wlan0', 'serial', '84:3a:4b:33:62:82'),
          ('network', 'wwan0', 'firmware',
           'Mobile Broadband Network Device'),
          ('network', 'wwan0', 'link', 'no'),
          ('network', 'wwan0', 'driver', 'cdc_ncm'),
          ('network', 'wwan0', 'serial', '02:15:e0:ec:01:00'),
          ('system', 'os', 'vendor', 'Ubuntu'),
          ('system', 'os', 'version', 'Ubuntu 14.04 LTS'),
          ('system', 'kernel', 'version', '3.13.0-24-generic'),
          ('system', 'kernel', 'arch', 'x86_64'),
          ('system', 'kernel', 'cmdline', 'BOOT_IMAGE=/boot/vmlinuz'),
          ]
     )
コード例 #17
0
ファイル: test_ipmi.py プロジェクト: ErwanAliasr1/hardware
 def test_parse_lan_info(self):
     res = []
     ipmi.parse_lan_info(sample('ipmi_lan_info'), res)
     self.assertEqual(len(res), 19)
コード例 #18
0
ファイル: test_detect.py プロジェクト: redhat-cip/hardware
 def test_detect_system(self, mock_cmd, mock_get_uuid, mock_get_cpus, mock_output_lines):
     result = []
     detect.detect_system(result, sample('lshw'))
     self.assertEqual(
         result,
         [('system', 'product', 'serial', 'C02JR02WF57J'),
          ('system', 'product', 'name', 'MacBookAir5,2 (System SKU#)'),
          ('system', 'product', 'vendor', 'Apple Inc.'),
          ('system', 'product', 'version', '1.0'),
          ('system', 'product', 'uuid', '83462C81-52BA-11CB-870F'),
          ('system', 'motherboard', 'name', 'Mac-2E6FAB96566FE58C'),
          ('system', 'motherboard', 'vendor', 'Apple Inc.'),
          ('system', 'motherboard', 'version', 'MacBookAir5,2'),
          ('system', 'motherboard', 'serial', 'C02245301ZFF25WAT'),
          ('firmware', 'bios', 'version', 'MBA51.88Z.00EF.B01.1207271122'),
          ('firmware', 'bios', 'date', '07/27/2012'),
          ('firmware', 'bios', 'vendor', 'Apple Inc.'),
          ('memory', 'total', 'size', '8589934592'),
          ('memory', 'bank:0', 'size', '4294967296'),
          ('memory', 'bank:0', 'clock', '1600000000'),
          ('memory', 'bank:0', 'description',
           'SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)'),
          ('memory', 'bank:0', 'vendor',
           'Hynix Semiconductor (Hyundai Electronics)'),
          ('memory', 'bank:0', 'product', 'HMT451S6MFR8A-PB'),
          ('memory', 'bank:0', 'serial', '0x00000000'),
          ('memory', 'bank:0', 'slot', 'DIMM0'),
          ('memory', 'bank:1', 'size', '4294967296'),
          ('memory', 'bank:1', 'clock', '1600000000'),
          ('memory', 'bank:1', 'description',
           'SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)'),
          ('memory', 'bank:1', 'vendor',
           'Hynix Semiconductor (Hyundai Electronics)'),
          ('memory', 'bank:1', 'product', 'HMT451S6MFR8A-PB'),
          ('memory', 'bank:1', 'serial', '0x00000000'),
          ('memory', 'bank:1', 'slot', 'DIMM0'),
          ('memory', 'banks', 'count', '2'),
          ('network', 'vnet0', 'size', '10000000'),
          ('network', 'vnet0', 'link', 'yes'),
          ('network', 'vnet0', 'driver', 'tun'),
          ('network', 'vnet0', 'duplex', 'full'),
          ('network', 'vnet0', 'speed', '10Mbit/s'),
          ('network', 'vnet0', 'autonegotiation', 'off'),
          ('network', 'vnet0', 'serial', 'fe:54:00:c1:1a:f7'),
          ('network', 'tap0', 'size', '10000000'),
          ('network', 'tap0', 'ipv4', '10.152.18.103'),
          ('network', 'tap0', 'ipv4-netmask', '255.255.255.0'),
          ('network', 'tap0', 'ipv4-cidr', '24'),
          ('network', 'tap0', 'ipv4-network', '10.152.18.0'),
          ('network', 'tap0', 'link', 'yes'),
          ('network', 'tap0', 'driver', 'tun'),
          ('network', 'tap0', 'duplex', 'full'),
          ('network', 'tap0', 'speed', '10Mbit/s'),
          ('network', 'tap0', 'autonegotiation', 'off'),
          ('network', 'tap0', 'serial', 'e2:66:69:22:be:fb'),
          ('network', 'wlan0', 'firmware', 'N/A'),
          ('network', 'wlan0', 'ipv4', '192.168.12.13'),
          ('network', 'wlan0', 'ipv4-netmask', '255.255.255.0'),
          ('network', 'wlan0', 'ipv4-cidr', '24'),
          ('network', 'wlan0', 'ipv4-network', '192.168.12.0'),
          ('network', 'wlan0', 'link', 'yes'),
          ('network', 'wlan0', 'driver', 'brcmsmac'),
          ('network', 'wlan0', 'serial', '00:88:65:35:2b:50'),
          ('system', 'os', 'vendor', 'Ubuntu'),
          ('system', 'os', 'version', 'Ubuntu 14.04 LTS'),
          ('system', 'kernel', 'version', '3.13.0-24-generic'),
          ('system', 'kernel', 'arch', 'x86_64'),
          ('system', 'kernel', 'cmdline', 'BOOT_IMAGE=/boot/vmlinuz'),
          ]
     )
コード例 #19
0
ファイル: test_megacli.py プロジェクト: ErwanAliasr1/hardware
 def test_parse_output_adpcount(self):
     self.assertEqual(megacli.parse_output(sample('megacli_adpcount')),
                      {'ControllerCount': 1,
                       'ExitCode': '0x01'})
コード例 #20
0
ファイル: test_detect.py プロジェクト: ErwanAliasr1/hardware
 def test_detect_system_3(self):
     l = []
     self._save_functions("4", 2)
     detect.detect_system(l, sample('lshw3'))
     self._restore_functions()
     self.assertEqual(
         l,
         [('system', 'product', 'serial', 'Empty'),
          ('system', 'product', 'name', 'S2915'),
          ('system', 'product', 'vendor', 'Tyan Computer Corporation'),
          ('system', 'product', 'version', 'REFERENCE'),
          ('system', 'product', 'uuid', '83462C81-52BA-11CB-870F'),
          ('system', 'motherboard', 'name', 'S2915'),
          ('system', 'motherboard', 'vendor', 'Tyan Computer Corporation'),
          ('system', 'motherboard', 'version', 'REFERENCE'),
          ('system', 'motherboard', 'serial', 'Empty'),
          ('firmware', 'bios', 'version', 'v3.00.2915 (10/10/2008)'),
          ('firmware', 'bios', 'vendor', 'Phoenix Technologies Ltd.'),
          ('memory', 'total', 'size', '4294967296'),
          ('memory', 'bank:0:0', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:0', 'slot', 'C0_DIMM0'),
          ('memory', 'bank:0:1', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:1', 'slot', 'C0_DIMM1'),
          ('memory', 'bank:0:2', 'size', '1073741824'),
          ('memory', 'bank:0:2', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:2', 'slot', 'C0_DIMM2'),
          ('memory', 'bank:0:3', 'size', '1073741824'),
          ('memory', 'bank:0:3', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:3', 'slot', 'C0_DIMM3'),
          ('memory', 'bank:0:4', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:4', 'slot', 'C0_DIMM0'),
          ('memory', 'bank:0:5', 'description', 'DIMM Synchronous [empty]'),
          ('memory', 'bank:0:5', 'slot', 'C1_DIMM1'),
          ('memory', 'bank:0:6', 'size', '1073741824'),
          ('memory', 'bank:0:6', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:6', 'slot', 'C1_DIMM2'),
          ('memory', 'bank:0:7', 'size', '1073741824'),
          ('memory', 'bank:0:7', 'description', 'DIMM Synchronous'),
          ('memory', 'bank:0:7', 'slot', 'C1_DIMM3'),
          ('memory', 'banks', 'count', '8'),
          ('cpu', 'physical_0', 'physid', '3'),
          ('cpu', 'physical_0', 'product',
           'Dual-Core AMD Opteron(tm) Processor 8218'),
          ('cpu', 'physical_0', 'vendor', 'Advanced Micro Devices [AMD]'),
          ('cpu', 'physical_0', 'version', 'AMD'),
          ('cpu', 'physical_0', 'frequency', '1000000000'),
          ('cpu', 'physical_0', 'clock', '200000000'),
          ('cpu', 'physical_0', 'flags',
           'fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic '
           'sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht '
           'syscall nx mmxext fxsr_opt rdtscp x86-64 3dnowext 3dnow '
           'rep_good nopl extd_apicid pni cx16 lahf_lm cmp_legacy svm '
           'extapic cr8_legacy cpufreq'),
          ('cpu', 'physical_1', 'physid', '4'),
          ('cpu', 'physical_1', 'product',
           'Dual-Core AMD Opteron(tm) Processor 8218'),
          ('cpu', 'physical_1', 'vendor', 'Advanced Micro Devices [AMD]'),
          ('cpu', 'physical_1', 'version', 'AMD'),
          ('cpu', 'physical_1', 'frequency', '1000000000'),
          ('cpu', 'physical_1', 'clock', '200000000'),
          ('cpu', 'physical_1', 'flags',
           'fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep '
           'mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht '
           'syscall nx mmxext fxsr_opt rdtscp x86-64 3dnowext 3dnow '
           'rep_good nopl extd_apicid pni cx16 lahf_lm cmp_legacy svm '
           'extapic cr8_legacy cpufreq'),
          ('cpu', 'physical', 'number', '2'),
          ('cpu', 'logical', 'number', '4'),
          ('system', 'os', 'vendor', 'Ubuntu'),
          ('system', 'os', 'version', 'Ubuntu 14.04 LTS'),
          ('system', 'kernel', 'version', '3.13.0-24-generic'),
          ('system', 'kernel', 'arch', 'x86_64'),
          ('system', 'kernel', 'cmdline', 'BOOT_IMAGE=/boot/vmlinuz'),
          ]
         )
コード例 #21
0
ファイル: test_megacli.py プロジェクト: ErwanAliasr1/hardware
 def test_adp_count(self):
     self.output = sample('megacli_adpcount')
     self.assertEqual(megacli.adp_count(), 1)
コード例 #22
0
ファイル: test_detect.py プロジェクト: ErwanAliasr1/hardware
 def test_detect_system(self):
     self.maxDiff = None
     l = []
     self._save_functions("7", 4)
     detect.detect_system(l, sample('lshw'))
     self._restore_functions()
     self.assertEqual(
         l,
         [('system', 'product', 'serial', 'C02JR02WF57J'),
          ('system', 'product', 'name', 'MacBookAir5,2 (System SKU#)'),
          ('system', 'product', 'vendor', 'Apple Inc.'),
          ('system', 'product', 'version', '1.0'),
          ('system', 'product', 'uuid', '83462C81-52BA-11CB-870F'),
          ('system', 'motherboard', 'name', 'Mac-2E6FAB96566FE58C'),
          ('system', 'motherboard', 'vendor', 'Apple Inc.'),
          ('system', 'motherboard', 'version', 'MacBookAir5,2'),
          ('system', 'motherboard', 'serial', 'C02245301ZFF25WAT'),
          ('firmware', 'bios', 'version', 'MBA51.88Z.00EF.B01.1207271122'),
          ('firmware', 'bios', 'date', '07/27/2012'),
          ('firmware', 'bios', 'vendor', 'Apple Inc.'),
          ('memory', 'total', 'size', '8589934592'),
          ('memory', 'bank:0', 'size', '4294967296'),
          ('memory', 'bank:0', 'clock', '1600000000'),
          ('memory', 'bank:0', 'description',
           'SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)'),
          ('memory', 'bank:0', 'vendor',
           'Hynix Semiconductor (Hyundai Electronics)'),
          ('memory', 'bank:0', 'product', 'HMT451S6MFR8A-PB'),
          ('memory', 'bank:0', 'serial', '0x00000000'),
          ('memory', 'bank:0', 'slot', 'DIMM0'),
          ('memory', 'bank:1', 'size', '4294967296'),
          ('memory', 'bank:1', 'clock', '1600000000'),
          ('memory', 'bank:1', 'description',
           'SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)'),
          ('memory', 'bank:1', 'vendor',
           'Hynix Semiconductor (Hyundai Electronics)'),
          ('memory', 'bank:1', 'product', 'HMT451S6MFR8A-PB'),
          ('memory', 'bank:1', 'serial', '0x00000000'),
          ('memory', 'bank:1', 'slot', 'DIMM0'),
          ('memory', 'banks', 'count', '2'),
          ('network', 'vnet0', 'size', '10000000'),
          ('network', 'vnet0', 'link', 'yes'),
          ('network', 'vnet0', 'driver', 'tun'),
          ('network', 'vnet0', 'duplex', 'full'),
          ('network', 'vnet0', 'speed', '10Mbit/s'),
          ('network', 'vnet0', 'autonegotiation', 'off'),
          ('network', 'vnet0', 'serial', 'fe:54:00:c1:1a:f7'),
          ('network', 'tap0', 'size', '10000000'),
          ('network', 'tap0', 'ipv4', '10.152.18.103'),
          ('network', 'tap0', 'ipv4-netmask', '255.255.255.0'),
          ('network', 'tap0', 'ipv4-cidr', '24'),
          ('network', 'tap0', 'ipv4-network', '10.152.18.0'),
          ('network', 'tap0', 'link', 'yes'),
          ('network', 'tap0', 'driver', 'tun'),
          ('network', 'tap0', 'duplex', 'full'),
          ('network', 'tap0', 'speed', '10Mbit/s'),
          ('network', 'tap0', 'autonegotiation', 'off'),
          ('network', 'tap0', 'serial', 'e2:66:69:22:be:fb'),
          ('network', 'wlan0', 'firmware', 'N/A'),
          ('network', 'wlan0', 'ipv4', '192.168.12.13'),
          ('network', 'wlan0', 'ipv4-netmask', '255.255.255.0'),
          ('network', 'wlan0', 'ipv4-cidr', '24'),
          ('network', 'wlan0', 'ipv4-network', '192.168.12.0'),
          ('network', 'wlan0', 'link', 'yes'),
          ('network', 'wlan0', 'driver', 'brcmsmac'),
          ('network', 'wlan0', 'serial', '00:88:65:35:2b:50'),
          ('cpu', 'physical_0', 'physid', '0'),
          ('cpu', 'physical_0', 'product',
           'Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz'),
          ('cpu', 'physical_0', 'vendor', 'Intel Corp.'),
          ('cpu', 'physical_0', 'version',
           'Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz'),
          ('cpu', 'physical_0', 'frequency', '800000000'),
          ('cpu', 'physical_0', 'clock', '25000000'),
          ('cpu', 'physical_0', 'flags',
           'fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep '
           'mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 '
           'ss ht tm pbe syscall nx rdtscp x86-64 constant_tsc '
           'arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc '
           'aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx '
           'smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic '
           'popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm '
           'ida arat xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority '
           'ept vpid fsgsbase smep erms cpufreq'),
          ('cpu', 'physical_1', 'physid', '5'),
          ('cpu', 'physical_1', 'vendor', 'Intel(R) Corporation'),
          ('cpu', 'physical_1', 'version',
           'Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz'),
          ('cpu', 'physical_1', 'frequency', '800000000'),
          ('cpu', 'physical_1', 'clock', '25000000'),
          ('cpu', 'physical_1', 'flags', 'cpufreq'),
          ('cpu', 'physical_2', 'physid', 'a'),
          ('cpu', 'physical_2', 'vendor', 'Intel(R) Corporation'),
          ('cpu', 'physical_2', 'version',
           'Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz'),
          ('cpu', 'physical_2', 'frequency', '800000000'),
          ('cpu', 'physical_2', 'clock', '25000000'),
          ('cpu', 'physical_2', 'flags', 'cpufreq'),
          ('cpu', 'physical_3', 'physid', 'f'),
          ('cpu', 'physical_3', 'vendor', 'Intel(R) Corporation'),
          ('cpu', 'physical_3', 'version',
           'Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz'),
          ('cpu', 'physical_3', 'frequency', '800000000'),
          ('cpu', 'physical_3', 'clock', '25000000'),
          ('cpu', 'physical_3', 'flags', 'cpufreq'),
          ('cpu', 'physical', 'number', '4'),
          ('cpu', 'logical', 'number', '7'),
          ('system', 'os', 'vendor', 'Ubuntu'),
          ('system', 'os', 'version', 'Ubuntu 14.04 LTS'),
          ('system', 'kernel', 'version', '3.13.0-24-generic'),
          ('system', 'kernel', 'arch', 'x86_64'),
          ('system', 'kernel', 'cmdline', 'BOOT_IMAGE=/boot/vmlinuz'),
          ]
         )
コード例 #23
0
ファイル: test_lldp.py プロジェクト: ErwanAliasr1/hardware
    def test_parse_lldp_tin(self):
        return self.assertEqual(
            detect_utils.parse_lldtool([], "eth0", LLDPTOOL_TIN.split('\n')),
            LLDPTOOL_TIN_RESULTS)

    def test_parse_lldp_tin2(self):
        return self.assertEqual(
            detect_utils.parse_lldtool([], "eth0", LLDPTOOL_TIN2.split('\n')),
            LLDPTOOL_TIN2_RESULTS)


##############################################################################
# Output from real commands and expected results below
##############################################################################

LLDPTOOL_TIN = sample('lldptool_tin')

LLDPTOOL_TIN2 = sample('lldptool_tin2')

LLDPTOOL_TIN_RESULTS = [
    ('lldp', 'eth0', 'Chassis ID/MAC',
     'f8:b1:56:15:e6:c6'),
    ('lldp', 'eth0', 'Port ID/Ifname', 'gi1_1'),
    ('lldp', 'eth0', 'Time to Live', '120'),
    ('lldp',
     'eth0',
     'MAC_PHY Configuration Status',
     'Auto-negotiation supported and enabled'),
    ('lldp',
     'eth0',
     'MAC_PHY Configuration Status/PMD auto-negotiation capabilities',