Skip to content

Commit 9816db6

Browse files
kola: check ssh to VM when running iso.* tests
1 parent 370503b commit 9816db6

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

mantle/kola/tests/iso/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ OnFailureJobMode=isolate
186186
[Service]
187187
Type=oneshot
188188
RemainAfterExit=yes
189-
ExecStart=/bin/sh -c '/usr/bin/echo %s >/dev/virtio-ports/testisocompletion && systemctl poweroff'
189+
ExecStart=/bin/sh -c '/usr/bin/echo %s >/dev/virtio-ports/testisocompletion'
190190
[Install]
191191
RequiredBy=multi-user.target`, signalCompleteString)
192192

mantle/kola/tests/iso/live-iso.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,14 @@ func isoRunTest(qc *qemu.Cluster, opts IsoTestOpts, tempdir string) error {
383383
if opts.addNmKeyfile {
384384
kargs = append(kargs, "rd.neednet=1")
385385
}
386-
builder.AppendKernelArgs = strings.Join(kargs, " ")
387-
return nil
388-
}
389-
390-
setupNet := func(o platform.QemuMachineOptions, builder *platform.QemuBuilder) error {
391386
if !opts.isOffline {
392387
// also save pointer config into the output dir for debugging
393-
path := filepath.Join(qc.RuntimeConf().OutputDir, builder.UUID, "config-target-pointer.ign")
388+
path := filepath.Join(filepath.Dir(builder.ConfigFile), "config-target-pointer.ign")
394389
if err := targetConfig.WriteFile(path); err != nil {
395390
return err
396391
}
397-
return qc.SetupDefaultNetwork(o, builder)
398392
}
393+
builder.AppendKernelArgs = strings.Join(kargs, " ")
399394
return nil
400395
}
401396

@@ -433,10 +428,8 @@ func isoRunTest(qc *qemu.Cluster, opts IsoTestOpts, tempdir string) error {
433428
return builder.AddIso(isopath, "bootindex=3", false)
434429
}
435430

436-
extra := platform.QemuMachineOptions{}
437-
extra.SkipStartMachine = true
438-
callacks := qemu.BuilderCallbacks{SetupDisks: setupDisks, SetupNetwork: setupNet, OverrideDefaults: overrideFW}
439-
qm, err := qc.NewMachineWithQemuOptionsAndBuilderCallbacks(liveConfig, extra, callacks)
431+
callacks := qemu.BuilderCallbacks{SetupDisks: setupDisks, OverrideDefaults: overrideFW}
432+
qm, err := qc.NewMachineWithQemuOptionsAndBuilderCallbacks(liveConfig, platform.QemuMachineOptions{}, callacks)
440433
if err != nil {
441434
return errors.Wrap(err, "unable to create test machine")
442435
}

mantle/kola/tests/iso/live-pxe.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func testPXE(c cluster.TestCluster, opts IsoTestOpts) {
235235
return nil
236236
}
237237

238-
setupNet := func(_ platform.QemuMachineOptions, builder *platform.QemuBuilder) error {
238+
setupNet := func(o platform.QemuMachineOptions, builder *platform.QemuBuilder) error {
239239
netdev := fmt.Sprintf("%s,netdev=mynet0,mac=52:54:00:12:34:56", pxe.networkdevice)
240240
if pxe.bootindex == "" {
241241
builder.Append("-boot", "once=n")
@@ -248,7 +248,7 @@ func testPXE(c cluster.TestCluster, opts IsoTestOpts) {
248248
usernetdev += ",net=192.168.76.0/24,dhcpstart=192.168.76.9"
249249
}
250250
builder.Append("-netdev", usernetdev)
251-
return nil
251+
return qc.SetupDefaultNetwork(o, builder)
252252
}
253253

254254
var isoCompletionOutput *os.File
@@ -285,10 +285,8 @@ func testPXE(c cluster.TestCluster, opts IsoTestOpts) {
285285
return nil
286286
}
287287

288-
extra := platform.QemuMachineOptions{}
289-
extra.SkipStartMachine = true
290288
callacks := qemu.BuilderCallbacks{SetupDisks: setupDisks, SetupNetwork: setupNet, OverrideDefaults: overrideFW}
291-
qm, err := qc.NewMachineWithQemuOptionsAndBuilderCallbacks(liveConfig, extra, callacks)
289+
qm, err := qc.NewMachineWithQemuOptionsAndBuilderCallbacks(liveConfig, platform.QemuMachineOptions{}, callacks)
292290
if err != nil {
293291
c.Fatal(errors.Wrap(err, "unable to create test machine"))
294292
}

0 commit comments

Comments
 (0)