Skip to content

Commit

Permalink
add validation test for empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
disperate committed Mar 11, 2024
1 parent 1593661 commit 36956e0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cloudscale/resource_cloudscale_subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ func TestAccCloudscaleSubnet_ValidationError(t *testing.T) {
ExpectError: regexp.MustCompile(`Error: Conflicting configuration arguments.*`),
Check: resource.ComposeTestCheckFunc(),
},
{
Config: subnetconfigInvalidEmptyDnsCombination(rInt),
ExpectError: regexp.MustCompile(`Error: Conflicting configuration arguments.*`),
Check: resource.ComposeTestCheckFunc(),
},
},
})
}
Expand Down Expand Up @@ -572,6 +577,18 @@ resource "cloudscale_subnet" "basic" {
`)
}

func subnetconfigInvalidEmptyDnsCombination(rInt int) string {
return networkconfigMinimal(rInt, false) + "\n" + fmt.Sprintf(`
resource "cloudscale_subnet" "basic" {
cidr = "10.11.12.0/24"
network_uuid = cloudscale_network.basic.id
gateway_address = "10.11.12.10"
dns_servers = []
disable_dns_servers = true
}
`)
}

func serverConfigWithPublicAndLayerThree(rInt int, fixedAddress string) string {
template := `
resource "cloudscale_server" "basic" {
Expand Down

0 comments on commit 36956e0

Please sign in to comment.