Beispiel #1
0
 def post_install_with_task(self):
     """Do post installation tasks."""
     task = UpdateBLSConfigurationTask(
         conf.target.system_root,
         self.kernel_version_list
     )
     return self.publish_task(LIVE_IMAGE_HANDLER.namespace, task)
    def update_bls_configuration_task_no_old_entries_test(
            self, exec_with_redirect):
        """Test update bls configuration task without old bls entries."""
        kernel_version_list = ["kernel-v1.fc2000.x86_64", "kernel-sad-kernel"]
        bls_entries = ["three_trillions_twenty_two.noconf"]

        with TemporaryDirectory() as temp:
            self._prepare_bls_test_env(temp,
                                       fake_kernel_pkg=False,
                                       bls_entries=bls_entries)

            UpdateBLSConfigurationTask(temp, kernel_version_list).run()

            entries_path = os.path.join(temp, "boot/loader/entries")
            entry = os.path.join(entries_path, bls_entries[0])
            self.assertTrue(os.path.exists(entry),
                            msg="File {} shouldn't be removed".format(entry))

            calls = []
            for kernel in kernel_version_list:
                calls.append(
                    call("kernel-install", [
                        "add", kernel,
                        "/lib/modules/{0}/vmlinuz".format(kernel)
                    ],
                         root=temp), )

            exec_with_redirect.assert_has_calls(calls)
Beispiel #3
0
 def post_install_with_tasks(self):
     """Do post installation tasks."""
     return [
         UpdateBLSConfigurationTask(conf.target.system_root,
                                    self.kernel_version_list),
         CopyDriverDisksFilesTask(conf.target.system_root)
     ]
Beispiel #4
0
    def post_install_with_tasks(self):
        """Perform post installation tasks.

        :returns: list of paths.
        :rtype: List
        """
        return [
            UpdateBLSConfigurationTask(conf.target.system_root,
                                       self.kernel_version_list),
            CopyDriverDisksFilesTask(conf.target.system_root)
        ]
    def update_bls_configuration_task_no_bls_system_test(
            self, exec_with_redirect):
        """Test update bls configuration task on no BLS system."""
        kernel_version_list = ["kernel-v1.fc2000.x86_64", "kernel-sad-kernel"]

        with TemporaryDirectory() as temp:
            self._prepare_bls_test_env(temp,
                                       fake_kernel_pkg=True,
                                       bls_entries=[])

            UpdateBLSConfigurationTask(temp, kernel_version_list).run()

            # nothing should be done when new-kernel-pkg is present
            exec_with_redirect.assert_not_called()