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' })
def detect_areca(hw_lst): 'Detect Areca controller configuration' device = areca.sys_info() if not device: sys.stderr.write('Info: detect_areca: No controller found\n') return if "ControllerName" not in device.keys(): sys.stderr.write('Info: detect_areca: Cannot found controller name\n') return sys.stderr.write('Info: detect_areca: Found %s version %s\n' % (device['ControllerName'], device['FirmwareVersion'])) areca.disable_password() for info in device.keys(): hw_lst.append(('areca', 'system', info, device[info])) adsys = areca.adsys_info() for info in adsys.keys(): hw_lst.append(('areca', 'system', info, adsys[info])) cfg = areca.sys_showcfg() for info in cfg.keys(): hw_lst.append(('areca', 'config', info, cfg[info])) hw_info = areca.hw_info() for info in hw_info.keys(): hw_lst.append(('areca', 'hardware', info, hw_info[info])) pwr_info = areca.hdd_pwr_info() for info in pwr_info.keys(): hw_lst.append(('areca', 'power', info, pwr_info[info])) for disk_number in range(1, 255): disk_info = areca.disk_info(disk_number) # If we don't have info about that disk, let's stop here if len(disk_info) < 2: break # Extracting disk information for info in disk_info: hw_lst.append( ('areca', "disk%d" % disk_number, info, disk_info[info]))
def detect_areca(hw_lst): 'Detect Areca controller configuration' device = areca.sys_info() if not device: sys.stderr.write('Info: detect_areca: No controller found\n') return if "ControllerName" not in device.keys(): sys.stderr.write('Info: detect_areca: Cannot found controller name\n') return sys.stderr.write('Info: detect_areca: Found %s version %s\n' % (device['ControllerName'], device['FirmwareVersion'])) areca.disable_password() for info in device.keys(): hw_lst.append(('areca', 'system', info, device[info])) adsys = areca.adsys_info() for info in adsys.keys(): hw_lst.append(('areca', 'system', info, adsys[info])) cfg = areca.sys_showcfg() for info in cfg.keys(): hw_lst.append(('areca', 'config', info, cfg[info])) hw_info = areca.hw_info() for info in hw_info.keys(): hw_lst.append(('areca', 'hardware', info, hw_info[info])) pwr_info = areca.hdd_pwr_info() for info in pwr_info.keys(): hw_lst.append(('areca', 'power', info, pwr_info[info])) for disk_number in range(1, 255): disk_info = areca.disk_info(disk_number) # If we don't have info about that disk, let's stop here if len(disk_info) < 2: break # Extracting disk information for info in disk_info: hw_lst.append(('areca', "disk%d" % disk_number, info, disk_info[info]))
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'})