Skip to content

Commit

Permalink
fix dns tests for network provider
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Feb 12, 2024
1 parent 4b844db commit 4b63fbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions providers/network/resources/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin"
"go.mondoo.com/cnquery/v10/providers/network/connection"
"go.mondoo.com/cnquery/v10/providers/network/resources"
"go.mondoo.com/cnquery/v10/utils/syncx"
)

func TestResource_DNS(t *testing.T) {
Expand Down Expand Up @@ -50,13 +51,13 @@ func TestResource_DnsFqdn(t *testing.T) {
},
}

runtime := &plugin.Runtime{}
runtime := &plugin.Runtime{Resources: &syncx.Map[plugin.Resource]{}}

for _, tc := range testCases {
conf := &inventory.Config{
Host: tc.hostName,
}
runtime.Connection = connection.NewHostConnection(1, nil, conf)
runtime.Connection = connection.NewHostConnection(1, &inventory.Asset{}, conf)

dns, err := resources.NewResource(
runtime,
Expand Down
5 changes: 3 additions & 2 deletions providers/network/resources/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin"
"go.mondoo.com/cnquery/v10/providers/network/connection"
"go.mondoo.com/cnquery/v10/providers/network/resources"
"go.mondoo.com/cnquery/v10/utils/syncx"
)

func TestResource_TLS(t *testing.T) {
Expand All @@ -32,13 +33,13 @@ func TestResource_TlsFqdn(t *testing.T) {
},
}

runtime := &plugin.Runtime{}
runtime := &plugin.Runtime{Resources: &syncx.Map[plugin.Resource]{}}

for _, tc := range testCases {
conf := &inventory.Config{
Host: tc.hostName,
}
runtime.Connection = connection.NewHostConnection(1, nil, conf)
runtime.Connection = connection.NewHostConnection(1, &inventory.Asset{}, conf)

dns, err := resources.NewResource(
runtime,
Expand Down

0 comments on commit 4b63fbf

Please sign in to comment.