@@ -508,6 +508,8 @@ func TestPluginLinuxAdd(t *testing.T) {
508508 require .NoError (t , err )
509509 allEndpoints , _ := tt .plugin .nm .GetAllEndpoints ("" )
510510 require .Len (t , allEndpoints , len (tt .want ))
511+
512+ // compare contents
511513 for _ , wantedEndpointEntry := range tt .want {
512514 epId := "none"
513515 for _ , endpointInfo := range allEndpoints {
@@ -531,6 +533,23 @@ func TestPluginLinuxAdd(t *testing.T) {
531533 tt .plugin .nm .DeleteEndpoint ("" , epId , nil )
532534 }
533535
536+ // confirm separate entities
537+ // that is, if one is modified, the other should not be modified
538+ epInfos := []* network.EndpointInfo {}
539+ for _ , val := range allEndpoints {
540+ epInfos = append (epInfos , val )
541+ }
542+ if len (epInfos ) > 1 {
543+ epInfo1 := epInfos [0 ]
544+ epInfo2 := epInfos [1 ]
545+ epInfo1 .Data ["dummy" ] = "dummy value"
546+ epInfo1 .Options ["dummy" ] = "another dummy value"
547+ require .NotEqual (t , epInfo1 .Data , epInfo2 .Data )
548+ require .NotEqual (t , epInfo1 .Options , epInfo2 .Options )
549+ }
550+
551+ // ensure deleted
552+ require .Empty (t , allEndpoints )
534553 })
535554 }
536555}
0 commit comments