def test_logical_disks(self):
     l = []
     load_samples(l)
     result = check.logical_disks(
         utils.find_sub_element(l, 'serial', 'disk'), 'serial')
     self.maxDiff = None
     for element in result:
         group = result[element]
     p = ['CZ3404YWP4', 'CZ3404YWNW', 'CZ3404YWP6', 'CZ3404YWNR',
          'CZ3404YWP2', 'CZ3404YWPS', 'CZ3404YWP8', 'CZ3404YWPX',
          'CZ3404YWNT', 'CZ3404YWR0', 'CZ3404YWPE', 'CZ3404YWPA',
          'CZ3404YWPP', 'CZ3404YWPC', 'CZ3404YWNN', 'CZ3404YWPM',
          'CZ3404YWPV', 'CZ3404YWPH', 'CZ3404YWPK']
     self.assertEqual(sorted(p), sorted(group))
     res = set([('disk', 'sdb', 'Write Cache Enable', '0'),
                ('disk', 'sdb', 'model', 'LOGICAL VOLUME'),
                ('disk', 'sdb', 'rev', '4.68'),
                ('disk', 'sdb', 'size', '299'),
                ('disk', 'sda', 'Write Cache Enable', '0'),
                ('disk', 'sdb', 'vendor', 'HP'),
                ('disk', 'sda', 'rev', '4.68'),
                ('disk', 'sda', 'Read Cache Disable', '0'),
                ('disk', 'sdb', 'Read Cache Disable', '0'),
                ('disk', 'sda', 'vendor', 'HP'),
                ('disk', 'sda', 'model', 'LOGICAL VOLUME'),
                ('disk', 'sda', 'size', '299')])
     self.assertEqual(sorted(res), sorted(eval(element)))
Beispiel #2
0
 def test_logical_disks(self):
     hw = []
     load_samples(hw)
     result = check.logical_disks(
         utils.find_sub_element(hw, 'serial', 'disk'), 'serial')
     self.maxDiff = None
     for element in result:
         group = result[element]
     p = [
         'CZ3404YWP4', 'CZ3404YWNW', 'CZ3404YWP6', 'CZ3404YWNR',
         'CZ3404YWP2', 'CZ3404YWPS', 'CZ3404YWP8', 'CZ3404YWPX',
         'CZ3404YWNT', 'CZ3404YWR0', 'CZ3404YWPE', 'CZ3404YWPA',
         'CZ3404YWPP', 'CZ3404YWPC', 'CZ3404YWNN', 'CZ3404YWPM',
         'CZ3404YWPV', 'CZ3404YWPH', 'CZ3404YWPK'
     ]
     self.assertEqual(sorted(p), sorted(group))
     res = set([('disk', 'sdb', 'Write Cache Enable', '0'),
                ('disk', 'sdb', 'model', 'LOGICAL VOLUME'),
                ('disk', 'sdb', 'rev', '4.68'),
                ('disk', 'sdb', 'size', '299'),
                ('disk', 'sda', 'Write Cache Enable', '0'),
                ('disk', 'sdb', 'vendor', 'HP'),
                ('disk', 'sda', 'rev', '4.68'),
                ('disk', 'sda', 'Read Cache Disable', '0'),
                ('disk', 'sdb', 'Read Cache Disable', '0'),
                ('disk', 'sda', 'vendor', 'HP'),
                ('disk', 'sda', 'model', 'LOGICAL VOLUME'),
                ('disk', 'sda', 'size', '299')])
     self.assertEqual(sorted(res), sorted(eval(element)))
Beispiel #3
0
def compare_disks(global_params, bench_values, unique_id, systems_groups):
    systems = utils.find_sub_element(bench_values, unique_id, "pdisk")
    groups = check.physical_megaraid_disks(global_params, systems, unique_id)
    compare_sets.compute_similar_hosts_list(systems_groups, compare_sets.get_hosts_list_from_result(groups))
    systems = utils.find_sub_element(bench_values, unique_id, "disk")
    groups = check.physical_hpa_disks(global_params, systems, unique_id)
    compare_sets.compute_similar_hosts_list(systems_groups, compare_sets.get_hosts_list_from_result(groups))
    groups = check.logical_disks(global_params, systems, unique_id)
    compare_sets.compute_similar_hosts_list(systems_groups, compare_sets.get_hosts_list_from_result(groups))
Beispiel #4
0
def compare_disks(bench_values, unique_id, systems_groups):
    systems = utils.find_sub_element(bench_values, unique_id, 'pdisk')
    groups = check.physical_megaraid_disks(systems, unique_id)
    compare_sets.compute_similar_hosts_list(
        systems_groups, compare_sets.get_hosts_list_from_result(groups))
    systems = utils.find_sub_element(bench_values, unique_id, 'disk')
    groups = check.physical_hpa_disks(systems, unique_id)
    compare_sets.compute_similar_hosts_list(
        systems_groups, compare_sets.get_hosts_list_from_result(groups))
    groups = check.logical_disks(systems, unique_id)
    compare_sets.compute_similar_hosts_list(
        systems_groups, compare_sets.get_hosts_list_from_result(groups))