Skip to content

Commit

Permalink
Provide empty ProfileProviders in discovery tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dplepage-dd committed Dec 18, 2024
1 parent 03eec88 commit 67038bd
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package discovery

import (
"fmt"
"github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/profile"
"net"
"testing"
"time"
Expand Down Expand Up @@ -57,6 +58,7 @@ func TestDiscovery(t *testing.T) {
DiscoveryInterval: 3600,
DiscoveryWorkers: 1,
IgnoredIPAddresses: map[string]bool{"192.168.0.5": true},
ProfileProvider: profile.StaticProvider(nil),
}
discovery := NewDiscovery(checkConfig, sessionFactory, config)
discovery.Start()
Expand Down Expand Up @@ -107,6 +109,7 @@ func TestDiscoveryCache(t *testing.T) {
CommunityString: "public",
DiscoveryInterval: 3600,
DiscoveryWorkers: 1,
ProfileProvider: profile.StaticProvider(nil),
}
discovery := NewDiscovery(checkConfig, sessionFactory, config)
discovery.Start()
Expand Down Expand Up @@ -139,6 +142,7 @@ func TestDiscoveryCache(t *testing.T) {
CommunityString: "public",
DiscoveryInterval: 3600,
DiscoveryWorkers: 0, // no workers, the devices will be loaded from cache
ProfileProvider: profile.StaticProvider(nil),
}
discovery2 := NewDiscovery(checkConfig, sessionFactory, config)
discovery2.Start()
Expand Down Expand Up @@ -181,6 +185,7 @@ func TestDiscoveryTicker(t *testing.T) {
CommunityString: "public",
DiscoveryInterval: 1,
DiscoveryWorkers: 1,
ProfileProvider: profile.StaticProvider(nil),
}
discovery := NewDiscovery(checkConfig, sessionFactory, config)
discovery.Start()
Expand All @@ -200,6 +205,7 @@ func TestDiscovery_checkDevice(t *testing.T) {
CommunityString: "public",
DiscoveryInterval: 1,
DiscoveryWorkers: 1,
ProfileProvider: profile.StaticProvider(nil),
}
ipAddr, ipNet, err := net.ParseCIDR(checkConfig.Network)
assert.Nil(t, err)
Expand Down Expand Up @@ -319,6 +325,7 @@ func TestDiscovery_createDevice(t *testing.T) {
DiscoveryWorkers: 1,
DiscoveryAllowedFailures: 3,
Namespace: "default",
ProfileProvider: profile.StaticProvider(nil),
}
discovery := NewDiscovery(checkConfig, session.NewMockSession, config)
ipAddr, ipNet, err := net.ParseCIDR(checkConfig.Network)
Expand Down

0 comments on commit 67038bd

Please sign in to comment.