Skip to content

Commit cb88d8e

Browse files
committed
fix: tests
1 parent b2e5a12 commit cb88d8e

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

internal/provider/data_source_host_sets_test.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@ import (
1010
)
1111

1212
var (
13+
testHostSet = `
14+
resource "boundary_host_catalog" "foo" {
15+
depends_on = [boundary_role.proj1_admin]
16+
type = "static"
17+
name = "foo"
18+
description = "bar"
19+
scope_id = boundary_scope.proj1.id
20+
}
21+
22+
resource "boundary_host" "foo" {
23+
depends_on = [boundary_host_catalog.foo]
24+
type = "static"
25+
host_catalog_id = boundary_host_catalog.foo.id
26+
name = "host_1"
27+
description = "My first host!"
28+
address = "10.0.0.1"
29+
}
30+
31+
resource "boundary_host_set" "foo" {
32+
host_catalog_id = boundary_host_catalog.foo.id
33+
type = "static"
34+
host_ids = [
35+
boundary_host.foo.id,
36+
]
37+
}
38+
`
39+
1340
fooHostSetsDataMissingHostCatalogId = `
1441
data "boundary_host_sets" "foo" {}
1542
`
@@ -35,7 +62,7 @@ func TestAccDataSourceHostSets(t *testing.T) {
3562
ExpectError: regexp.MustCompile("host_catalog_id: The field is incorrectly formatted."),
3663
},
3764
{
38-
Config: testConfig(url, fooOrg, firstProjectFoo, fooHostset, fooHostSetsData),
65+
Config: testConfig(url, fooOrg, firstProjectFoo, testHostSet, fooHostSetsData),
3966
Check: resource.ComposeAggregateTestCheckFunc(
4067
resource.TestCheckResourceAttrSet("data.boundary_host_sets.foo", "host_catalog_id"),
4168
resource.TestCheckResourceAttr("data.boundary_host_sets.foo", "items.#", "1"),

internal/provider/data_source_hosts_test.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ import (
1010
)
1111

1212
var (
13+
testHost = `
14+
resource "boundary_host_catalog" "foo" {
15+
depends_on = [boundary_role.proj1_admin]
16+
type = "static"
17+
name = "foo"
18+
description = "bar"
19+
scope_id = boundary_scope.proj1.id
20+
}
21+
22+
resource "boundary_host" "foo" {
23+
depends_on = [boundary_host_catalog.foo]
24+
type = "static"
25+
host_catalog_id = boundary_host_catalog.foo.id
26+
name = "host_1"
27+
description = "My first host!"
28+
address = "10.0.0.1"
29+
}
30+
`
31+
1332
fooHostsDataMissingHostCatalogId = `
1433
data "boundary_hosts" "foo" {}
1534
`
@@ -35,7 +54,7 @@ func TestAccDataSourceHosts(t *testing.T) {
3554
ExpectError: regexp.MustCompile("host_catalog_id: The field is incorrectly formatted."),
3655
},
3756
{
38-
Config: testConfig(url, fooOrg, firstProjectFoo, projHost, fooHostsData),
57+
Config: testConfig(url, fooOrg, firstProjectFoo, testHost, fooHostsData),
3958
Check: resource.ComposeAggregateTestCheckFunc(
4059
resource.TestCheckResourceAttrSet("data.boundary_hosts.foo", "host_catalog_id"),
4160
resource.TestCheckResourceAttr("data.boundary_hosts.foo", "items.#", "1"),

0 commit comments

Comments
 (0)