@@ -150,6 +150,46 @@ func Test_policyConfig(t *testing.T) {
150150 assert .Contains (t , strings , "--other=false" )
151151 },
152152 },
153+ {
154+ name : "test hubble" ,
155+ args : args {container : func () * gabs.Container {
156+ cniJSON , _ := gabs .ParseJSON ([]byte (`{
157+ "cniVersion": "0.4.0",
158+ "name": "terway-chainer",
159+ "plugins": [
160+ {
161+ "bandwidth_mode": "edt",
162+ "capabilities": {
163+ "bandwidth": true
164+ },
165+ "cilium_args": "disable-per-package-lb=true",
166+ "eniip_virtual_type": "datapathv2",
167+ "network_policy_provider": "ebpf",
168+ "cilium_enable_hubble": "true",
169+ "cilium_hubble_listen_address": ":4244",
170+ "cilium_hubble_metrics_server": ":9091",
171+ "cilium_hubble_metrics": "drop,tcp,flow,port-distribution,icmp",
172+ "type": "terway"
173+ },
174+ {
175+ "data-path": "datapathv2",
176+ "enable-debug": false,
177+ "log-file": "/var/run/cilium/cilium-cni.log",
178+ "type": "cilium-cni"
179+ }
180+ ]
181+ }` ))
182+ return cniJSON
183+ }()},
184+ readFunc : func (name string ) ([]byte , error ) {
185+ return []byte ("#define DIRECT_ROUTING_DEV_IFINDEX 0\n #define DISABLE_PER_PACKET_LB 1\n " ), nil
186+ },
187+ checkFunc : func (t * testing.T , strings []string , err error ) {
188+ assert .NoError (t , err )
189+ assert .Contains (t , strings , "--disable-per-package-lb=true" )
190+ assert .Contains (t , strings , "--enable-hubble=true" )
191+ },
192+ },
153193 }
154194 for _ , tt := range tests {
155195 t .Run (tt .name , func (t * testing.T ) {
0 commit comments