@@ -29,6 +29,7 @@ import (
29
29
30
30
"github.com/onsi/ginkgo/v2"
31
31
"github.com/onsi/gomega"
32
+ "github.com/onsi/gomega/format"
32
33
"github.com/onsi/gomega/gstruct"
33
34
"github.com/onsi/gomega/types"
34
35
@@ -1208,6 +1209,75 @@ var _ = framework.SIGDescribe("node")("DRA", feature.DynamicResourceAllocation,
1208
1209
b1 .create (ctx , claim1 , claim1b , claim2 , claim2b , pod )
1209
1210
b1 .testPod (ctx , f .ClientSet , pod )
1210
1211
})
1212
+
1213
+ ginkgo .It ("foobar" , func (ctx context.Context ) {
1214
+ ginkgo .By ("Running the multiclaim test" )
1215
+ name := "external-multiclaim"
1216
+ params := `{"a":"b"}`
1217
+ rc := & resourceapi.ResourceClaim {
1218
+ ObjectMeta : metav1.ObjectMeta {
1219
+ Name : name ,
1220
+ },
1221
+ Spec : resourceapi.ResourceClaimSpec {
1222
+ Devices : resourceapi.DeviceClaim {
1223
+ Requests : []resourceapi.DeviceRequest {{
1224
+ Name : "my-request" ,
1225
+ FirstAvailableOf : []resourceapi.DeviceRequest {
1226
+ {
1227
+ Name : "request-1" ,
1228
+ DeviceClassName : b1 .className (),
1229
+ AllocationMode : resourceapi .DeviceAllocationModeExactCount ,
1230
+ Count : 1 ,
1231
+ },
1232
+ {
1233
+ Name : "request-2" ,
1234
+ DeviceClassName : b2 .className (),
1235
+ AllocationMode : resourceapi .DeviceAllocationModeExactCount ,
1236
+ Count : 1 ,
1237
+ },
1238
+ },
1239
+ }},
1240
+ Config : []resourceapi.DeviceClaimConfiguration {
1241
+ {
1242
+ Requests : []string {"request-1" },
1243
+ DeviceConfiguration : resourceapi.DeviceConfiguration {
1244
+ Opaque : & resourceapi.OpaqueDeviceConfiguration {
1245
+ Driver : b1 .driver .Name ,
1246
+ Parameters : runtime.RawExtension {
1247
+ Raw : []byte (params ),
1248
+ },
1249
+ },
1250
+ },
1251
+ },
1252
+ {
1253
+ Requests : []string {"request-2" },
1254
+ DeviceConfiguration : resourceapi.DeviceConfiguration {
1255
+ Opaque : & resourceapi.OpaqueDeviceConfiguration {
1256
+ Driver : b2 .driver .Name ,
1257
+ Parameters : runtime.RawExtension {
1258
+ Raw : []byte (params ),
1259
+ },
1260
+ },
1261
+ },
1262
+ },
1263
+ },
1264
+ },
1265
+ },
1266
+ }
1267
+ framework .Logf ("New ResourceClaim:\n %s" , format .Object (rc , 1 ))
1268
+ pod := b1 .podExternal ()
1269
+ podClaimName := "resource-claim"
1270
+ externalClaimName := "external-multiclaim"
1271
+ pod .Spec .ResourceClaims = []v1.PodResourceClaim {
1272
+ {
1273
+ Name : podClaimName ,
1274
+ ResourceClaimName : & externalClaimName ,
1275
+ },
1276
+ }
1277
+ framework .Logf ("New Pod:\n %s" , format .Object (pod , 1 ))
1278
+ b1 .create (ctx , rc , pod )
1279
+ b1 .testPod (ctx , f .ClientSet , pod )
1280
+ })
1211
1281
}
1212
1282
multipleDriversContext := func (prefix string , nodeV1alpha3 bool ) {
1213
1283
ginkgo .Context (prefix , func () {
0 commit comments