Skip to content

Commit b325c41

Browse files
committed
Changed NetworkInfoBatch to NetworkConnectionBatch
1 parent d9cc8be commit b325c41

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

integration-tests/pkg/mock_sensor/expect_conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func (s *MockSensor) ExpectSameElementsConnections(t *testing.T, containerID str
115115
}
116116
}
117117

118-
func (s *MockSensor) ExpectSameElementsConnectionsScrapes(t *testing.T, containerID string, timeout time.Duration, expected []types.NetworkInfoBatch) bool {
119-
equal := func(c1, c2 types.NetworkInfoBatch) bool {
118+
func (s *MockSensor) ExpectSameElementsConnectionsScrapes(t *testing.T, containerID string, timeout time.Duration, expected []types.NetworkConnectionBatch) bool {
119+
equal := func(c1, c2 types.NetworkConnectionBatch) bool {
120120
if len(c1) != len(c2) {
121121
return false
122122
}

integration-tests/pkg/mock_sensor/server.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type MockSensor struct {
4646
processLineages map[string]LineageMap
4747
processMutex sync.Mutex
4848

49-
connections map[string][]types.NetworkInfoBatch
49+
connections map[string][]types.NetworkConnectionBatch
5050
endpoints map[string]EndpointMap
5151
networkMutex sync.Mutex
5252

@@ -64,7 +64,7 @@ func NewMockSensor(test string) *MockSensor {
6464
testName: test,
6565
processes: make(map[string]ProcessMap),
6666
processLineages: make(map[string]LineageMap),
67-
connections: make(map[string][]types.NetworkInfoBatch),
67+
connections: make(map[string][]types.NetworkConnectionBatch),
6868
endpoints: make(map[string]EndpointMap),
6969
}
7070
}
@@ -149,20 +149,20 @@ func (m *MockSensor) LiveConnections() <-chan *sensorAPI.NetworkConnection {
149149

150150
// Connections returns a list of all connections that have been received for
151151
// a given container ID
152-
func (m *MockSensor) GetConnectionsInBatches(containerID string) []types.NetworkInfoBatch {
152+
func (m *MockSensor) GetConnectionsInBatches(containerID string) []types.NetworkConnectionBatch {
153153
m.networkMutex.Lock()
154154
defer m.networkMutex.Unlock()
155155

156156
if connections, ok := m.connections[containerID]; ok {
157-
conns := make([]types.NetworkInfoBatch, len(connections))
157+
conns := make([]types.NetworkConnectionBatch, len(connections))
158158
copy(conns, connections)
159159
for _, conn := range conns {
160160
types.SortConnections(conn)
161161
}
162162

163163
return conns
164164
}
165-
return make([]types.NetworkInfoBatch, 0)
165+
return make([]types.NetworkConnectionBatch, 0)
166166
}
167167

168168
// Connections returns a list of all connections that have been received for
@@ -173,7 +173,7 @@ func (m *MockSensor) Connections(containerID string) []*sensorAPI.NetworkConnect
173173

174174
allConns := make([]*sensorAPI.NetworkConnection, 0)
175175
if connections, ok := m.connections[containerID]; ok {
176-
conns := make([]types.NetworkInfoBatch, len(connections))
176+
conns := make([]types.NetworkConnectionBatch, len(connections))
177177
copy(conns, connections)
178178
for _, conn := range conns {
179179
allConns = append(allConns, conn...)
@@ -292,7 +292,7 @@ func (m *MockSensor) Stop() {
292292

293293
m.processes = make(map[string]ProcessMap)
294294
m.processLineages = make(map[string]LineageMap)
295-
m.connections = make(map[string][]types.NetworkInfoBatch)
295+
m.connections = make(map[string][]types.NetworkConnectionBatch)
296296
m.endpoints = make(map[string]EndpointMap)
297297

298298
m.processChannel.Stop()
@@ -455,7 +455,7 @@ func (m *MockSensor) pushConnections(containerConnsMap map[string][]*sensorAPI.N
455455
if c, ok := m.connections[containerID]; ok {
456456
m.connections[containerID] = append(c, connections)
457457
} else {
458-
m.connections[containerID] = []types.NetworkInfoBatch{connections}
458+
m.connections[containerID] = []types.NetworkConnectionBatch{connections}
459459
}
460460
}
461461
}

integration-tests/pkg/types/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const (
1212
NilTimestamp = "<nil>"
1313
)
1414

15-
type NetworkInfoBatch []*sensorAPI.NetworkConnection
15+
type NetworkConnectionBatch []*sensorAPI.NetworkConnection
1616

1717
// TranslateAddress is a helper function for converting binary representations
1818
// of network addresses (in the signals) to usable forms for testing

integration-tests/suites/runtime_config_file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (s *RuntimeConfigFileTestSuite) TestRuntimeConfigFileEnable() {
125125
// Default configuration is external IPs disabled.
126126
// We expect normalized connections.
127127
assert.AssertNoRuntimeConfig(s.T(), collectorIP)
128-
expectedConnections := []types.NetworkInfoBatch{[]*sensorAPI.NetworkConnection{&activeNormalizedConnection}}
128+
expectedConnections := []types.NetworkConnectionBatch{[]*sensorAPI.NetworkConnection{&activeNormalizedConnection}}
129129
connectionSuccess := s.Sensor().ExpectSameElementsConnectionsScrapes(s.T(), s.ClientContainer, 10*time.Second, expectedConnections)
130130
s.Require().True(connectionSuccess)
131131

0 commit comments

Comments
 (0)