-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #541 #578
Fixes #541 #578
Changes from all commits
6f44dbf
d94c6ad
14ed835
eb216fe
0a6b2ee
e809168
859b19b
1ceb3b4
434986e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import ( | |
// EPSpec for aci-gw | ||
type EPSpec struct { | ||
Tenant string `json:"tenant,omitempty"` | ||
App string `json:"app,omitempty"` | ||
App string `json:"app-prof,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srampal i hope this change was intentional ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @abhinandanpb : This is not related to the issue we are seeing here. This was found in my aci-gw feature. As it was online change I asked Sanjeev to incorporate in this PR. |
||
Epg string `json:"epg,omitempty"` | ||
EpMac string `json:"epmac,omitempty"` | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,14 @@ func (s *systemtestSuite) TestNetworkAddDeleteVLAN(c *C) { | |
s.testNetworkAddDelete(c, "vlan") | ||
} | ||
|
||
func (s *systemtestSuite) TestNetworkAddDeleteVLANWithDns(c *C) { | ||
s.testNetworkAddDeleteWithDns(c, "vlan") | ||
} | ||
|
||
func (s *systemtestSuite) TestNetworkAddDeleteVXLANWithDns(c *C) { | ||
s.testNetworkAddDeleteWithDns(c, "vxlan") | ||
} | ||
|
||
func (s *systemtestSuite) testNetworkAddDelete(c *C, encap string) { | ||
|
||
if s.fwdMode == "routing" && encap == "vlan" { | ||
|
@@ -190,6 +198,58 @@ func (s *systemtestSuite) testNetworkAddDelete(c *C, encap string) { | |
} | ||
} | ||
|
||
func (s *systemtestSuite) testNetworkAddDeleteWithDns(c *C, encap string) { | ||
|
||
var err error | ||
|
||
for i := 0; i < s.basicInfo.Iterations; i++ { | ||
var ( | ||
netNames = []string{} | ||
) | ||
|
||
for networkNum := 0; networkNum < 3; networkNum++ { | ||
var v6subnet, v6gateway string | ||
if networkNum%2 == 0 { | ||
v6subnet = "" | ||
v6gateway = "" | ||
} else { | ||
v6subnet = fmt.Sprintf("1001:%d::/120", networkNum) | ||
v6gateway = fmt.Sprintf("1001:%d::254", networkNum) | ||
} | ||
network := &client.Network{ | ||
TenantName: "default", | ||
NetworkName: fmt.Sprintf("net%d-%d", networkNum, i), | ||
Subnet: fmt.Sprintf("10.1.%d.0/24", networkNum), | ||
Gateway: fmt.Sprintf("10.1.%d.254", networkNum), | ||
Ipv6Subnet: v6subnet, | ||
Ipv6Gateway: v6gateway, | ||
PktTag: 1001 + networkNum, | ||
Encap: encap, | ||
} | ||
|
||
c.Assert(s.cli.NetworkPost(network), IsNil) | ||
netNames = append(netNames, network.NetworkName) | ||
} | ||
|
||
// Wait 5 seconds for the call backs to come through | ||
|
||
time.Sleep(5 * time.Second) | ||
|
||
for _, netName := range netNames { | ||
|
||
/* | ||
Now that the networks are created, check that there is a dns endpoint on each network | ||
*/ | ||
_, err = s.checkNetworkInspectDNS("default", netName) | ||
c.Assert(err, IsNil) | ||
} | ||
|
||
for _, netName := range netNames { | ||
c.Assert(s.cli.NetworkDelete("default", netName), IsNil) | ||
} | ||
} | ||
} | ||
|
||
func (s *systemtestSuite) TestNetworkAddDeleteNoGatewayVXLAN(c *C) { | ||
s.testNetworkAddDeleteNoGateway(c, "vxlan") | ||
} | ||
|
@@ -279,6 +339,10 @@ func (s *systemtestSuite) TestNetworkAddDeleteTenantVLAN(c *C) { | |
s.testNetworkAddDeleteTenant(c, "vlan", s.fwdMode) | ||
} | ||
|
||
func (s *systemtestSuite) TestNetworkAddDeleteTenantWithDns(c *C) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
s.testNetworkAddDeleteTenantWithDns(c, "vlan", s.fwdMode) | ||
} | ||
|
||
func (s *systemtestSuite) testNetworkAddDeleteTenant(c *C, encap, fwdmode string) { | ||
mutex := sync.Mutex{} | ||
|
||
|
@@ -371,6 +435,72 @@ func (s *systemtestSuite) testNetworkAddDeleteTenant(c *C, encap, fwdmode string | |
|
||
} | ||
|
||
func (s *systemtestSuite) testNetworkAddDeleteTenantWithDns(c *C, encap, fwdmode string) { | ||
|
||
var err error | ||
|
||
for i := 0; i < s.basicInfo.Iterations; i++ { | ||
var ( | ||
tenantNames = map[string][]string{} | ||
netNames = []string{} | ||
pktTag = 0 | ||
) | ||
|
||
for tenantNum := 0; tenantNum < 3; tenantNum++ { | ||
tenantName := fmt.Sprintf("tenant%d", tenantNum) | ||
c.Assert(s.cli.TenantPost(&client.Tenant{TenantName: tenantName}), IsNil) | ||
tenantNames[tenantName] = []string{} | ||
|
||
for networkNum := 0; networkNum < 3; networkNum++ { | ||
var v6subnet, v6gateway string | ||
if networkNum%2 == 0 { | ||
v6subnet = "" | ||
v6gateway = "" | ||
} else { | ||
v6subnet = fmt.Sprintf("1001:%d:%d::/120", tenantNum, networkNum) | ||
v6gateway = fmt.Sprintf("1001:%d:%d::254", tenantNum, networkNum) | ||
} | ||
network := &client.Network{ | ||
TenantName: tenantName, | ||
NetworkName: fmt.Sprintf("net%d-%d", networkNum, i), | ||
Subnet: fmt.Sprintf("10.%d.%d.0/24", tenantNum, networkNum), | ||
Gateway: fmt.Sprintf("10.%d.%d.254", tenantNum, networkNum), | ||
Ipv6Subnet: v6subnet, | ||
Ipv6Gateway: v6gateway, | ||
PktTag: pktTag + 1000, | ||
Encap: encap, | ||
} | ||
|
||
logrus.Infof("Creating network %s on tenant %s", network.NetworkName, network.TenantName) | ||
|
||
c.Assert(s.cli.NetworkPost(network), IsNil) | ||
netNames = append(netNames, network.NetworkName) | ||
tenantNames[tenantName] = append(tenantNames[tenantName], network.NetworkName) | ||
pktTag++ | ||
} | ||
} | ||
|
||
// Wait 10 seconds for the call backs to come through | ||
|
||
time.Sleep(10 * time.Second) | ||
|
||
for tenant, networks := range tenantNames { | ||
for _, network := range networks { | ||
_, err = s.testNetworkInspectDNS(tenant, network) | ||
c.Assert(err, IsNil) | ||
} | ||
} | ||
|
||
for tenant, networks := range tenantNames { | ||
for _, network := range networks { | ||
c.Assert(s.cli.NetworkDelete(tenant, network), IsNil) | ||
} | ||
c.Assert(s.cli.TenantDelete(tenant), IsNil) | ||
} | ||
} | ||
|
||
} | ||
|
||
func (s *systemtestSuite) TestNetworkAddDeleteTenantFwdModeChangeVXLAN(c *C) { | ||
fwdMode := s.fwdMode | ||
for i := 0; i < s.basicInfo.Iterations; i++ { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its time to make this a debug log. .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do that but not sure if someone expects to scrape the CLI output instead of using the API. If yes, removing some lines from CLI output could impact their screen scraping logic … but maybe there aren’t any customers that do that OR we anyway do not support anyone to do CLI screen scraping since they should only be using API for automation. Also, this is not the only place … fmt.Printf() is used throughout this file in places where a debug log may have been appropriate. Should there be a separate issue opened to track which all Printf()s should be changed to logs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible you can remove the printf's