@@ -2,15 +2,13 @@ package ignition
22
33import (
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
7155func 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
264180func luksTangTest (c cluster.TestCluster ) {
265181 runTest (c , false , 1 , false )
0 commit comments