예제 #1
0
    def install_with_tasks(self):
        """Install the payload.

        :return: list of tasks
        """
        ostree_source = self._get_source(SourceType.RPM_OSTREE)

        if not ostree_source:
            log.debug("No OSTree RPM source is available.")
            return []

        tasks = [
            InitOSTreeFsAndRepoTask(physroot=conf.target.physical_root),
            ChangeOSTreeRemoteTask(physroot=conf.target.physical_root,
                                   data=ostree_source.configuration),
            PullRemoteAndDeleteTask(data=ostree_source.configuration),
            DeployOSTreeTask(physroot=conf.target.physical_root,
                             data=ostree_source.configuration),
            SetSystemRootTask(physroot=conf.target.physical_root),
            CopyBootloaderDataTask(physroot=conf.target.physical_root,
                                   sysroot=conf.target.system_root),
            PrepareOSTreeMountTargetsTask(physroot=conf.target.physical_root,
                                          sysroot=conf.target.system_root,
                                          data=ostree_source.configuration)
        ]

        flatpak_source = self._get_source(SourceType.FLATPAK)

        if flatpak_source:
            task = InstallFlatpaksTask(sysroot=conf.target.system_root)
            tasks.append(task)

        self._collect_mount_points_on_success(tasks)
        return tasks
    def run_failure_test(self, fm_mock):
        """Test InstallFlatpakTask.run failure"""
        fm_instance = fm_mock.return_value
        fm_instance.install_all.side_effect = PayloadInstallationError

        with TemporaryDirectory() as temp:
            with self.assertRaises(PayloadInstallationError):
                task = InstallFlatpaksTask(temp)
                task.run()
    def run_success_test(self, fm_mock):
        """Test InstallFlatpakTask.run success"""
        fm_instance = fm_mock.return_value

        with TemporaryDirectory() as temp:
            task = InstallFlatpaksTask(temp)
            task.run()

        fm_instance.install_all.assert_called_once()
        fm_instance.add_remote.assert_called_once()
        fm_instance.remove_remote.assert_called_once()
예제 #4
0
 def _flatpak_install(self):
     from pyanaconda.modules.payloads.payload.rpm_ostree.flatpak_installation import \
         InstallFlatpaksTask
     task = InstallFlatpaksTask(conf.target.system_root)
     task.progress_changed_signal.connect(self._progress_cb)
     task.run()