@@ -2,15 +2,13 @@ package ignition
2
2
3
3
import (
4
4
"fmt"
5
- "os"
6
5
"time"
7
6
8
7
coreosarch "github.com/coreos/stream-metadata-go/arch"
9
8
10
9
"github.com/coreos/coreos-assembler/mantle/kola"
11
10
"github.com/coreos/coreos-assembler/mantle/kola/cluster"
12
11
"github.com/coreos/coreos-assembler/mantle/kola/register"
13
- "github.com/coreos/coreos-assembler/mantle/kola/tests/coretest"
14
12
ut "github.com/coreos/coreos-assembler/mantle/kola/tests/util"
15
13
"github.com/coreos/coreos-assembler/mantle/platform"
16
14
"github.com/coreos/coreos-assembler/mantle/platform/conf"
@@ -52,20 +50,6 @@ func init() {
52
50
ExcludeArchitectures : []string {"s390x" }, // no TPM backend support for s390x
53
51
Tags : []string {"luks" , "tpm" , "tang" , "sss" , kola .NeedsInternetTag , "reprovision" },
54
52
})
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
- })
69
53
}
70
54
71
55
func setupTangMachine (c cluster.TestCluster ) ut.TangServer {
@@ -192,74 +176,6 @@ func runTest(c cluster.TestCluster, tpm2 bool, threshold int, killTangAfterFirst
192
176
ut .LUKSSanityTest (c , tangd , m , tpm2 , killTangAfterFirstBoot , rootPart )
193
177
}
194
178
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
-
263
179
// Verify that the rootfs is encrypted with Tang
264
180
func luksTangTest (c cluster.TestCluster ) {
265
181
runTest (c , false , 1 , false )
0 commit comments