From 29ed498ae33caf5c16015b4aa6af83abce0a71d4 Mon Sep 17 00:00:00 2001 From: wangyueliang Date: Mon, 26 Feb 2024 15:44:31 +0800 Subject: [PATCH] kola: Remove 'qemu-unpriv' and make 'qemu' the default [upstream] 941cad205b6193d8f3d52237455ee8573b9ba975 189f51268eb589f7772ab86fa22e1a740dabed31 --- mantle/cmd/kola/kola.go | 2 +- mantle/cmd/kola/options.go | 28 ++++++++--------- mantle/cmd/kola/spawn.go | 4 +-- mantle/cmd/plume/release.go | 2 +- mantle/kola/harness.go | 30 ++++++++----------- mantle/kola/tests/coretest/core.go | 2 +- mantle/kola/tests/crio/crio.go | 4 +-- mantle/kola/tests/docker/docker.go | 12 ++++---- mantle/kola/tests/etcd/rhcos.go | 8 ++--- mantle/kola/tests/fips/fips.go | 2 +- mantle/kola/tests/ignition/luks.go | 11 ++++--- mantle/kola/tests/ignition/qemufailure.go | 5 ++-- mantle/kola/tests/ignition/resource.go | 5 ++-- mantle/kola/tests/ignition/security.go | 5 ++-- mantle/kola/tests/isula/isula.go | 8 ++--- mantle/kola/tests/misc/boot-mirror.go | 24 ++++++++------- mantle/kola/tests/misc/multipath.go | 6 ++-- mantle/kola/tests/misc/network.go | 16 +++++----- mantle/kola/tests/misc/nfs.go | 4 +-- mantle/kola/tests/rhcos/upgrade.go | 4 +-- .../machine/{unprivqemu => qemu}/cluster.go | 4 +-- .../machine/{unprivqemu => qemu}/flight.go | 2 +- .../machine/{unprivqemu => qemu}/machine.go | 2 +- src/cmd-kola | 2 +- src/cmd-offline-update | 2 +- 25 files changed, 99 insertions(+), 95 deletions(-) rename mantle/platform/machine/{unprivqemu => qemu}/cluster.go (98%) rename mantle/platform/machine/{unprivqemu => qemu}/flight.go (99%) rename mantle/platform/machine/{unprivqemu => qemu}/machine.go (99%) diff --git a/mantle/cmd/kola/kola.go b/mantle/cmd/kola/kola.go index ace7d0ef..eb40c385 100644 --- a/mantle/cmd/kola/kola.go +++ b/mantle/cmd/kola/kola.go @@ -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 diff --git a/mantle/cmd/kola/options.go b/mantle/cmd/kola/options.go index 56e38558..3b544416 100644 --- a/mantle/cmd/kola/options.go +++ b/mantle/cmd/kola/options.go @@ -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", "nestos"} ) @@ -168,23 +168,23 @@ func syncOptionsImpl(useCosa bool) error { return fmt.Errorf("unsupported %v %q", name, item) } - // 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 == "iso" { + 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" { + if kolaPlatform == "" && kola.QEMUIsoOptions.IsoPath != "" { 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 if kolaParallelArg == "auto" { ncpu, err := system.GetProcessors() @@ -329,7 +329,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) } diff --git a/mantle/cmd/kola/spawn.go b/mantle/cmd/kola/spawn.go index 97e504f7..cd55d3d3 100644 --- a/mantle/cmd/kola/spawn.go +++ b/mantle/cmd/kola/spawn.go @@ -32,7 +32,7 @@ import ( "github.com/coreos/coreos-assembler/mantle/kola" "github.com/coreos/coreos-assembler/mantle/platform" "github.com/coreos/coreos-assembler/mantle/platform/conf" - "github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu" + "github.com/coreos/coreos-assembler/mantle/platform/machine/qemu" ) var ( @@ -178,7 +178,7 @@ func runSpawn(cmd *cobra.Command, args []string) error { } switch qc := cluster.(type) { - case *unprivqemu.Cluster: + case *qemu.Cluster: mach, err = qc.NewMachineWithQemuOptions(userdata, machineOpts) default: plog.Fatalf("unreachable: qemu cluster %v unknown type", qc) diff --git a/mantle/cmd/plume/release.go b/mantle/cmd/plume/release.go index c642768b..9a866c76 100644 --- a/mantle/cmd/plume/release.go +++ b/mantle/cmd/plume/release.go @@ -164,7 +164,7 @@ func modifyReleaseMetadataIndex() { } defer releaseFile.Close() - releaseData, err := ioutil.ReadAll(releaseFile) + releaseData, err := io.ReadAll(releaseFile) if err != nil { plog.Fatalf("reading release metadata: %v", err) } diff --git a/mantle/kola/harness.go b/mantle/kola/harness.go index 6d65d96b..6b1cb3be 100644 --- a/mantle/kola/harness.go +++ b/mantle/kola/harness.go @@ -19,7 +19,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "path/filepath" "regexp" @@ -53,8 +52,8 @@ import ( "github.com/coreos/coreos-assembler/mantle/platform/machine/gcloud" "github.com/coreos/coreos-assembler/mantle/platform/machine/openstack" "github.com/coreos/coreos-assembler/mantle/platform/machine/packet" + "github.com/coreos/coreos-assembler/mantle/platform/machine/qemu" "github.com/coreos/coreos-assembler/mantle/platform/machine/qemuiso" - "github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu" "github.com/coreos/coreos-assembler/mantle/system" "github.com/coreos/coreos-assembler/mantle/util" coreosarch "github.com/coreos/stream-metadata-go/arch" @@ -104,7 +103,7 @@ var ( GCEOptions = gcloudapi.Options{Options: &Options} // glue to set platform options from main OpenStackOptions = openstackapi.Options{Options: &Options} // glue to set platform options from main PacketOptions = packetapi.Options{Options: &Options} // glue to set platform options from main - QEMUOptions = unprivqemu.Options{Options: &Options} // glue to set platform options from main + QEMUOptions = qemu.Options{Options: &Options} // glue to set platform options from main QEMUIsoOptions = qemuiso.Options{Options: &Options} // glue to set platform options from main CosaBuild *util.LocalBuild // this is a parsed cosa build @@ -269,8 +268,8 @@ func NewFlight(pltfrm string) (flight platform.Flight, err error) { flight, err = openstack.NewFlight(&OpenStackOptions) case "packet": flight, err = packet.NewFlight(&PacketOptions) - case "qemu-unpriv": - flight, err = unprivqemu.NewFlight(&QEMUOptions) + case "qemu": + flight, err = qemu.NewFlight(&QEMUOptions) case "qemu-iso": flight, err = qemuiso.NewFlight(&QEMUIsoOptions) default: @@ -353,7 +352,7 @@ func parseDenyListYaml(pltfrm string) error { // Parse kola-denylist into structs pathToDenyList := filepath.Join(Options.CosaWorkdir, "src/config/kola-denylist.yaml") - denyListFile, err := ioutil.ReadFile(pathToDenyList) + denyListFile, err := os.ReadFile(pathToDenyList) if os.IsNotExist(err) { return nil } else if err != nil { @@ -372,7 +371,7 @@ func parseDenyListYaml(pltfrm string) error { var manifest ManifestData var pathToManifest string pathToInitConfig := filepath.Join(Options.CosaWorkdir, "src/config.json") - initConfigFile, err := ioutil.ReadFile(pathToInitConfig) + initConfigFile, err := os.ReadFile(pathToInitConfig) if os.IsNotExist(err) { // No variant config found. Let's read the default manifest pathToManifest = filepath.Join(Options.CosaWorkdir, "src/config/manifest.yaml") @@ -388,7 +387,7 @@ func parseDenyListYaml(pltfrm string) error { } pathToManifest = filepath.Join(Options.CosaWorkdir, fmt.Sprintf("src/config/manifest-%s.yaml", initConfig.ConfigVariant)) } - manifestFile, err := ioutil.ReadFile(pathToManifest) + manifestFile, err := os.ReadFile(pathToManifest) if err != nil { return err } @@ -453,11 +452,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{} @@ -611,7 +605,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 } @@ -1163,7 +1157,7 @@ func registerTestDir(dir, testprefix string, children []os.FileInfo) error { if isreg && (c.Mode().Perm()&0001) > 0 { executables = append(executables, filepath.Join(dir, c.Name())) } else if isreg && c.Name() == "config.ign" { - v, err := ioutil.ReadFile(filepath.Join(dir, c.Name())) + v, err := os.ReadFile(filepath.Join(dir, c.Name())) if err != nil { return errors.Wrapf(err, "reading %s", c.Name()) } @@ -1171,7 +1165,7 @@ func registerTestDir(dir, testprefix string, children []os.FileInfo) error { } else if isreg && c.Name() == "config.fcc" { return errors.Wrapf(err, "%s is not supported anymore; rename it to config.bu", c.Name()) } else if isreg && (c.Name() == "config.bu") { - v, err := ioutil.ReadFile(filepath.Join(dir, c.Name())) + v, err := os.ReadFile(filepath.Join(dir, c.Name())) if err != nil { return errors.Wrapf(err, "reading %s", c.Name()) } @@ -1197,7 +1191,7 @@ func registerTestDir(dir, testprefix string, children []os.FileInfo) error { dependencydir = target } else if c.IsDir() { subdir := filepath.Join(dir, c.Name()) - subchildren, err := ioutil.ReadDir(subdir) + subchildren, err := os.ReadDir(subdir) if err != nil { return err } @@ -1244,7 +1238,7 @@ func registerTestDir(dir, testprefix string, children []os.FileInfo) error { func RegisterExternalTestsWithPrefix(dir, prefix string) error { testsdir := filepath.Join(dir, "tests/kola") - children, err := ioutil.ReadDir(testsdir) + children, err := os.ReadDir(testsdir) if err != nil { if os.IsNotExist(err) { // The directory doesn't exist.. Skip registering tests diff --git a/mantle/kola/tests/coretest/core.go b/mantle/kola/tests/coretest/core.go index 86fa43e3..8d394e8f 100644 --- a/mantle/kola/tests/coretest/core.go +++ b/mantle/kola/tests/coretest/core.go @@ -56,7 +56,7 @@ func init() { }, }) // TODO: Enable DockerPing/DockerEcho once fixed - // TODO: Only enable PodmanPing on non qemu-unpriv. Needs: + // TODO: Only enable PodmanPing on non qemu. Needs: // https://github.com/coreos/mantle/issues/1132 register.RegisterTest(®ister.Test{ Name: "fcos.internet", diff --git a/mantle/kola/tests/crio/crio.go b/mantle/kola/tests/crio/crio.go index a9500d3b..ee3df782 100644 --- a/mantle/kola/tests/crio/crio.go +++ b/mantle/kola/tests/crio/crio.go @@ -203,8 +203,8 @@ func init() { Distros: []string{"rhcos"}, UserData: enableCrioIgn, Tags: []string{"crio"}, - // qemu-unpriv machines cannot communicate between each other - ExcludePlatforms: []string{"qemu-unpriv"}, + // qemu machines cannot communicate between each other + ExcludePlatforms: []string{"qemu"}, }) } diff --git a/mantle/kola/tests/docker/docker.go b/mantle/kola/tests/docker/docker.go index 7b639279..a4cd4a45 100644 --- a/mantle/kola/tests/docker/docker.go +++ b/mantle/kola/tests/docker/docker.go @@ -60,8 +60,8 @@ func init() { Name: "docker.network", Distros: []string{"cl"}, - // qemu-unpriv machines cannot communicate - ExcludePlatforms: []string{"qemu-unpriv"}, + // qemu machines cannot communicate + ExcludePlatforms: []string{"qemu"}, }) register.RegisterTest(®ister.Test{ Run: dockerOldClient, @@ -103,8 +103,8 @@ passwd: users: - name: dockremap`), - // qemu-unpriv machines cannot communicate - ExcludePlatforms: []string{"qemu-unpriv"}, + // qemu machines cannot communicate + ExcludePlatforms: []string{"qemu"}, }) // This test covers all functionality that should be quick to run and can be @@ -226,10 +226,10 @@ systemd: enable: true`), // https://github.com/coreos/mantle/issues/999 - // On the qemu-unpriv platform the DHCP provides no data, pre-systemd 241 the DHCP server sending + // On the qemu platform the DHCP provides no data, pre-systemd 241 the DHCP server sending // no routes to the link to spin in the configuring state. docker.service pulls in the network-online // target which causes the basic machine checks to fail - ExcludePlatforms: []string{"qemu-unpriv"}, + ExcludePlatforms: []string{"qemu"}, }) } diff --git a/mantle/kola/tests/etcd/rhcos.go b/mantle/kola/tests/etcd/rhcos.go index a120d4ba..c0973e82 100644 --- a/mantle/kola/tests/etcd/rhcos.go +++ b/mantle/kola/tests/etcd/rhcos.go @@ -53,8 +53,8 @@ func init() { }`), Flags: []register.Flag{register.RequiresInternetAccess}, // fetching etcd requires networking Distros: []string{"rhcos"}, - // qemu-unpriv machines cannot communicate between each other - ExcludePlatforms: []string{"qemu-unpriv"}, + // qemu machines cannot communicate between each other + ExcludePlatforms: []string{"qemu"}, }) register.RegisterTest(®ister.Test{ Run: rhcosClusterTLS, @@ -87,8 +87,8 @@ func init() { }`), Flags: []register.Flag{register.RequiresInternetAccess}, // fetching etcd requires networking Distros: []string{"rhcos"}, - // qemu-unpriv machines cannot communicate between each other - ExcludePlatforms: []string{"qemu-unpriv"}, + // qemu machines cannot communicate between each other + ExcludePlatforms: []string{"qemu"}, }) } diff --git a/mantle/kola/tests/fips/fips.go b/mantle/kola/tests/fips/fips.go index b0eb7b83..d7e5489f 100644 --- a/mantle/kola/tests/fips/fips.go +++ b/mantle/kola/tests/fips/fips.go @@ -61,7 +61,7 @@ func init() { Name: `fips.enable.partitions`, Flags: []register.Flag{}, Distros: []string{"rhcos"}, - Platforms: []string{"qemu", "qemu-unpriv"}, + Platforms: []string{"qemu"}, UserData: conf.Ignition(`{ "ignition": { "config": { diff --git a/mantle/kola/tests/ignition/luks.go b/mantle/kola/tests/ignition/luks.go index 29c72839..5a5b3b75 100644 --- a/mantle/kola/tests/ignition/luks.go +++ b/mantle/kola/tests/ignition/luks.go @@ -12,7 +12,7 @@ import ( ut "github.com/coreos/coreos-assembler/mantle/kola/tests/util" "github.com/coreos/coreos-assembler/mantle/platform" "github.com/coreos/coreos-assembler/mantle/platform/conf" - "github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu" + "github.com/coreos/coreos-assembler/mantle/platform/machine/qemu" "github.com/coreos/coreos-assembler/mantle/util" ) @@ -23,6 +23,7 @@ func init() { Run: luksTangTest, ClusterSize: 0, Name: `luks.tang`, + Description: "Verify that the rootfs is encrypted with Tang.", Flags: []register.Flag{}, Distros: []string{"rhcos"}, Tags: []string{"luks", "tang", kola.NeedsInternetTag, "reprovision"}, @@ -31,9 +32,10 @@ func init() { Run: luksSSST1Test, ClusterSize: 0, Name: `luks.sss.t1`, + Description: "Verify that the rootfs is encrypted with SSS with t=1.", Flags: []register.Flag{}, Distros: []string{"rhcos"}, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, ExcludeArchitectures: []string{"s390x"}, // no TPM backend support for s390x Tags: []string{"luks", "tpm", "tang", "sss", kola.NeedsInternetTag, "reprovision"}, }) @@ -41,9 +43,10 @@ func init() { Run: luksSSST2Test, ClusterSize: 0, Name: `luks.sss.t2`, + Description: "Verify that the rootfs is encrypted with SSS with t=2.", Flags: []register.Flag{}, Distros: []string{"rhcos"}, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, ExcludeArchitectures: []string{"s390x"}, // no TPM backend support for s390x Tags: []string{"luks", "tpm", "tang", "sss", kola.NeedsInternetTag, "reprovision"}, }) @@ -73,7 +76,7 @@ func setupTangMachine(c cluster.TestCluster) ut.TangServer { // the golang compiler no longer checks that the individual types in the case have the // NewMachineWithQemuOptions function, but rather whether platform.Cluster // does which fails - case *unprivqemu.Cluster: + case *qemu.Cluster: m, err = pc.NewMachineWithQemuOptions(ignition, options) for _, hfp := range options.HostForwardPorts { if hfp.Service == "tang" { diff --git a/mantle/kola/tests/ignition/qemufailure.go b/mantle/kola/tests/ignition/qemufailure.go index 24888f9a..529b827c 100644 --- a/mantle/kola/tests/ignition/qemufailure.go +++ b/mantle/kola/tests/ignition/qemufailure.go @@ -30,10 +30,11 @@ import ( func init() { register.RegisterTest(®ister.Test{ - Name: "nestos.ignition.failure", + Name: "coreos.ignition.failure", + Description: "Verify ignition will fail with unsupported action.", Run: runIgnitionFailure, ClusterSize: 0, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, Tags: []string{"ignition"}, }) } diff --git a/mantle/kola/tests/ignition/resource.go b/mantle/kola/tests/ignition/resource.go index cb95aff2..903cd437 100644 --- a/mantle/kola/tests/ignition/resource.go +++ b/mantle/kola/tests/ignition/resource.go @@ -65,14 +65,15 @@ var ( func init() { register.RegisterTest(®ister.Test{ - Name: "nestos.ignition.resource.local", + Name: "coreos.ignition.resource.local", + Description: "Verify that we can fetch Ignition files through local, http and tftp.", Run: resourceLocal, ClusterSize: 1, NativeFuncs: map[string]register.NativeFuncWrap{ "Serve": register.CreateNativeFuncWrap(Serve), }, Tags: []string{"ignition"}, - ExcludePlatforms: []string{"qemu-unpriv"}, + ExcludePlatforms: []string{"qemu"}, Timeout: 20 * time.Minute, }) } diff --git a/mantle/kola/tests/ignition/security.go b/mantle/kola/tests/ignition/security.go index 178127cf..50a8abaf 100644 --- a/mantle/kola/tests/ignition/security.go +++ b/mantle/kola/tests/ignition/security.go @@ -54,14 +54,15 @@ var ( func init() { register.RegisterTest(®ister.Test{ - Name: "nestos.ignition.security.tls", + Name: "coreos.ignition.security.tls", + Description: "Verify that we can fetch ignition with https.", Run: securityTLS, ClusterSize: 1, NativeFuncs: map[string]register.NativeFuncWrap{ "TLSServe": register.CreateNativeFuncWrap(TLSServe), }, Tags: []string{"ignition"}, - // QEMU unprivileged doesn't support multiple VMs communicating with each other. + // QEMU doesn't support multiple VMs communicating with each other. ExcludePlatforms: []string{"qemu"}, Timeout: 20 * time.Minute, }) diff --git a/mantle/kola/tests/isula/isula.go b/mantle/kola/tests/isula/isula.go index c8336968..46413860 100644 --- a/mantle/kola/tests/isula/isula.go +++ b/mantle/kola/tests/isula/isula.go @@ -4,10 +4,10 @@ import ( "fmt" "strings" - "github.com/coreos/mantle/kola/cluster" - "github.com/coreos/mantle/kola/register" - tutil "github.com/coreos/mantle/kola/tests/util" - "github.com/coreos/mantle/platform" + "github.com/coreos/coreos-assembler/mantle/kola/cluster" + "github.com/coreos/coreos-assembler/mantle/kola/register" + tutil "github.com/coreos/coreos-assembler/mantle/kola/tests/util" + "github.com/coreos/coreos-assembler/mantle/platform" ) func init() { diff --git a/mantle/kola/tests/misc/boot-mirror.go b/mantle/kola/tests/misc/boot-mirror.go index 5cebca2d..00592a7b 100644 --- a/mantle/kola/tests/misc/boot-mirror.go +++ b/mantle/kola/tests/misc/boot-mirror.go @@ -26,7 +26,7 @@ import ( "github.com/coreos/coreos-assembler/mantle/kola/tests/util" "github.com/coreos/coreos-assembler/mantle/platform" "github.com/coreos/coreos-assembler/mantle/platform/conf" - "github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu" + "github.com/coreos/coreos-assembler/mantle/platform/machine/qemu" ut "github.com/coreos/coreos-assembler/mantle/util" ) @@ -57,10 +57,11 @@ boot_device: func init() { register.RegisterTest(®ister.Test{ - Run: runBootMirrorTest, - ClusterSize: 0, - Name: `coreos.boot-mirror`, - Platforms: []string{"qemu-unpriv"}, + Run: runBootMirrorTest, + ClusterSize: 0, + Name: `coreos.boot-mirror`, + Description: "Verify the boot-mirror RAID1 flow works properly in both BIOS and UEFI mode.", + Platforms: []string{"qemu"}, ExcludeDistros: []string{"nestos"}, // Can't mirror boot disk on s390x ExcludeArchitectures: []string{"s390x"}, @@ -72,10 +73,11 @@ func init() { Timeout: 15 * time.Minute, }) register.RegisterTest(®ister.Test{ - Run: runBootMirrorLUKSTest, - ClusterSize: 0, - Name: `coreos.boot-mirror.luks`, - Platforms: []string{"qemu-unpriv"}, + Run: runBootMirrorLUKSTest, + ClusterSize: 0, + Name: `coreos.boot-mirror.luks`, + Description: "Verify the boot-mirror+LUKS RAID1 flow works properly in both BIOS and UEFI modes.", + Platforms: []string{"qemu"}, ExcludeDistros: []string{"nestos"}, // Can't mirror boot disk on s390x, and qemu s390x doesn't // support TPM @@ -103,7 +105,7 @@ func runBootMirrorTest(c cluster.TestCluster) { // FIXME: for QEMU tests kola currently assumes the host CPU architecture // matches the one under test userdata := bootmirror.Subst("LAYOUT", coreosarch.CurrentRpmArch()) - m, err = c.Cluster.(*unprivqemu.Cluster).NewMachineWithQemuOptions(userdata, options) + m, err = c.Cluster.(*qemu.Cluster).NewMachineWithQemuOptions(userdata, options) if err != nil { c.Fatal(err) } @@ -150,7 +152,7 @@ func runBootMirrorLUKSTest(c cluster.TestCluster) { // FIXME: for QEMU tests kola currently assumes the host CPU architecture // matches the one under test userdata := bootmirrorluks.Subst("LAYOUT", coreosarch.CurrentRpmArch()) - m, err = c.Cluster.(*unprivqemu.Cluster).NewMachineWithQemuOptions(userdata, options) + m, err = c.Cluster.(*qemu.Cluster).NewMachineWithQemuOptions(userdata, options) if err != nil { c.Fatal(err) } diff --git a/mantle/kola/tests/misc/multipath.go b/mantle/kola/tests/misc/multipath.go index 5bfc9125..48ba4593 100644 --- a/mantle/kola/tests/misc/multipath.go +++ b/mantle/kola/tests/misc/multipath.go @@ -99,7 +99,7 @@ func init() { Name: "multipath.day1", Run: runMultipathDay1, ClusterSize: 1, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, ExcludeDistros: []string{"nestos"}, UserData: mpath_on_boot_day1, MultiPathDisk: true, @@ -108,7 +108,7 @@ func init() { Name: "multipath.day2", Run: runMultipathDay2, ClusterSize: 1, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, ExcludeDistros: []string{"nestos"}, MultiPathDisk: true, }) @@ -116,7 +116,7 @@ func init() { Name: "multipath.partition", Run: runMultipathPartition, ClusterSize: 1, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, ExcludeDistros: []string{"nestos"}, UserData: mpath_on_var_lib_containers, AdditionalDisks: []string{"1G:mpath"}, diff --git a/mantle/kola/tests/misc/network.go b/mantle/kola/tests/misc/network.go index 738a50c2..9d083ad5 100644 --- a/mantle/kola/tests/misc/network.go +++ b/mantle/kola/tests/misc/network.go @@ -26,7 +26,7 @@ import ( "github.com/coreos/coreos-assembler/mantle/kola/register" "github.com/coreos/coreos-assembler/mantle/platform" "github.com/coreos/coreos-assembler/mantle/platform/conf" - "github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu" + "github.com/coreos/coreos-assembler/mantle/platform/machine/qemu" "github.com/coreos/coreos-assembler/mantle/util" ) @@ -34,7 +34,8 @@ func init() { register.RegisterTest(®ister.Test{ Run: NetworkListeners, ClusterSize: 1, - Name: "nestos.network.listeners", + Name: "fcos.network.listeners", + Description: "Verify the nework listeners are expected.", Distros: []string{"fcos", "nestos"}, // be sure to notice listeners in the docker stack UserData: conf.EmptyIgnition(), @@ -44,17 +45,18 @@ func init() { Run: NetworkInitramfsSecondBoot, ClusterSize: 1, Name: "coreos.network.initramfs.second-boot", + Description: "Verify that networking is not started in the initramfs on the second boot.", ExcludeDistros: []string{"fcos", "rhcos", "nestos"}, }) // This test follows the same network configuration used on https://github.com/RHsyseng/rhcos-slb - // with a slight change, where the MCO script is run from ignition: https://github.com/RHsyseng/rhcos-slb/blob/main/setup-ovs.sh. register.RegisterTest(®ister.Test{ Run: NetworkAdditionalNics, ClusterSize: 0, Name: "rhcos.network.multiple-nics", + Description: "Verify configuring networking with multiple NICs work.", Timeout: 20 * time.Minute, Distros: []string{"rhcos"}, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, }) // This test follows the same network configuration used on https://github.com/RHsyseng/rhcos-slb // with a slight change, where the MCO script is run from ignition: https://github.com/RHsyseng/rhcos-slb/blob/main/setup-ovs.sh. @@ -65,7 +67,7 @@ func init() { Name: "rhcos.network.bond-with-dhcp", Timeout: 20 * time.Minute, Distros: []string{"rhcos"}, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, }) // This test follows the same network configuration used on https://github.com/RHsyseng/rhcos-slb // with a slight change, where the MCO script is run from ignition: https://github.com/RHsyseng/rhcos-slb/blob/main/setup-ovs.sh. @@ -76,7 +78,7 @@ func init() { Name: "rhcos.network.bond-with-restart", Timeout: 20 * time.Minute, Distros: []string{"rhcos"}, - Platforms: []string{"qemu-unpriv"}, + Platforms: []string{"qemu"}, }) } @@ -721,7 +723,7 @@ func setupMultipleNetworkTest(c cluster.TestCluster, primaryMac, secondaryMac st // the golang compiler no longer checks that the individual types in the case have the // NewMachineWithQemuOptions function, but rather whether platform.Cluster // does which fails - case *unprivqemu.Cluster: + case *qemu.Cluster: m, err = pc.NewMachineWithQemuOptions(userdata, options) default: panic("unreachable") diff --git a/mantle/kola/tests/misc/nfs.go b/mantle/kola/tests/misc/nfs.go index df523c70..49643de4 100644 --- a/mantle/kola/tests/misc/nfs.go +++ b/mantle/kola/tests/misc/nfs.go @@ -61,8 +61,8 @@ func init() { // Disabled on Azure because setting hostname // is required at the instance creation level - // qemu-unpriv machines cannot communicate - ExcludePlatforms: []string{"azure", "qemu-unpriv"}, + // qemu machines cannot communicate + ExcludePlatforms: []string{"azure", "qemu"}, }) } diff --git a/mantle/kola/tests/rhcos/upgrade.go b/mantle/kola/tests/rhcos/upgrade.go index c9230332..9af96b69 100644 --- a/mantle/kola/tests/rhcos/upgrade.go +++ b/mantle/kola/tests/rhcos/upgrade.go @@ -33,7 +33,7 @@ import ( "github.com/coreos/coreos-assembler/mantle/kola/tests/util" "github.com/coreos/coreos-assembler/mantle/platform" "github.com/coreos/coreos-assembler/mantle/platform/conf" - "github.com/coreos/coreos-assembler/mantle/platform/machine/unprivqemu" + "github.com/coreos/coreos-assembler/mantle/platform/machine/qemu" installer "github.com/coreos/coreos-assembler/mantle/util" ) @@ -208,7 +208,7 @@ func rhcosUpgradeFromOcpRhcos(c cluster.TestCluster) { }`) switch pc := c.Cluster.(type) { - case *unprivqemu.Cluster: + case *qemu.Cluster: ostreeCommit := kola.CosaBuild.Meta.OstreeCommit temp := os.TempDir() rhcosQcow2, err := downloadLatestReleasedRHCOS(temp) diff --git a/mantle/platform/machine/unprivqemu/cluster.go b/mantle/platform/machine/qemu/cluster.go similarity index 98% rename from mantle/platform/machine/unprivqemu/cluster.go rename to mantle/platform/machine/qemu/cluster.go index 096c4a84..089a971e 100644 --- a/mantle/platform/machine/unprivqemu/cluster.go +++ b/mantle/platform/machine/qemu/cluster.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package unprivqemu +package qemu import ( "fmt" @@ -79,7 +79,7 @@ func (qc *Cluster) NewMachineWithQemuOptions(userdata *conf.UserData, options pl } } else if conf.IsEmpty() { } else { - return nil, fmt.Errorf("unprivileged qemu only supports Ignition or empty configs") + return nil, fmt.Errorf("qemu only supports Ignition or empty configs") } journal, err := platform.NewJournal(dir) diff --git a/mantle/platform/machine/unprivqemu/flight.go b/mantle/platform/machine/qemu/flight.go similarity index 99% rename from mantle/platform/machine/unprivqemu/flight.go rename to mantle/platform/machine/qemu/flight.go index 68f44330..f2bf7ada 100644 --- a/mantle/platform/machine/unprivqemu/flight.go +++ b/mantle/platform/machine/qemu/flight.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package unprivqemu +package qemu import ( "github.com/coreos/pkg/capnslog" diff --git a/mantle/platform/machine/unprivqemu/machine.go b/mantle/platform/machine/qemu/machine.go similarity index 99% rename from mantle/platform/machine/unprivqemu/machine.go rename to mantle/platform/machine/qemu/machine.go index c217bb0c..807fc6a5 100644 --- a/mantle/platform/machine/unprivqemu/machine.go +++ b/mantle/platform/machine/qemu/machine.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package unprivqemu +package qemu import ( "context" diff --git a/src/cmd-kola b/src/cmd-kola index 6239e1e9..fc668552 100755 --- a/src/cmd-kola +++ b/src/cmd-kola @@ -47,7 +47,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]) diff --git a/src/cmd-offline-update b/src/cmd-offline-update index fc06faff..28efe177 100755 --- a/src/cmd-offline-update +++ b/src/cmd-offline-update @@ -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 -- Gitee