Adjust code to new version of osbuild/images
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
016051a4b8
commit
1afe7d20c8
6 changed files with 20 additions and 20 deletions
|
|
@ -10,11 +10,11 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/images/pkg/blueprint"
|
||||
"github.com/osbuild/images/pkg/distro"
|
||||
rhel "github.com/osbuild/images/pkg/distro/rhel8"
|
||||
"github.com/osbuild/images/pkg/ostree"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/dnfjson"
|
||||
)
|
||||
|
|
@ -85,22 +85,22 @@ func TestDepsolvePackageSets(t *testing.T) {
|
|||
|
||||
// Set up temporary directory for rpm/dnf cache
|
||||
dir := t.TempDir()
|
||||
solver := dnfjson.NewSolver(cs9.ModulePlatformID(), cs9.Releasever(), platform.ARCH_X86_64.String(), cs9.Name(), dir)
|
||||
solver := dnfjson.NewSolver(cs9.ModulePlatformID(), cs9.Releasever(), arch.ARCH_X86_64.String(), cs9.Name(), dir)
|
||||
|
||||
repos, err := rpmmd.LoadRepositories([]string{repoDir}, cs9.Name())
|
||||
require.NoErrorf(t, err, "Failed to LoadRepositories %v", cs9.Name())
|
||||
x86Repos, ok := repos[platform.ARCH_X86_64.String()]
|
||||
require.Truef(t, ok, "failed to get %q repos for %q", platform.ARCH_X86_64.String(), cs9.Name())
|
||||
x86Repos, ok := repos[arch.ARCH_X86_64.String()]
|
||||
require.Truef(t, ok, "failed to get %q repos for %q", arch.ARCH_X86_64.String(), cs9.Name())
|
||||
|
||||
x86Arch, err := cs9.GetArch(platform.ARCH_X86_64.String())
|
||||
require.Nilf(t, err, "failed to get %q arch of %q distro", platform.ARCH_X86_64.String(), cs9.Name())
|
||||
x86Arch, err := cs9.GetArch(arch.ARCH_X86_64.String())
|
||||
require.Nilf(t, err, "failed to get %q arch of %q distro", arch.ARCH_X86_64.String(), cs9.Name())
|
||||
|
||||
qcow2ImageTypeName := "qcow2"
|
||||
qcow2Image, err := x86Arch.GetImageType(qcow2ImageTypeName)
|
||||
require.Nilf(t, err, "failed to get %q image type of %q/%q distro/arch", qcow2ImageTypeName, cs9.Name(), platform.ARCH_X86_64.String())
|
||||
require.Nilf(t, err, "failed to get %q image type of %q/%q distro/arch", qcow2ImageTypeName, cs9.Name(), arch.ARCH_X86_64.String())
|
||||
|
||||
manifestSource, _, err := qcow2Image.Manifest(&blueprint.Blueprint{Packages: []blueprint.Package{{Name: "bind"}}}, distro.ImageOptions{}, x86Repos, 0)
|
||||
require.Nilf(t, err, "failed to initialise manifest for %q image type of %q/%q distro/arch", qcow2ImageTypeName, cs9.Name(), platform.ARCH_X86_64.String())
|
||||
require.Nilf(t, err, "failed to initialise manifest for %q image type of %q/%q distro/arch", qcow2ImageTypeName, cs9.Name(), arch.ARCH_X86_64.String())
|
||||
imagePkgSets := manifestSource.GetPackageSetChains()
|
||||
|
||||
gotPackageSpecsSets := make(map[string][]rpmmd.PackageSpec, len(imagePkgSets))
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/constants"
|
||||
"github.com/osbuild/osbuild-composer/internal/boot"
|
||||
"github.com/osbuild/osbuild-composer/internal/boot/azuretest"
|
||||
|
|
@ -410,7 +410,7 @@ func testBootUsingOpenStack(t *testing.T, imagePath string) {
|
|||
currentArch := common.CurrentArch()
|
||||
|
||||
// skip on aarch64 because we don't have aarch64 openstack or kvm machines
|
||||
if currentArch == platform.ARCH_AARCH64.String() {
|
||||
if currentArch == arch.ARCH_AARCH64.String() {
|
||||
t.Skip("Openstack boot test is skipped on aarch64.")
|
||||
// if no credentials are given, fall back to qemu
|
||||
} else if (creds == gophercloud.AuthOptions{}) {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ import (
|
|||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/images/pkg/distro"
|
||||
"github.com/osbuild/images/pkg/distro/fedora"
|
||||
"github.com/osbuild/images/pkg/distroregistry"
|
||||
"github.com/osbuild/images/pkg/manifest"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/dnfjson"
|
||||
|
|
@ -127,7 +127,7 @@ func main() {
|
|||
awsTarget.OsbuildArtifact.ExportFilename = "image.ami"
|
||||
|
||||
d := fedora.NewF37()
|
||||
a, err := d.GetArch(platform.ARCH_X86_64.String())
|
||||
a, err := d.GetArch(arch.ARCH_X86_64.String())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ func main() {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
repos := allRepos[platform.ARCH_X86_64.String()]
|
||||
repos := allRepos[arch.ARCH_X86_64.String()]
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
panic("os.UserHomeDir(): " + err.Error())
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/constants"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
|
@ -138,7 +138,7 @@ func WithBootedQemuImage(image string, ns NetNS, f func() error) error {
|
|||
"-nographic",
|
||||
image,
|
||||
)
|
||||
} else if common.CurrentArch() == platform.ARCH_AARCH64.String() {
|
||||
} else if common.CurrentArch() == arch.ARCH_AARCH64.String() {
|
||||
// This command does not use KVM as I was unable to make it work in Beaker,
|
||||
// once we have machines that can use KVM, enable it to make it faster
|
||||
qemuCmd = ns.NamespacedCommand(
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/images/pkg/distro"
|
||||
"github.com/osbuild/images/pkg/distro/fedora"
|
||||
"github.com/osbuild/images/pkg/distro/test_distro"
|
||||
"github.com/osbuild/images/pkg/distroregistry"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/blueprint"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
|
|
@ -314,7 +314,7 @@ func Test_upgrade(t *testing.T) {
|
|||
assert.NoError(err)
|
||||
|
||||
// The test data has image types only supported on Fedora X86_64
|
||||
registry.SetHostArchName(platform.ARCH_X86_64.String())
|
||||
registry.SetHostArchName(arch.ARCH_X86_64.String())
|
||||
store := newStoreFromV0(storeStruct, registry, nil)
|
||||
assert.Equal(1, len(store.blueprints))
|
||||
assert.Equal(1, len(store.blueprintsChanges))
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import (
|
|||
|
||||
"github.com/osbuild/osbuild-composer/pkg/jobqueue"
|
||||
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/images/pkg/distro"
|
||||
"github.com/osbuild/images/pkg/distro/test_distro"
|
||||
"github.com/osbuild/images/pkg/manifest"
|
||||
"github.com/osbuild/images/pkg/osbuild"
|
||||
"github.com/osbuild/images/pkg/platform"
|
||||
"github.com/osbuild/images/pkg/rpmmd"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/jobqueue/fsjobqueue"
|
||||
|
|
@ -787,7 +787,7 @@ func enqueueAndFinishTestJobDependencies(s *worker.Server, deps []testJob) ([]uu
|
|||
switch dep.main.(type) {
|
||||
case *worker.OSBuildJob:
|
||||
job := dep.main.(*worker.OSBuildJob)
|
||||
id, err = s.EnqueueOSBuildAsDependency(platform.ARCH_X86_64.String(), job, depUUIDs, "")
|
||||
id, err = s.EnqueueOSBuildAsDependency(arch.ARCH_X86_64.String(), job, depUUIDs, "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -857,7 +857,7 @@ func enqueueAndFinishTestJobDependencies(s *worker.Server, deps []testJob) ([]uu
|
|||
}
|
||||
|
||||
// request the previously added Job
|
||||
_, token, _, _, _, err := s.RequestJobById(context.Background(), platform.ARCH_X86_64.String(), id)
|
||||
_, token, _, _, _, err := s.RequestJobById(context.Background(), arch.ARCH_X86_64.String(), id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue