@@ -275,6 +275,13 @@ func TestMicroVMExecution(t *testing.T) {
275
275
276
276
vmlinuxPath := getVmlinuxPath (t )
277
277
278
+ networkIfaces := []NetworkInterface {
279
+ {
280
+ MacAddress : "01-23-45-67-89-AB-CD-EF" ,
281
+ HostDevName : "tap0" ,
282
+ },
283
+ }
284
+
278
285
cfg := Config {
279
286
SocketPath : socketPath ,
280
287
LogFifo : logFifo ,
@@ -288,6 +295,7 @@ func TestMicroVMExecution(t *testing.T) {
288
295
},
289
296
Debug : true ,
290
297
DisableValidation : true ,
298
+ NetworkInterfaces : networkIfaces ,
291
299
}
292
300
293
301
ctx := context .Background ()
@@ -332,6 +340,7 @@ func TestMicroVMExecution(t *testing.T) {
332
340
t .Run ("TestAttachVsock" , func (t * testing.T ) { testAttachVsock (ctx , t , m ) })
333
341
t .Run ("SetMetadata" , func (t * testing.T ) { testSetMetadata (ctx , t , m ) })
334
342
t .Run ("TestUpdateGuestDrive" , func (t * testing.T ) { testUpdateGuestDrive (ctx , t , m ) })
343
+ t .Run ("TestUpdateGuestNetworkInterface" , func (t * testing.T ) { testUpdateGuestNetworkInterface (ctx , t , m ) })
335
344
t .Run ("TestStartInstance" , func (t * testing.T ) { testStartInstance (ctx , t , m ) })
336
345
337
346
// Let the VMM start and stabilize...
@@ -489,6 +498,18 @@ func testUpdateGuestDrive(ctx context.Context, t *testing.T, m *Machine) {
489
498
}
490
499
}
491
500
501
+ func testUpdateGuestNetworkInterface (ctx context.Context , t * testing.T , m * Machine ) {
502
+ rateLimitSet := RateLimiterSet {
503
+ InRateLimiter : NewRateLimiter (
504
+ TokenBucketBuilder {}.WithBucketSize (10 ).WithRefillDuration (10 ).Build (),
505
+ TokenBucketBuilder {}.WithBucketSize (10 ).WithRefillDuration (10 ).Build (),
506
+ ),
507
+ }
508
+ if err := m .UpdateGuestNetworkInterfaceRateLimit (ctx , "1" , rateLimitSet ); err != nil {
509
+ t .Fatalf ("Failed to update the network interface %v" , err )
510
+ }
511
+ }
512
+
492
513
func testCreateNetworkInterfaceByID (ctx context.Context , t * testing.T , m * Machine ) {
493
514
if skipTuntap {
494
515
t .Skip ("Skipping: tuntap tests explicitly disabled" )
0 commit comments