Skip to content

Commit 7204ab2

Browse files
marmijotravier
authored andcommitted
kola: remove IBM CEX device test for the s390x build
This test was added to coreos-assembler before 4.19 branched, so it ended up in 4.18 but was intended for 4.19+. It recently started failing in 4.18 due to the addition of CEX configuration in RHCOS. Remove the test from 4.18 to unblock the pipeline. This reverts commit 41e5c4a.
1 parent c461f65 commit 7204ab2

File tree

7 files changed

+0
-132
lines changed

7 files changed

+0
-132
lines changed

mantle/cmd/kola/options.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ func init() {
168168
bv(&kola.QEMUOptions.SecureExecution, "qemu-secex", false, "Run IBM Secure Execution Image")
169169
sv(&kola.QEMUOptions.SecureExecutionIgnitionPubKey, "qemu-secex-ignition-pubkey", "", "Path to Ignition GPG Public Key")
170170
sv(&kola.QEMUOptions.SecureExecutionHostKey, "qemu-secex-hostkey", "", "Path to Secure Execution HKD certificate")
171-
// s390x CEX-specific options
172-
bv(&kola.QEMUOptions.Cex, "qemu-cex", false, "Attach CEX device to guest")
173171
}
174172

175173
// Sync up the command line options if there is dependency

mantle/cmd/kola/qemuexec.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,6 @@ func runQemuExec(cmd *cobra.Command, args []string) error {
391391
}
392392
}
393393

394-
// IBM Cex based luks encryption.
395-
if kola.QEMUOptions.Cex {
396-
err := builder.AddCexDevice()
397-
if err != nil {
398-
return err
399-
}
400-
}
401-
402394
if devshell && !devshellConsole {
403395
return runDevShellSSH(ctx, builder, config, sshCommand)
404396
}

mantle/kola/tests/ignition/luks.go

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ package ignition
22

33
import (
44
"fmt"
5-
"os"
65
"time"
76

87
coreosarch "github.com/coreos/stream-metadata-go/arch"
98

109
"github.com/coreos/coreos-assembler/mantle/kola"
1110
"github.com/coreos/coreos-assembler/mantle/kola/cluster"
1211
"github.com/coreos/coreos-assembler/mantle/kola/register"
13-
"github.com/coreos/coreos-assembler/mantle/kola/tests/coretest"
1412
ut "github.com/coreos/coreos-assembler/mantle/kola/tests/util"
1513
"github.com/coreos/coreos-assembler/mantle/platform"
1614
"github.com/coreos/coreos-assembler/mantle/platform/conf"
@@ -52,20 +50,6 @@ func init() {
5250
ExcludeArchitectures: []string{"s390x"}, // no TPM backend support for s390x
5351
Tags: []string{"luks", "tpm", "tang", "sss", kola.NeedsInternetTag, "reprovision"},
5452
})
55-
register.RegisterTest(&register.Test{
56-
Run: runCexTest,
57-
ClusterSize: 0,
58-
Name: `luks.cex`,
59-
Description: "Verify that CEX-based rootfs encryption works.",
60-
Flags: []register.Flag{},
61-
Platforms: []string{"qemu"},
62-
Architectures: []string{"s390x"},
63-
Tags: []string{"luks", "cex", "reprovision"},
64-
NativeFuncs: map[string]register.NativeFuncWrap{
65-
"RHCOSGrowpart": register.CreateNativeFuncWrap(coretest.TestRHCOSGrowfs, []string{"fcos"}...),
66-
"FCOSGrowpart": register.CreateNativeFuncWrap(coretest.TestFCOSGrowfs, []string{"rhcos"}...),
67-
},
68-
})
6953
}
7054

7155
func setupTangMachine(c cluster.TestCluster) ut.TangServer {
@@ -192,74 +176,6 @@ func runTest(c cluster.TestCluster, tpm2 bool, threshold int, killTangAfterFirst
192176
ut.LUKSSanityTest(c, tangd, m, tpm2, killTangAfterFirstBoot, rootPart)
193177
}
194178

195-
func runCexTest(c cluster.TestCluster) {
196-
var err error
197-
var m platform.Machine
198-
199-
// To prevent the test to fail the whole run on s390x machine that does not have Cex Device
200-
cex_uuid := os.Getenv("KOLA_CEX_UUID")
201-
if cex_uuid == "" {
202-
c.Skip("No CEX device found in KOLA_CEX_UUID env var")
203-
}
204-
205-
ignition := conf.Ignition(`{
206-
"ignition": {
207-
"version": "3.5.0-experimental"
208-
},
209-
"kernelArguments": {
210-
"shouldExist": [
211-
"rd.luks.key=/etc/luks/cex.key"
212-
]
213-
},
214-
"storage": {
215-
"luks": [
216-
{
217-
"name": "root",
218-
"device": "/dev/disk/by-label/root",
219-
"cex": {
220-
"enabled": true
221-
},
222-
"label": "root",
223-
"wipeVolume": true
224-
}
225-
],
226-
"filesystems": [
227-
{
228-
"device": "/dev/mapper/root",
229-
"format": "xfs",
230-
"wipeFilesystem": true,
231-
"label": "root"
232-
}
233-
]
234-
}
235-
}`)
236-
237-
opts := platform.QemuMachineOptions{
238-
Cex: true,
239-
}
240-
opts.MinMemory = 8192
241-
242-
switch pc := c.Cluster.(type) {
243-
case *qemu.Cluster:
244-
m, err = pc.NewMachineWithQemuOptions(ignition, opts)
245-
default:
246-
panic("Unsupported cluster type")
247-
}
248-
249-
// copy over kolet into the machine
250-
if err := kola.ScpKolet([]platform.Machine{m}); err != nil {
251-
c.Fatal(err)
252-
}
253-
coretest.LocalTests(c)
254-
255-
if err != nil {
256-
c.Fatalf("Unable to create test machine: %v", err)
257-
}
258-
rootPart := "/dev/disk/by-partlabel/root"
259-
260-
ut.LUKSSanityCEXTest(c, m, rootPart)
261-
}
262-
263179
// Verify that the rootfs is encrypted with Tang
264180
func luksTangTest(c cluster.TestCluster) {
265181
runTest(c, false, 1, false)

mantle/kola/tests/util/luks.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,3 @@ func LUKSSanityTest(c cluster.TestCluster, tangd TangServer, m platform.Machine,
7979
luksDump = c.MustSSH(m, "sudo cryptsetup luksDump "+rootPart)
8080
mustMatch(c, "Cipher: *aes", luksDump)
8181
}
82-
83-
// LUKSSanityCEXTest verifies that the rootfs is encrypted with Cex based LUKS
84-
func LUKSSanityCEXTest(c cluster.TestCluster, m platform.Machine, rootPart string) {
85-
var err error
86-
luksDump := c.MustSSH(m, "sudo cryptsetup luksDump "+rootPart)
87-
mustMatch(c, "cipher: paes-*", luksDump)
88-
mustNotMatch(c, "Cipher: *cipher_null-ecb", luksDump)
89-
mustMatch(c, "0: paes-verification-pattern", luksDump)
90-
mustNotMatch(c, "9: *coreos", luksDump)
91-
92-
err = m.Reboot()
93-
94-
if err != nil {
95-
c.Fatalf("Failed to reboot the machine: %v", err)
96-
}
97-
luksDump = c.MustSSH(m, "sudo cryptsetup luksDump "+rootPart)
98-
mustMatch(c, "cipher: paes-*", luksDump)
99-
}

mantle/platform/machine/qemu/cluster.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ func (qc *Cluster) NewMachineWithQemuOptions(userdata *conf.UserData, options pl
150150
primaryDisk = *diskp
151151
}
152152

153-
if qc.flight.opts.Cex || options.Cex {
154-
if err := builder.AddCexDevice(); err != nil {
155-
return nil, err
156-
}
157-
}
158-
159153
if qc.flight.opts.Nvme || options.Nvme {
160154
primaryDisk.Channel = "nvme"
161155
}

mantle/platform/machine/qemu/flight.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ type Options struct {
5555
SecureExecutionIgnitionPubKey string
5656
SecureExecutionHostKey string
5757

58-
// Option to create IBM cex based luks encryption
59-
Cex bool
60-
6158
*platform.Options
6259
}
6360

mantle/platform/qemu.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ type QemuMachineOptions struct {
7474
OverrideBackingFile string
7575
Firmware string
7676
Nvme bool
77-
Cex bool
7877
}
7978

8079
// QEMUMachine represents a qemu instance.
@@ -2059,13 +2058,3 @@ func (builder *QemuBuilder) Close() {
20592058
os.RemoveAll(builder.tempdir)
20602059
}
20612060
}
2062-
2063-
// supports IBM Cex based LUKS encryption if it is s390x host (zKVM/LPAR)
2064-
func (builder *QemuBuilder) AddCexDevice() error {
2065-
cex_uuid := os.Getenv("KOLA_CEX_UUID")
2066-
if cex_uuid == "" {
2067-
return errors.New("cannot add CEX device: KOLA_CEX_UUID env var undefined")
2068-
}
2069-
builder.Append("-device", fmt.Sprintf("vfio-ap,sysfsdev=/sys/devices/vfio_ap/matrix/%s", cex_uuid))
2070-
return nil
2071-
}

0 commit comments

Comments
 (0)