Skip to content

Commit

Permalink
platform/metal: set serial console in PXE and ISO tests
Browse files Browse the repository at this point in the history
In both PXE and ISO tests, we aren't modifying the console settings of
the installed system. This means that the `console.txt` artifact doesn't
contain any data from the installed system when we reboot into it. This
makes debugging failing tests harder.

In ISO tests, we were already dropping a `installer.d/mantle.yaml` file
to customize the install. Extend the file to also include a `console`
key.

In PXE tests, we drive coreos-installer from the `coreos.inst.*` kargs.
There is no way to tell coreos-installer to use a specific console
setting from just kargs, so drop an `installer.d/mantle.yaml` file
containing just the `console` key.
  • Loading branch information
jlebon committed Apr 19, 2023
1 parent 86bc2a9 commit 694f96f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mantle/platform/metal.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ func (inst *Install) PXE(kargs []string, liveIgnition, ignition conf.Conf, offli
return nil, err
}

installerConfig := installerConfig{
Console: []string{consoleKernelArgument[coreosarch.CurrentRpmArch()]},
}
installerConfigData, err := yaml.Marshal(installerConfig)
if err != nil {
return nil, err
}
mode := 0644

liveIgnition.AddFile("/etc/coreos/installer.d/mantle.yaml", string(installerConfigData), mode)

inst.kargs = kargs
inst.ignition = ignition
inst.liveIgnition = liveIgnition
Expand Down Expand Up @@ -564,7 +575,8 @@ type installerConfig struct {
Insecure bool `yaml:",omitempty"`
AppendKargs []string `yaml:"append-karg,omitempty"`
CopyNetwork bool `yaml:"copy-network,omitempty"`
DestDevice string `yaml:"dest-device"`
DestDevice string `yaml:"dest-device,omitempty"`
Console []string `yaml:"console,omitempty"`
}

func (inst *Install) InstallViaISOEmbed(kargs []string, liveIgnition, targetIgnition conf.Conf, outdir string, offline, minimal bool) (*InstalledMachine, error) {
Expand Down Expand Up @@ -592,6 +604,7 @@ func (inst *Install) InstallViaISOEmbed(kargs []string, liveIgnition, targetIgni
installerConfig := installerConfig{
IgnitionFile: "/var/opt/pointer.ign",
DestDevice: "/dev/vda",
Console: []string{consoleKernelArgument[coreosarch.CurrentRpmArch()]},
}

if inst.MultiPathDisk {
Expand Down

0 comments on commit 694f96f

Please sign in to comment.