def configure_base_test(self): """Test the configuration of the DNF base.""" data = PackagesConfigurationData() self.dnf_manager.configure_base(data) self._check_configuration( "multilib_policy = best", "timeout = 30", "retries = 10", "install_weak_deps = 1", ) self.assertEqual(self.dnf_manager._ignore_broken_packages, False) self.assertEqual(self.dnf_manager._ignore_missing_packages, False) data.multilib_policy = MULTILIB_POLICY_ALL data.timeout = 100 data.retries = 5 data.broken_ignored = True data.missing_ignored = True data.weakdeps_excluded = True self.dnf_manager.configure_base(data) self._check_configuration( "multilib_policy = all", "timeout = 100", "retries = 5", "install_weak_deps = 0", ) self.assertEqual(self.dnf_manager._ignore_broken_packages, True) self.assertEqual(self.dnf_manager._ignore_missing_packages, True)
def _process_kickstart_packages(self, data): """Process the kickstart packages.""" packages = PackagesConfigurationData() packages.core_group_enabled = not data.packages.nocore packages.default_environment_enabled = data.packages.default if data.packages.environment is not None: packages.environment = data.packages.environment packages.packages = data.packages.packageList packages.excluded_packages = data.packages.excludedList for group in data.packages.groupList: packages.groups.append(group.name) if group.include == GROUP_ALL: packages.groups_package_types[ group.name] = GROUP_PACKAGE_TYPES_ALL if group.include == GROUP_REQUIRED: packages.groups_package_types[ group.name] = GROUP_PACKAGE_TYPES_REQUIRED for group in data.packages.excludedGroupList: packages.excluded_groups.append(group.name) packages.docs_excluded = data.packages.excludeDocs packages.weakdeps_excluded = data.packages.excludeWeakdeps if data.packages.handleMissing == KS_MISSING_IGNORE: packages.missing_ignored = True if data.packages.handleBroken == KS_BROKEN_IGNORE: packages.broken_ignored = True if data.packages.instLangs == "": packages.languages = RPM_LANGUAGES_NONE elif data.packages.instLangs is not None: packages.languages = data.packages.instLangs if data.packages.multiLib: packages.multilib_policy = MULTILIB_POLICY_ALL if data.packages.timeout is not None: packages.timeout = data.packages.timeout if data.packages.retries is not None: packages.retries = data.packages.retries self.set_packages(packages) self.set_packages_kickstarted(data.packages.seen)