Exemple #1
0
    def test__parse_partitioning_info_all_gpt(self):
        in_info = dict(INSTANCE_INFO)
        in_info['swap_mb'] = 128
        in_info['ephemeral_mb'] = 256
        in_info['ephemeral_format'] = 'ext4'
        in_info['preserve_ephemeral'] = True
        in_info['configdrive'] = 'some-fake-user-data'
        in_info['capabilities'] = {'disk_label': 'gpt'}
        self.node.instance_info = in_info
        self.node.save()

        expected_info = {
            'partition_info': {
                'label': 'gpt',
                'ephemeral_format': 'ext4',
                'preserve_ephemeral': 'yes',
                'partitions': {
                    'bios': {
                        'number': 1,
                        'name': 'bios',
                        'part_start': '1MiB',
                        'part_end': '2MiB',
                        'flags': ['bios_grub']
                    },
                    'ephemeral': {
                        'number': 2,
                        'part_start': '2MiB',
                        'part_end': '258MiB',
                        'name': 'ephemeral'
                    },
                    'swap': {
                        'number': 3,
                        'part_start': '258MiB',
                        'part_end': '386MiB',
                        'name': 'swap'
                    },
                    'configdrive': {
                        'number': 4,
                        'part_start': '386MiB',
                        'part_end': '450MiB',
                        'name': 'configdrive'
                    },
                    'root': {
                        'number': 5,
                        'part_start': '450MiB',
                        'part_end': '5570MiB',
                        'name': 'root'
                    }
                }
            }
        }

        i_info = ansible_deploy._parse_partitioning_info(self.node)

        self.assertEqual(expected_info, i_info)
Exemple #2
0
    def test__parse_partitioning_info_root_msdos(self):
        expected_info = {
            'partition_info': {
                'label': 'msdos',
                'partitions': {
                    'root':
                        {'number': 1,
                         'part_start': '1MiB',
                         'part_end': '5121MiB',
                         'flags': ['boot']}
                }}}

        i_info = ansible_deploy._parse_partitioning_info(self.node)

        self.assertEqual(expected_info, i_info)