Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netobserv-ebpf-agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
netobserv-ebpf-agent
Commits
2f4c7b86
"README.md" did not exist on "dadd38daac7687b72bdfc9c7eca4be920f2a3cfd"
Commit
2f4c7b86
authored
2 years ago
by
Pravein Govindan Kannan
Browse files
Options
Downloads
Patches
Plain Diff
Fix linter and testing errors
parent
6a351f2b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pkg/agent/ip.go
+4
-4
4 additions, 4 deletions
pkg/agent/ip.go
pkg/exporter/kafka_proto_test.go
+3
-3
3 additions, 3 deletions
pkg/exporter/kafka_proto_test.go
pkg/grpc/grpc_test.go
+3
-3
3 additions, 3 deletions
pkg/grpc/grpc_test.go
with
10 additions
and
10 deletions
pkg/agent/ip.go
+
4
−
4
View file @
2f4c7b86
...
@@ -18,10 +18,10 @@ var (
...
@@ -18,10 +18,10 @@ var (
// fetchAgentIP guesses the non-loopback IP address of the Agent host, according to the
// fetchAgentIP guesses the non-loopback IP address of the Agent host, according to the
// user-provided configuration:
// user-provided configuration:
// - If AgentIP is provided, this value is used whatever is the real IP of the Agent.
//
- If AgentIP is provided, this value is used whatever is the real IP of the Agent.
// - AgentIPIface specifies which interface this function should look into in order to pickup an address.
//
- AgentIPIface specifies which interface this function should look into in order to pickup an address.
// - AgentIPType specifies which type of IP address should the agent pickup ("any" to pickup whichever
//
- AgentIPType specifies which type of IP address should the agent pickup ("any" to pickup whichever
// ipv4 or ipv6 address is found first)
//
ipv4 or ipv6 address is found first)
func
fetchAgentIP
(
cfg
*
Config
)
(
net
.
IP
,
error
)
{
func
fetchAgentIP
(
cfg
*
Config
)
(
net
.
IP
,
error
)
{
if
cfg
.
AgentIP
!=
""
{
if
cfg
.
AgentIP
!=
""
{
if
ip
:=
net
.
ParseIP
(
cfg
.
AgentIP
);
ip
!=
nil
{
if
ip
:=
net
.
ParseIP
(
cfg
.
AgentIP
);
ip
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
pkg/exporter/kafka_proto_test.go
+
3
−
3
View file @
2f4c7b86
...
@@ -50,9 +50,9 @@ func TestProtoConversion(t *testing.T) {
...
@@ -50,9 +50,9 @@ func TestProtoConversion(t *testing.T) {
require
.
NoError
(
t
,
proto
.
Unmarshal
(
wc
.
messages
[
0
]
.
Value
,
&
r
))
require
.
NoError
(
t
,
proto
.
Unmarshal
(
wc
.
messages
[
0
]
.
Value
,
&
r
))
assert
.
EqualValues
(
t
,
3
,
r
.
EthProtocol
)
assert
.
EqualValues
(
t
,
3
,
r
.
EthProtocol
)
assert
.
EqualValues
(
t
,
1
,
r
.
Direction
)
assert
.
EqualValues
(
t
,
1
,
r
.
Direction
)
assert
.
EqualValues
(
t
,
0xaabbccddeeff
,
r
.
DataLink
.
SrcMac
)
assert
.
EqualValues
(
t
,
uint64
(
0xaabbccddeeff
)
,
r
.
DataLink
.
SrcMac
)
assert
.
EqualValues
(
t
,
0x112233445566
,
r
.
DataLink
.
DstMac
)
assert
.
EqualValues
(
t
,
uint64
(
0x112233445566
)
,
r
.
DataLink
.
DstMac
)
assert
.
EqualValues
(
t
,
0xC0010203
/* 192.1.2.3 */
,
r
.
Network
.
SrcAddr
.
GetIpv4
())
assert
.
EqualValues
(
t
,
uint64
(
0xC0010203
)
/* 192.1.2.3 */
,
r
.
Network
.
SrcAddr
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x7F030201
/* 127.3.2.1 */
,
r
.
Network
.
DstAddr
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x7F030201
/* 127.3.2.1 */
,
r
.
Network
.
DstAddr
.
GetIpv4
())
assert
.
EqualValues
(
t
,
4321
,
r
.
Transport
.
SrcPort
)
assert
.
EqualValues
(
t
,
4321
,
r
.
Transport
.
SrcPort
)
assert
.
EqualValues
(
t
,
1234
,
r
.
Transport
.
DstPort
)
assert
.
EqualValues
(
t
,
1234
,
r
.
Transport
.
DstPort
)
...
...
This diff is collapsed.
Click to expand it.
pkg/grpc/grpc_test.go
+
3
−
3
View file @
2f4c7b86
...
@@ -69,7 +69,7 @@ func TestGRPCCommunication(t *testing.T) {
...
@@ -69,7 +69,7 @@ func TestGRPCCommunication(t *testing.T) {
assert
.
EqualValues
(
t
,
456
,
r
.
Bytes
)
assert
.
EqualValues
(
t
,
456
,
r
.
Bytes
)
assert
.
EqualValues
(
t
,
0x11223344
,
r
.
GetNetwork
()
.
GetSrcAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x11223344
,
r
.
GetNetwork
()
.
GetSrcAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x55667788
,
r
.
GetNetwork
()
.
GetDstAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x55667788
,
r
.
GetNetwork
()
.
GetDstAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0xaabbccdd
,
r
.
GetAgentIp
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
uint64
(
0xaabbccdd
)
,
r
.
GetAgentIp
()
.
GetIpv4
())
select
{
select
{
case
rs
=
<-
serverOut
:
case
rs
=
<-
serverOut
:
case
<-
time
.
After
(
timeout
)
:
case
<-
time
.
After
(
timeout
)
:
...
@@ -80,8 +80,8 @@ func TestGRPCCommunication(t *testing.T) {
...
@@ -80,8 +80,8 @@ func TestGRPCCommunication(t *testing.T) {
assert
.
EqualValues
(
t
,
789
,
r
.
EthProtocol
)
assert
.
EqualValues
(
t
,
789
,
r
.
EthProtocol
)
assert
.
EqualValues
(
t
,
101
,
r
.
Bytes
)
assert
.
EqualValues
(
t
,
101
,
r
.
Bytes
)
assert
.
EqualValues
(
t
,
0x44332211
,
r
.
GetNetwork
()
.
GetSrcAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x44332211
,
r
.
GetNetwork
()
.
GetSrcAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0x88776655
,
r
.
GetNetwork
()
.
GetDstAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
uint64
(
0x88776655
)
,
r
.
GetNetwork
()
.
GetDstAddr
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
0xddccbbaa
,
r
.
GetAgentIp
()
.
GetIpv4
())
assert
.
EqualValues
(
t
,
uint64
(
0xddccbbaa
)
,
r
.
GetAgentIp
()
.
GetIpv4
())
select
{
select
{
case
rs
=
<-
serverOut
:
case
rs
=
<-
serverOut
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment