You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Set `TRAFFIC_GENERATOR_CMD` when running `make e2e`
14
-
2. Implement `test.sh`
9
+
The picture below shows the initial deployment that should be installed in a kubernetes cluster in order to execute the complete e2e test suite in dualstack. With only IPv4, elements containing `v6` are not used, and with only IPv6, elements containing `v4` are not used. Elements between `[]` are configurable via parameters, see the `Configuration` section.
| traffic-generator-cmd | string | Command to use to connect to the traffic generator. All occurences of '{trench}' will be replaced with the trench name. |
18
+
| script | string | Path + script used by the e2e tests |
19
+
||||
20
+
| k8s-namespace | string | Name of the namespace |
21
+
| target-a-deployment-name | string | Name of the target deployment |
22
+
| trench-a | string | Name of the trench |
23
+
| attractor-a-1 | string | Name of the attractor |
24
+
| conduit-a-1 | string | Name of the conduit |
25
+
| stream-a-I | string | Name of the stream |
26
+
| stream-a-II | string | Name of the stream |
27
+
| flow-a-z-tcp | string | Name of the flow |
28
+
| flow-a-z-tcp-destination-port-0 | int | Destination port 0 |
29
+
| flow-a-z-udp | string | Name of the flow |
30
+
| flow-a-z-udp-destination-port-0 | int | Destination port 0 |
31
+
| flow-a-x-tcp | string | Name of the flow |
32
+
| flow-a-x-tcp-destination-port-0 | int | Destination port 0 |
33
+
| vip-1-v4 | string | Address of the vip v4 number 1 |
34
+
| vip-1-v6 | string | Address of the vip v6 number 1 |
35
+
| target-b-deployment-name | string | Name of the target deployment |
36
+
| trench-b | string | Name of the trench |
37
+
| conduit-b-1 | string | Name of the conduit |
38
+
| stream-b-I | string | Name of the stream |
39
+
| vip-2-v4 | string | Address of the vip v4 number 2 |
40
+
| vip-2-v6 | string | Address of the vip v6 number 2 |
41
+
||||
42
+
| stateless-lb-fe-deployment-name | string | Name of stateless-lb-fe deployment in `trench-a`|
43
+
| ip-family | string | IP Family |
44
+
45
+
For more details about each parameter, check the picture above in the `Initial Deployment` section.
46
+
47
+
#### Script
48
+
49
+
A bash script file must be passed as parameter of the e2e tests. The script is required to allowed the e2e tests to be run in every environment (Helm/Operator deployement...). The following functions has to be implemented in the script:
50
+
51
+
| Name | Description |
52
+
|---|---|
53
+
| init () error | Executed once before running the tests |
54
+
| end () error | Executed once after running the tests |
55
+
| configuration_new_ip () error | Executed just before running the `new-vip` test |
56
+
| configuration_new_ip_revert () error | Executed just after running the `new-vip` test |
15
57
16
58
### List of tests
17
59
18
-
- IngressTraffic (ingress_traffic_test.go)
19
-
- IPv4 TCP traffic (20.0.0.1:4000)
20
-
- IPv4 UDP traffic (20.0.0.1:4003)
21
-
- IPv6 TCP traffic ([2000::1]:4000)
22
-
- IPv6 UDP traffic ([2000::1]:4003)
23
-
- MultiTrenches (multi_trenches_test.go)
24
-
- Disconnect a target from trench-a and connect it to trench-b, then test traffic in both trench (and revert the changes)
25
-
- Send traffic in 2 trenches (with the same configuration) at the same time
26
-
- Scaling (scaling_test.go)
27
-
- Scale in targets to 3 (and back to 4)
28
-
- Scale in targets to 5 (and back to 4)
29
-
- Target (target_test.go)
30
-
- Close a stream, check traffic has not been received by the target and re-open the stream
31
-
- Configuration (configuration_test.go)
32
-
- Add a new VIP (60.0.0.150) to stream-a and attractor-a and test traffic and remove it after
Copy file name to clipboardExpand all lines: test/e2e/e2e_suite_test.go
+68-47
Original file line number
Diff line number
Diff line change
@@ -32,60 +32,81 @@ import (
32
32
)
33
33
34
34
var (
35
-
trafficGeneratorCMDstring
36
-
namespacestring
37
-
scriptstring
38
-
39
-
trenchANamestring
40
-
trenchBNamestring
41
-
conduitA1Namestring
42
-
conduitB1Namestring
43
-
streamA1Namestring
44
-
streamB1Namestring
45
-
46
-
tcpIPv4string
47
-
tcpIPv6string
48
-
udpIPv4string
49
-
udpIPv6string
50
-
51
-
newTCPVIPstring
52
-
53
-
lbfeDeploymentNamestring
54
-
55
-
targetADeploymentNamestring
56
-
numberOfTargetAint
57
-
targetBDeploymentNamestring
58
-
numberOfTargetBint
59
-
60
35
clientset*kubernetes.Clientset
61
36
62
37
trafficGeneratorHost*utils.TrafficGeneratorHost
63
38
trafficGenerator utils.TrafficGenerator
39
+
40
+
numberOfTargetAint
41
+
numberOfTargetBint
42
+
43
+
config*e2eTestConfiguration
64
44
)
65
45
46
+
typee2eTestConfigurationstruct {
47
+
trafficGeneratorCMDstring
48
+
scriptstring
49
+
50
+
k8sNamespacestring
51
+
targetADeploymentNamestring
52
+
trenchAstring
53
+
attractorA1string
54
+
conduitA1string
55
+
streamAIstring
56
+
streamAIIstring
57
+
flowAZTcpstring
58
+
flowAZTcpDestinationPort0int
59
+
flowAZUdpstring
60
+
flowAZUdpDestinationPort0int
61
+
flowAXTcpstring
62
+
flowAXTcpDestinationPort0int
63
+
vip1V4string
64
+
vip1V6string
65
+
targetBDeploymentNamestring
66
+
trenchBstring
67
+
conduitB1string
68
+
streamBIstring
69
+
vip2V4string
70
+
vip2V6string
71
+
72
+
statelessLbFeDeploymentNamestring
73
+
ipFamilystring
74
+
}
75
+
66
76
const (
67
77
timeout=time.Minute*3
68
78
interval=time.Second*2
69
79
)
70
80
71
81
funcinit() {
72
-
flag.StringVar(&trafficGeneratorCMD, "traffic-generator-cmd", "docker exec -i {trench}", "Command to use to connect to the traffic generator. All occurences of '{trench}' will be replaced with the trench name.")
73
-
flag.StringVar(&namespace, "namespace", "red", "the namespace where expects operator to exist")
74
-
flag.StringVar(&script, "script", "./data/kind/test.sh", "path + script used by the e2e tests")
75
-
flag.StringVar(&trenchAName, "trench-a-name", "trench-a", "Name of trench-a (see e2e documentation diagram)")
76
-
flag.StringVar(&trenchBName, "trench-b-name", "trench-b", "Name of trench-b (see e2e documentation diagram)")
77
-
flag.StringVar(&conduitA1Name, "conduit-a-1-name", "conduit-a-1", "Name of conduit-a-1 (see e2e documentation diagram)")
78
-
flag.StringVar(&conduitB1Name, "conduit-b-1-name", "conduit-b-1", "Name of conduit-b-1 (see e2e documentation diagram)")
79
-
flag.StringVar(&streamA1Name, "stream-a-1-name", "stream-a-1", "Name of stream-a-1 (see e2e documentation diagram)")
80
-
flag.StringVar(&streamB1Name, "stream-b-1-name", "stream-b-1", "Name of stream-b-1 (see e2e documentation diagram)")
81
-
flag.StringVar(&lbfeDeploymentName, "lb-fe-deployment-name", "lb-fe-attractor-a-1", "Name of load-balancer deployment in trench-a")
82
-
flag.StringVar(&targetADeploymentName, "target-a-deployment-name", "target-a", "Name of target-a deployment in trench-a")
83
-
flag.StringVar(&targetBDeploymentName, "target-b-deployment-name", "target-b", "Name of target-b deployment in trench-b")
84
-
flag.StringVar(&tcpIPv4, "tcp-ipv4", "20.0.0.1:4000", "IP + Port used for testing IPv4 TCP")
85
-
flag.StringVar(&tcpIPv6, "tcp-ipv6", "[2000::1]:4000", "IP + Port used for testing IPv6 TCP")
86
-
flag.StringVar(&udpIPv4, "udp-ipv4", "20.0.0.1:4003", "IP + Port used for testing IPv4 UDP")
87
-
flag.StringVar(&udpIPv6, "udp-ipv6", "[2000::1]:4003", "IP + Port used for testing IPv6 UDP")
88
-
flag.StringVar(&newTCPVIP, "new-tcp-vip", "60.0.0.150:4000", "IP + Port used for testing a new VIP with TCP")
82
+
config=&e2eTestConfiguration{}
83
+
flag.StringVar(&config.trafficGeneratorCMD, "traffic-generator-cmd", "", "Command to use to connect to the traffic generator. All occurences of '{trench}' will be replaced with the trench name.")
84
+
flag.StringVar(&config.script, "script", "", "Path + script used by the e2e tests")
85
+
86
+
flag.StringVar(&config.k8sNamespace, "k8s-namespace", "", "Name of the namespace")
87
+
flag.StringVar(&config.targetADeploymentName, "target-a-deployment-name", "", "Name of the namespace")
88
+
flag.StringVar(&config.trenchA, "trench-a", "", "Name of the trench")
89
+
flag.StringVar(&config.attractorA1, "attractor-a-1", "", "Name of the attractor")
90
+
flag.StringVar(&config.conduitA1, "conduit-a-1", "", "Name of the conduit")
91
+
flag.StringVar(&config.streamAI, "stream-a-I", "", "Name of the stream")
92
+
flag.StringVar(&config.streamAII, "stream-a-II", "", "Name of the stream")
93
+
flag.StringVar(&config.flowAZTcp, "flow-a-z-tcp", "", "Name of the flow")
94
+
flag.IntVar(&config.flowAZTcpDestinationPort0, "flow-a-z-tcp-destination-port-0", 4000, "Destination port 0")
95
+
flag.StringVar(&config.flowAZUdp, "flow-a-z-udp", "", "Name of the flow")
96
+
flag.IntVar(&config.flowAZUdpDestinationPort0, "flow-a-z-udp-destination-port-0", 4000, "Destination port 0")
97
+
flag.StringVar(&config.flowAXTcp, "flow-a-x-tcp", "", "Name of the flow")
98
+
flag.IntVar(&config.flowAXTcpDestinationPort0, "flow-a-x-tcp-destination-port-0", 4000, "Destination port 0")
99
+
flag.StringVar(&config.vip1V4, "vip-1-v4", "", "Address of the vip v4 number 1")
100
+
flag.StringVar(&config.vip1V6, "vip-1-v6", "", "Address of the vip v6 number 1")
101
+
flag.StringVar(&config.targetBDeploymentName, "target-b-deployment-name", "", "Name of the target deployment")
102
+
flag.StringVar(&config.trenchB, "trench-b", "", "Name of the trench")
103
+
flag.StringVar(&config.conduitB1, "conduit-b-1", "", "Name of the conduit")
104
+
flag.StringVar(&config.streamBI, "stream-b-I", "", "Name of the stream")
105
+
flag.StringVar(&config.vip2V4, "vip-2-v4", "", "Address of the vip v4 number 2")
106
+
flag.StringVar(&config.vip2V6, "vip-2-v6", "", "Address of the vip v6 number 2")
107
+
108
+
flag.StringVar(&config.statelessLbFeDeploymentName, "stateless-lb-fe-deployment-name", "", "Name of stateless-lb-fe deployment in trench-a")
0 commit comments