61
61
62
62
type RuntimeConfigFileTestSuite struct {
63
63
IntegrationTestSuiteBase
64
- EgressClientContainer string
65
- IngressClientContainer string
66
- IngressServerContainer string
64
+ EgressClientContainer string
67
65
}
68
66
69
67
func (s * RuntimeConfigFileTestSuite ) writeRuntimeConfig (runtimeConfigFile string , configStr string ) {
@@ -76,7 +74,6 @@ func (s *RuntimeConfigFileTestSuite) setRuntimeConfig(config types.RuntimeConfig
76
74
}
77
75
78
76
func (s * RuntimeConfigFileTestSuite ) runNetworkDirectionContainers () (client , server string ) {
79
-
80
77
serverCmd := fmt .Sprintf ("/scripts/prepare-tap.sh -a %s -o && nc -lk %s %d" , ingressIP , ingressIP , ingressPort )
81
78
containerID , err := s .Executor ().StartContainer (
82
79
config.ContainerStartConfig {
@@ -92,7 +89,7 @@ func (s *RuntimeConfigFileTestSuite) runNetworkDirectionContainers() (client, se
92
89
s .Require ().NoError (err )
93
90
server = common .ContainerShortID (containerID )
94
91
95
- clientCmd := fmt .Sprintf ("sleep 10 ; while true; do nc -zv %s %d; sleep 60; done" , ingressIP , ingressPort )
92
+ clientCmd := fmt .Sprintf ("sleep 20 ; while true; do nc -zv %s %d; sleep 60; done" , ingressIP , ingressPort )
96
93
containerID , err = s .Executor ().StartContainer (
97
94
config.ContainerStartConfig {
98
95
Name : "external-connection-ingress-client" ,
@@ -255,14 +252,17 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigNetworkIngress() {
255
252
client , server := s .runNetworkDirectionContainers ()
256
253
defer s .teardownNetworkDirectionContainers ()
257
254
258
- s . setRuntimeConfig ( types.RuntimeConfig {
255
+ config := types.RuntimeConfig {
259
256
Networking : types.NetworkConfig {
260
257
ExternalIps : types.ExternalIpsConfig {
261
258
Enabled : "ENABLED" ,
262
259
Direction : "INGRESS" ,
263
260
},
264
261
},
265
- })
262
+ }
263
+
264
+ s .setRuntimeConfig (config )
265
+ assert .AssertRuntimeConfig (s .T (), collectorIP , config )
266
266
267
267
// Expect both open and close events for the non-aggregated
268
268
// ingress connection. If Collector is aggregating to 255.255.255.255
@@ -310,14 +310,17 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigNetworkEgress() {
310
310
client , server := s .runNetworkDirectionContainers ()
311
311
defer s .teardownNetworkDirectionContainers ()
312
312
313
- s . setRuntimeConfig ( types.RuntimeConfig {
313
+ config := types.RuntimeConfig {
314
314
Networking : types.NetworkConfig {
315
315
ExternalIps : types.ExternalIpsConfig {
316
316
Enabled : "ENABLED" ,
317
317
Direction : "EGRESS" ,
318
318
},
319
319
},
320
- })
320
+ }
321
+
322
+ s .setRuntimeConfig (config )
323
+ assert .AssertRuntimeConfig (s .T (), collectorIP , config )
321
324
322
325
// Expect both open and close events for the non-aggregated
323
326
// egress connection. If Collector is aggregating to 255.255.255.255
@@ -365,14 +368,17 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigNetworkBoth() {
365
368
client , server := s .runNetworkDirectionContainers ()
366
369
defer s .teardownNetworkDirectionContainers ()
367
370
368
- s . setRuntimeConfig ( types.RuntimeConfig {
371
+ config := types.RuntimeConfig {
369
372
Networking : types.NetworkConfig {
370
373
ExternalIps : types.ExternalIpsConfig {
371
374
Enabled : "ENABLED" ,
372
375
Direction : "BOTH" ,
373
376
},
374
377
},
375
- })
378
+ }
379
+
380
+ s .setRuntimeConfig (config )
381
+ assert .AssertRuntimeConfig (s .T (), collectorIP , config )
376
382
377
383
// Expect both open and close events for the non-aggregated
378
384
// egress and ingress connections. If Collector is aggregating to 255.255.255.255
0 commit comments