Skip to content

Commit

Permalink
kola: Remove 'qemu-unpriv' and make 'qemu' the default
Browse files Browse the repository at this point in the history
There is no longer a privileged 'qemu' platform and the 'qemu' and
'qemu-unpriv' platforms are the same.
  • Loading branch information
travier committed Feb 3, 2023
1 parent 01d7818 commit 275c7f5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion mantle/cmd/kola/kola.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func syncFindParentImageOptions() error {
// Here we handle the --fetch-parent-image --> platform-specific options
// based on its cosa build metadata
switch kolaPlatform {
case "qemu-unpriv":
case "qemu":
if qemuImageDir == "" {
if qemuImageDir, err = os.MkdirTemp("/var/tmp", "kola-run-upgrade"); err != nil {
return err
Expand Down
28 changes: 14 additions & 14 deletions mantle/cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
kolaPlatform string
kolaParallelArg string
kolaArchitectures = []string{"amd64"}
kolaPlatforms = []string{"aws", "azure", "do", "esx", "gce", "openstack", "packet", "qemu", "qemu-unpriv", "qemu-iso"}
kolaPlatforms = []string{"aws", "azure", "do", "esx", "gce", "openstack", "packet", "qemu", "qemu-iso"}
kolaDistros = []string{"fcos", "rhcos", "scos"}
)

Expand Down Expand Up @@ -172,21 +172,21 @@ func syncOptionsImpl(useCosa bool) error {
return fmt.Errorf("unsupported %v %q", name, item)
}

if kolaPlatform == "iso" {
kolaPlatform = "qemu-iso"
}
// TODO: Could also auto-synchronize if e.g. --aws-ami is passed
if kolaPlatform == "" {
if kola.QEMUIsoOptions.IsoPath != "" {
kolaPlatform = "qemu-iso"
} else {
kolaPlatform = "qemu-unpriv"
}
if kolaPlatform == "" && kola.QEMUIsoOptions.IsoPath != "" {
kolaPlatform = "qemu-iso"
}

// There used to be a "privileged" qemu path, it is no longer supported.
// Alias qemu to qemu-unpriv.
if kolaPlatform == "qemu" {
kolaPlatform = "qemu-unpriv"
} else if kolaPlatform == "iso" {
kolaPlatform = "qemu-iso"
// There used to be two QEMU platforms: privileged ('qemu') and
// unprivileged ('qemu-unpriv'). We first removed support for privileged
// QEMU and aliased it to 'qemu-unpriv' and then renamed and merged
// 'qemu-unpriv' to 'qemu' to unify on a single name. 'qemu' is now the
// default.
if kolaPlatform == "" {
kolaPlatform = "qemu"
}

// test parallelism
Expand Down Expand Up @@ -334,7 +334,7 @@ func syncOptions() error {
// options that can be derived from the cosa build metadata
func syncCosaOptions() error {
switch kolaPlatform {
case "qemu-unpriv", "qemu":
case "qemu":
if kola.QEMUOptions.DiskImage == "" && kola.CosaBuild.Meta.BuildArtifacts.Qemu != nil {
kola.QEMUOptions.DiskImage = filepath.Join(kola.CosaBuild.Dir, kola.CosaBuild.Meta.BuildArtifacts.Qemu.Path)
}
Expand Down
9 changes: 2 additions & 7 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func NewFlight(pltfrm string) (flight platform.Flight, err error) {
flight, err = openstack.NewFlight(&OpenStackOptions)
case "packet":
flight, err = packet.NewFlight(&PacketOptions)
case "qemu-unpriv":
case "qemu":
flight, err = unprivqemu.NewFlight(&QEMUOptions)
case "qemu-iso":
flight, err = qemuiso.NewFlight(&QEMUIsoOptions)
Expand Down Expand Up @@ -469,11 +469,6 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri

checkPlatforms := []string{pltfrm}

// qemu-unpriv has the same restrictions as QEMU but might also want additional restrictions due to the lack of a Local cluster
if pltfrm == "qemu-unpriv" {
checkPlatforms = append(checkPlatforms, "qemu")
}

// sort tags into include/exclude
positiveTags := []string{}
negativeTags := []string{}
Expand Down Expand Up @@ -627,7 +622,7 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
if allowed, excluded := isAllowed(Options.Distribution, t.Distros, t.ExcludeDistros); !allowed || excluded {
continue
}
if pltfrm == "qemu-unpriv" {
if pltfrm == "qemu" {
if allowed, excluded := isAllowed(QEMUOptions.Firmware, t.Firmwares, t.ExcludeFirmwares); !allowed || excluded {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd-kola
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ r = re.compile("-p(=.+)?|--platform(=.+)?")
platformargs = list(filter(r.match, unknown_args))

if os.getuid() != 0 and len(platformargs) == 0:
kolaargs.extend(['-p', 'qemu-unpriv'])
kolaargs.extend(['-p', 'qemu'])

if args.build is not None:
kolaargs.extend(['--build', args.build])
Expand Down
2 changes: 1 addition & 1 deletion src/cmd-offline-update
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# cd /path/to/rhcos-4.8
# cp --reflink=auto /path/to/rhcos-4.6.0-x86_64-qemu.qcow2 tmp/
# cosa offline-update tmp/rhcos-4.6.0-x86_64-qemu.qcow2
# kola run -p qemu-unpriv -b rhcos --qemu-image tmp/rhcos-4.6.0-x86_64-qemu.qcow2 basic
# kola run -p qemu -b rhcos --qemu-image tmp/rhcos-4.6.0-x86_64-qemu.qcow2 basic

set -euo pipefail

Expand Down

0 comments on commit 275c7f5

Please sign in to comment.