Example #1
0
    def test__generate_isolinux_cfg(self):

        kernel_params = ["key1=value1", "key2"]
        options = {"kernel": "/vmlinuz", "ramdisk": "/initrd"}
        expected_cfg = (
            "default boot\n" "\n" "label boot\n" "kernel /vmlinuz\n" "append initrd=/initrd text key1=value1 key2 --"
        )
        cfg = images._generate_cfg(kernel_params, CONF.isolinux_config_template, options)
        self.assertEqual(expected_cfg, cfg)
Example #2
0
    def test__generate_isolinux_cfg(self):

        kernel_params = ['key1=value1', 'key2']
        options = {'kernel': '/vmlinuz', 'ramdisk': '/initrd'}
        expected_cfg = ("default boot\n"
                        "\n"
                        "label boot\n"
                        "kernel /vmlinuz\n"
                        "append initrd=/initrd text key1=value1 key2 --")
        cfg = images._generate_cfg(kernel_params,
                                   CONF.isolinux_config_template, options)
        self.assertEqual(expected_cfg, cfg)
Example #3
0
    def test__generate_grub_cfg(self):

        kernel_params = ['key1=value1', 'key2']
        options = {'linux': '/vmlinuz', 'initrd': '/initrd'}
        expected_cfg = ("menuentry \"install\" {\n"
                        "linux /vmlinuz key1=value1 key2 --\n"
                        "initrd /initrd\n"
                        "}")

        cfg = images._generate_cfg(kernel_params, CONF.grub_config_template,
                                   options)
        self.assertEqual(expected_cfg, cfg)
Example #4
0
    def test__generate_isolinux_cfg(self):

        kernel_params = ['key1=value1', 'key2']
        options = {'kernel': '/vmlinuz', 'ramdisk': '/initrd'}
        expected_cfg = ("default boot\n"
                        "\n"
                        "label boot\n"
                        "kernel /vmlinuz\n"
                        "append initrd=/initrd text key1=value1 key2 --")
        cfg = images._generate_cfg(kernel_params,
                                   CONF.isolinux_config_template,
                                   options)
        self.assertEqual(expected_cfg, cfg)
Example #5
0
    def test__generate_grub_cfg(self):

        kernel_params = ['key1=value1', 'key2']
        options = {'linux': '/vmlinuz', 'initrd': '/initrd'}
        expected_cfg = ("menuentry \"install\" {\n"
                        "linux /vmlinuz key1=value1 key2 --\n"
                        "initrd /initrd\n"
                        "}")

        cfg = images._generate_cfg(kernel_params,
                                   CONF.grub_config_template,
                                   options)
        self.assertEqual(expected_cfg, cfg)
Example #6
0
    def test__generate_grub_cfg(self):
        kernel_params = ['key1=value1', 'key2']
        options = {'linux': '/vmlinuz', 'initrd': '/initrd'}
        expected_cfg = ("set default=0\n"
                        "set timeout=5\n"
                        "set hidden_timeout_quiet=false\n"
                        "\n"
                        "menuentry \"boot_partition\" {\n"
                        "linuxefi /vmlinuz key1=value1 key2 --\n"
                        "initrdefi /initrd\n"
                        "}")

        cfg = images._generate_cfg(kernel_params, CONF.grub_config_template,
                                   options)
        self.assertEqual(expected_cfg, cfg)
Example #7
0
    def test__generate_grub_cfg(self):
        kernel_params = ['key1=value1', 'key2']
        options = {'linux': '/vmlinuz', 'initrd': '/initrd'}
        expected_cfg = ("set default=0\n"
                        "set timeout=5\n"
                        "set hidden_timeout_quiet=false\n"
                        "\n"
                        "menuentry \"boot_partition\" {\n"
                        "linuxefi /vmlinuz key1=value1 key2 --\n"
                        "initrdefi /initrd\n"
                        "}")

        cfg = images._generate_cfg(kernel_params,
                                   CONF.grub_config_template,
                                   options)
        self.assertEqual(expected_cfg, cfg)
Example #8
0
    def test__generate_grub_cfg(self):
        kernel_params = ["key1=value1", "key2"]
        options = {"linux": "/vmlinuz", "initrd": "/initrd"}
        expected_cfg = (
            "set default=0\n"
            "set timeout=5\n"
            "set hidden_timeout_quiet=false\n"
            "\n"
            'menuentry "boot_partition" {\n'
            "linuxefi /vmlinuz key1=value1 key2 --\n"
            "initrdefi /initrd\n"
            "}"
        )

        cfg = images._generate_cfg(kernel_params, CONF.grub_config_template, options)
        self.assertEqual(expected_cfg, cfg)