distro: remove packageSetChains from image type in RHEL 8 & 9
Image types no longer report their chains. Instead, pipelines report their packages and chains and blueprint packages are added to the workload. The distro.ImageType interface retains the PackageSetsChains() methods for RHEL 7 until that is rewritten as well. The osbuild-dnf-json-test doesn't use the PackageSetsChains() method anymore. Instead, since it only test the centos-8 qcow2 image, it hardcodes the expected package set names.
This commit is contained in:
parent
5db70ed3f5
commit
e4bb7f4f16
14 changed files with 3 additions and 115 deletions
|
|
@ -101,29 +101,8 @@ func TestDepsolvePackageSets(t *testing.T) {
|
|||
require.Nilf(t, err, "failed to get %q image type of %q/%q distro/arch", qcow2ImageTypeName, distroStruct.Name(), distro.X86_64ArchName)
|
||||
|
||||
imagePkgSets := qcow2Image.PackageSets(blueprint.Blueprint{Packages: []blueprint.Package{{Name: "bind"}}}, distro.ImageOptions{}, x86Repos)
|
||||
imagePkgSetChains := qcow2Image.PackageSetsChains()
|
||||
require.NotEmptyf(t, imagePkgSetChains, "the %q image has no package set chains defined", qcow2ImageTypeName)
|
||||
|
||||
expectedPackageSpecsSetNames := func(pkgSets map[string][]rpmmd.PackageSet, pkgSetChains map[string][]string) []string {
|
||||
expectedPkgSpecsSetNames := make([]string, 0, len(pkgSets))
|
||||
chainPkgSets := make(map[string]struct{}, len(pkgSets))
|
||||
for name, pkgSetChain := range pkgSetChains {
|
||||
expectedPkgSpecsSetNames = append(expectedPkgSpecsSetNames, name)
|
||||
for _, pkgSetName := range pkgSetChain {
|
||||
chainPkgSets[pkgSetName] = struct{}{}
|
||||
}
|
||||
}
|
||||
for name := range pkgSets {
|
||||
if _, ok := chainPkgSets[name]; ok {
|
||||
continue
|
||||
}
|
||||
expectedPkgSpecsSetNames = append(expectedPkgSpecsSetNames, name)
|
||||
}
|
||||
return expectedPkgSpecsSetNames
|
||||
}(imagePkgSets, imagePkgSetChains)
|
||||
|
||||
gotPackageSpecsSets := make(map[string][]rpmmd.PackageSpec, len(imagePkgSets))
|
||||
|
||||
for name, pkgSet := range imagePkgSets {
|
||||
res, err := solver.Depsolve(pkgSet)
|
||||
if err != nil {
|
||||
|
|
@ -131,6 +110,7 @@ func TestDepsolvePackageSets(t *testing.T) {
|
|||
}
|
||||
gotPackageSpecsSets[name] = res
|
||||
}
|
||||
expectedPackageSpecsSetNames := []string{"build", "os"}
|
||||
require.EqualValues(t, len(expectedPackageSpecsSetNames), len(gotPackageSpecsSets))
|
||||
for _, name := range expectedPackageSpecsSetNames {
|
||||
_, ok := gotPackageSpecsSets[name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue