Example #1
0
    def logical_volume_sizes_should_equal_all_phisical_volumes(self, spaces):
        vg_sizes = {}
        for vg in only_vg(spaces):
            for volume in vg['volumes']:
                vg_name = vg['id']
                if not vg_sizes.get(vg_name):
                    vg_sizes[vg_name] = 0
                vg_sizes[vg_name] += volume['size']

        pv_sizes = {}
        for disk in only_disks(spaces):
            for volume in disk['volumes']:
                # Skip cinder because it does not have
                # logical volumes
                if volume.get('vg') == 'cinder':
                    continue

                if volume['type'] == 'pv':
                    vg_name = volume['vg']
                    if not pv_sizes.get(vg_name):
                        pv_sizes[vg_name] = 0

                    pv_sizes[vg_name] += volume['size']
                    pv_sizes[vg_name] -= volume['lvm_meta_size']

        self.assertEqual(vg_sizes, pv_sizes)
Example #2
0
    def logical_volume_sizes_should_equal_all_phisical_volumes(self, spaces):
        vg_sizes = {}
        for vg in only_vg(spaces):
            for volume in vg['volumes']:
                vg_name = vg['id']
                if not vg_sizes.get(vg_name):
                    vg_sizes[vg_name] = 0
                vg_sizes[vg_name] += volume['size']

        pv_sizes = {}
        for disk in only_disks(spaces):
            for volume in disk['volumes']:
                # Skip cinder because it does not have
                # logical volumes
                if volume.get('vg') == 'cinder':
                    continue

                if volume['type'] == 'pv':
                    vg_name = volume['vg']
                    if not pv_sizes.get(vg_name):
                        pv_sizes[vg_name] = 0

                    pv_sizes[vg_name] += volume['size']
                    pv_sizes[vg_name] -= volume['lvm_meta_size']

        self.assertEqual(vg_sizes, pv_sizes)
Example #3
0
    def logical_volume_sizes_should_equal_all_phisical_volumes(self, spaces):
        vg_sizes = {}
        for vg in only_vg(spaces):
            for volume in vg["volumes"]:
                vg_name = vg["id"]
                if not vg_sizes.get(vg_name):
                    vg_sizes[vg_name] = 0
                vg_sizes[vg_name] += volume["size"]

        pv_sizes = {}
        for disk in only_disks(spaces):
            for volume in disk["volumes"]:
                # Skip cinder because it does not have
                # logical volumes
                if volume.get("vg") == "cinder":
                    continue

                if volume["type"] == "pv":
                    vg_name = volume["vg"]
                    if not pv_sizes.get(vg_name):
                        pv_sizes[vg_name] = 0

                    pv_sizes[vg_name] += volume["size"]
                    pv_sizes[vg_name] -= volume["lvm_meta_size"]

        self.assertEqual(vg_sizes, pv_sizes)
Example #4
0
    def get_vgs_for_releases(self):
        openstack = self.env.read_fixtures(
            ('openstack', ))[0]['fields']['volumes_metadata']['volumes']

        return [only_vg(openstack)]
Example #5
0
    def get_vgs_for_releases(self):
        openstack = self.env.read_fixtures(
            ('openstack',))[0]['fields']['volumes_metadata']['volumes']

        return [only_vg(openstack)]
Example #6
0
    def get_vgs_for_releases(self):
        openstack = self.env.read_fixtures(("openstack",))[0]["fields"]["volumes_metadata"]["volumes"]

        return [only_vg(openstack)]