From 36956e02a4ab38a970a0f2551e421a909820f803 Mon Sep 17 00:00:00 2001 From: Julian Bigler Date: Mon, 11 Mar 2024 15:42:08 +0100 Subject: [PATCH] add validation test for empty list --- cloudscale/resource_cloudscale_subnet_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cloudscale/resource_cloudscale_subnet_test.go b/cloudscale/resource_cloudscale_subnet_test.go index b7812b77..bd42da2b 100644 --- a/cloudscale/resource_cloudscale_subnet_test.go +++ b/cloudscale/resource_cloudscale_subnet_test.go @@ -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(), + }, }, }) } @@ -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" {