@@ -123,7 +123,7 @@ func TestSystemHandler(t *testing.T) {
123123 t .Run (tCase .name , func (t * testing.T ) {
124124 t .Parallel ()
125125
126- handler := diagnostic .NewDiagnosticHandler (& log , 0 , & SystemCollectorMock {}, uuid .New (), uuid .New (), nil , nil , nil )
126+ handler := diagnostic .NewDiagnosticHandler (& log , 0 , & SystemCollectorMock {}, uuid .New (), uuid .New (), nil , nil , nil , nil )
127127 recorder := httptest .NewRecorder ()
128128 ctx := setCtxValuesForSystemCollector (tCase .systemInfo , tCase .rawInfo , tCase .err )
129129 request , err := http .NewRequestWithContext (ctx , http .MethodGet , "/diag/syste," , nil )
@@ -156,16 +156,18 @@ func TestTunnelStateHandler(t *testing.T) {
156156 tunnelID uuid.UUID
157157 clientID uuid.UUID
158158 connections []tunnelstate.IndexedConnectionInfo
159+ icmpSources []string
159160 }{
160161 {
161162 name : "case1" ,
162163 tunnelID : uuid .New (),
163164 clientID : uuid .New (),
164165 },
165166 {
166- name : "case2" ,
167- tunnelID : uuid .New (),
168- clientID : uuid .New (),
167+ name : "case2" ,
168+ tunnelID : uuid .New (),
169+ clientID : uuid .New (),
170+ icmpSources : []string {"172.17.0.3" , "::1" },
169171 connections : []tunnelstate.IndexedConnectionInfo {{
170172 ConnectionInfo : tunnelstate.ConnectionInfo {
171173 IsConnected : true ,
@@ -181,7 +183,17 @@ func TestTunnelStateHandler(t *testing.T) {
181183 t .Run (tCase .name , func (t * testing.T ) {
182184 t .Parallel ()
183185 tracker := newTrackerFromConns (t , tCase .connections )
184- handler := diagnostic .NewDiagnosticHandler (& log , 0 , nil , tCase .tunnelID , tCase .clientID , tracker , nil , nil )
186+ handler := diagnostic .NewDiagnosticHandler (
187+ & log ,
188+ 0 ,
189+ nil ,
190+ tCase .tunnelID ,
191+ tCase .clientID ,
192+ tracker ,
193+ nil ,
194+ nil ,
195+ tCase .icmpSources ,
196+ )
185197 recorder := httptest .NewRecorder ()
186198 handler .TunnelStateHandler (recorder , nil )
187199 decoder := json .NewDecoder (recorder .Body )
@@ -193,6 +205,7 @@ func TestTunnelStateHandler(t *testing.T) {
193205 assert .Equal (t , tCase .tunnelID , response .TunnelID )
194206 assert .Equal (t , tCase .clientID , response .ConnectorID )
195207 assert .Equal (t , tCase .connections , response .Connections )
208+ assert .Equal (t , tCase .icmpSources , response .ICMPSources )
196209 })
197210 }
198211}
@@ -237,7 +250,7 @@ func TestConfigurationHandler(t *testing.T) {
237250
238251 t .Parallel ()
239252 ctx := buildCliContext (t , tCase .flags )
240- handler := diagnostic .NewDiagnosticHandler (& log , 0 , nil , uuid .New (), uuid .New (), nil , ctx , []string {"b" , "c" , "d" })
253+ handler := diagnostic .NewDiagnosticHandler (& log , 0 , nil , uuid .New (), uuid .New (), nil , ctx , []string {"b" , "c" , "d" }, nil )
241254 recorder := httptest .NewRecorder ()
242255 handler .ConfigurationHandler (recorder , nil )
243256 decoder := json .NewDecoder (recorder .Body )
0 commit comments