Skip to content

Commit 9499239

Browse files
kola: don't fail iso.* tests when live arifacts don't exist
1 parent aff596e commit 9499239

File tree

7 files changed

+40
-3
lines changed

7 files changed

+40
-3
lines changed

mantle/kola/tests/iso/common.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ func CheckTestOutput(output *os.File, expected []string) error {
192192
return nil
193193
}
194194

195+
func EnsureLiveArtifactsExist() error {
196+
if kola.CosaBuild.Meta.BuildArtifacts.LiveIso == nil || kola.CosaBuild.Meta.BuildArtifacts.LiveKernel == nil {
197+
return errors.Errorf("Build %s is missing live artifacts\n", kola.CosaBuild.Meta.Name)
198+
}
199+
if kola.CosaBuild.Meta.BuildArtifacts.Metal == nil || kola.CosaBuild.Meta.BuildArtifacts.Metal4KNative == nil {
200+
return errors.Errorf("Build %s is missing live metal artifacts\n", kola.CosaBuild.Meta.Name)
201+
}
202+
return nil
203+
}
204+
195205
func awaitCompletion(c cluster.TestCluster, inst *platform.QemuInstance, console bool, outdir string, qchan *os.File, booterrchan chan error, expected []string) error {
196206
ctx := c.Context()
197207

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package iso
22

33
import (
4+
"fmt"
45
"path/filepath"
56

67
"github.com/coreos/coreos-assembler/mantle/kola"
@@ -42,6 +43,11 @@ func isoAsDiskUefiSecure(c cluster.TestCluster) {
4243
}
4344

4445
func isoTestAsDisk(c cluster.TestCluster, opts IsoTestOpts) {
46+
if err := EnsureLiveArtifactsExist(); err != nil {
47+
fmt.Println(err)
48+
return
49+
}
50+
4551
qc, ok := c.Cluster.(*qemu.Cluster)
4652
if !ok {
4753
c.Fatalf("Unsupported cluster type")

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package iso
22

33
import (
4+
"fmt"
45
"path/filepath"
56

67
"github.com/coreos/coreos-assembler/mantle/kola"
@@ -39,6 +40,11 @@ ExecStart=grep FIPS etc/crypto-policies/config
3940
RequiredBy=fips-signal-ok.service`
4041

4142
func testLiveFIPS(c cluster.TestCluster) {
43+
if err := EnsureLiveArtifactsExist(); err != nil {
44+
fmt.Println(err)
45+
return
46+
}
47+
4248
qc, ok := c.Cluster.(*qemu.Cluster)
4349
if !ok {
4450
c.Fatalf("Unsupported cluster type")

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ var iscsi_butane_config string
8989
// - when the system is booted, write a success string to /dev/virtio-ports/testisocompletion
9090
// - as this serial device is mapped to the host serial device, the test concludes
9191
func isoInstalliScsi(c cluster.TestCluster, opts IsoTestOpts) {
92+
if err := EnsureLiveArtifactsExist(); err != nil {
93+
fmt.Println(err)
94+
return
95+
}
96+
9297
qc, ok := c.Cluster.(*qemu.Cluster)
9398
if !ok {
9499
c.Fatalf("Unsupported cluster type")

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ const defaultQemuHostIPv4 = "10.0.2.2"
224224
const liveISOFromRAMKarg = "coreos.liveiso.fromram"
225225

226226
func isoLiveInstall(c cluster.TestCluster, opts IsoTestOpts) {
227+
if err := EnsureLiveArtifactsExist(); err != nil {
228+
fmt.Println(err)
229+
return
230+
}
227231
if opts.isMiniso && opts.isOffline { // ideally this'd be one enum parameter
228232
c.Fatal("Can't run minimal install offline")
229233
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package iso
22

33
import (
4+
"fmt"
45
"path/filepath"
56

67
"github.com/coreos/coreos-assembler/mantle/kola"
@@ -20,10 +21,10 @@ func init() {
2021
}
2122

2223
func testLiveLogin(c cluster.TestCluster, enableUefi bool, enableUefiSecure bool) {
23-
if kola.CosaBuild.Meta.BuildArtifacts.LiveIso == nil || kola.CosaBuild.Meta.BuildArtifacts.LiveKernel == nil {
24-
c.Fatalf("Build %s is missing live artifacts\n", kola.CosaBuild.Meta.Name)
24+
if err := EnsureLiveArtifactsExist(); err != nil {
25+
fmt.Println(err)
26+
return
2527
}
26-
2728
butane := conf.Butane(`
2829
variant: fcos
2930
version: 1.1.0`)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ RequiredBy=coreos-installer.target
130130
`
131131

132132
func testPXE(c cluster.TestCluster, opts IsoTestOpts) {
133+
if err := EnsureLiveArtifactsExist(); err != nil {
134+
fmt.Println(err)
135+
return
136+
}
137+
133138
var outdir string
134139
var qc *qemu.Cluster
135140

0 commit comments

Comments
 (0)