@@ -315,6 +315,7 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
315
315
bandwidth = make (map [string ]string )
316
316
npTenant = make (map [string ][]string )
317
317
networks = make (map [string ][]string )
318
+ netName = make (map [string ]string )
318
319
containers = map [string ][]* container {}
319
320
pktTag = 0
320
321
epgName string
@@ -328,9 +329,10 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
328
329
c .Assert (s .cli .TenantPost (& client.Tenant {TenantName : tenantName }), IsNil )
329
330
330
331
for networkNum := 0 ; networkNum < (numContainer - 1 ); networkNum ++ {
332
+ networkName := fmt .Sprintf ("net%d-%s" , networkNum , tenantName )
331
333
network := & client.Network {
332
334
TenantName : tenantName ,
333
- NetworkName : fmt . Sprintf ( "net%d" , networkNum ) ,
335
+ NetworkName : networkName ,
334
336
Subnet : fmt .Sprintf ("10.%d.%d.1/24" , tenantNum , networkNum ),
335
337
Gateway : fmt .Sprintf ("10.%d.%d.254" , tenantNum , networkNum ),
336
338
PktTag : pktTag + 1000 ,
@@ -343,9 +345,9 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
343
345
networks [tenantName ] = append (networks [network .TenantName ], network .NetworkName )
344
346
pktTag ++
345
347
346
- profileName := fmt .Sprintf ("netprofile%d- %d-%d " , tenantNum , networkNum , i )
348
+ profileName := fmt .Sprintf ("netprofile%d%d-%s " , networkNum , tenantNum , tenantName )
347
349
bwInt := 10 + tenantNum + networkNum
348
- burst := (bwInt * 15 )
350
+ burst := (bwInt * 13 )
349
351
netprofile := & client.Netprofile {
350
352
ProfileName : profileName ,
351
353
DSCP : networkNum + i ,
@@ -356,7 +358,7 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
356
358
357
359
c .Assert (s .cli .NetprofilePost (netprofile ), IsNil )
358
360
logrus .Infof ("Creating:%s with %s" , netprofile .ProfileName , netprofile .TenantName )
359
- epgName = fmt .Sprintf ("epg%d-ten%d-%d " , networkNum , tenantNum , i )
361
+ epgName = fmt .Sprintf ("epg%d-%s " , networkNum , networkName )
360
362
group := & client.EndpointGroup {
361
363
GroupName : epgName ,
362
364
NetworkName : network .NetworkName ,
@@ -366,6 +368,7 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
366
368
c .Assert (s .cli .EndpointGroupPost (group ), IsNil )
367
369
logrus .Infof ("Creating %s with %s and %s" , group .GroupName , group .NetProfile , group .TenantName )
368
370
groupNames [tenantName ] = append (groupNames [group .TenantName ], group .GroupName )
371
+ netName [epgName ] = group .NetworkName
369
372
groupsInNp [profileName ] = append (groupsInNp [group .NetProfile ], group .GroupName )
370
373
bandwidth [group .NetProfile ] = netprofile .Bandwidth
371
374
npTenant [tenantName ] = append (npTenant [netprofile .TenantName ], netprofile .ProfileName )
@@ -375,20 +378,20 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
375
378
for tenant , groups := range groupNames {
376
379
endChan := make (chan error )
377
380
for _ , groupName := range groups {
378
- go func (groupName , tenant string , containers map [string ][]* container ) {
381
+ go func (groupName , tenant string , netName map [ string ] string , containers map [string ][]* container ) {
379
382
var err error
380
383
mutex .Lock ()
381
384
logrus .Infof ("Creating containers in group:%s" , groupName )
382
- containers [groupName ], err = s .runContainers (numContainer , false , groupName , tenant , nil , nil )
385
+ containers [groupName ], err = s .runContainersInService (numContainer , groupName , netName [ groupName ] , tenant , nil )
383
386
mutex .Unlock ()
384
387
endChan <- err
385
388
386
389
if s .fwdMode == "routing" && encap == "vlan" {
387
390
_ , err := s .CheckBgpRouteDistribution (c , containers [groupName ])
388
391
c .Assert (err , IsNil )
389
392
}
390
-
391
- }(groupName , tenant , containers )
393
+
394
+ }(groupName , tenant , netName , containers )
392
395
}
393
396
for i := 0 ; i < len (groups ); i ++ {
394
397
c .Assert (<- endChan , IsNil )
@@ -398,7 +401,7 @@ func (s *systemtestSuite) testNetprofileMultipleTenant(c *C, encap string) {
398
401
for netprofiles , groups := range groupsInNp {
399
402
for _ , group := range groups {
400
403
logrus .Infof ("Running iperf server on %s" , group )
401
- s .startIperfServers (containers [group ])
404
+ c . Assert ( s .startIperfServers (containers [group ]), IsNil )
402
405
logrus .Infof ("running iperf client on %s" , group )
403
406
c .Assert (s .startIperfClients (containers [group ], bandwidth [netprofiles ], false ), IsNil )
404
407
}
0 commit comments