File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,17 @@ func (builder *NetworkBuilder) WithMetaPluginAllMultiFlag(allMultiFlag bool) *Ne
152
152
return builder
153
153
}
154
154
155
+ // WithMetaPluginRdma activates rdma plugin on a SriovNetwork configuration.
156
+ func (builder * NetworkBuilder ) WithMetaPluginRdma () * NetworkBuilder {
157
+ if valid , _ := builder .validate (); ! valid {
158
+ return builder
159
+ }
160
+
161
+ builder .Definition .Spec .MetaPluginsConfig = `{ "type": "rdma" }`
162
+
163
+ return builder
164
+ }
165
+
155
166
// WithLinkState sets linkState parameters in the SrIovNetwork definition spec.
156
167
func (builder * NetworkBuilder ) WithLinkState (linkState string ) * NetworkBuilder {
157
168
if valid , _ := builder .validate (); ! valid {
Original file line number Diff line number Diff line change @@ -345,6 +345,22 @@ func TestWithMetaPluginAllMultiFlag(t *testing.T) {
345
345
}
346
346
}
347
347
348
+ func TestSriovNetworkWithMetaPluginRdma (t * testing.T ) {
349
+ testCases := []struct {
350
+ metaPlugin string
351
+ }{
352
+ {
353
+ metaPlugin : `{ "type": "rdma" }` ,
354
+ },
355
+ }
356
+
357
+ for _ , testCase := range testCases {
358
+ testSettings := buildTestClientWithDummyObject ()
359
+ netBuilder := buildValidSriovNetworkTestBuilder (testSettings ).WithMetaPluginRdma ()
360
+ assert .Equal (t , netBuilder .Definition .Spec .MetaPluginsConfig , testCase .metaPlugin )
361
+ }
362
+ }
363
+
348
364
func TestWithLinkState (t * testing.T ) {
349
365
testCases := []struct {
350
366
linkState string
You can’t perform that action at this time.
0 commit comments