-
Notifications
You must be signed in to change notification settings - Fork 32
/
data_source_avi_ipamdnsproviderprofile_test.go
49 lines (42 loc) · 1.26 KB
/
data_source_avi_ipamdnsproviderprofile_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2019 VMware, Inc.
// SPDX-License-Identifier: Mozilla Public License 2.0
package avi
import (
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func TestAVIDataSourceIpamDnsProviderProfileBasic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccAVIDSIpamDnsProviderProfileConfig,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(
"avi_ipamdnsproviderprofile.testIpamDnsProviderProfile", "name", "test-ipam-abc-abc"),
resource.TestCheckResourceAttr(
"avi_ipamdnsproviderprofile.testIpamDnsProviderProfile", "allocate_ip_in_vrf", "false"),
),
},
},
})
}
// nolint
const testAccAVIDSIpamDnsProviderProfileConfig = `
data "avi_tenant" "default_tenant"{
name= "admin"
}
resource "avi_ipamdnsproviderprofile" "testIpamDnsProviderProfile" {
name = "test-ipam-abc-abc"
allocate_ip_in_vrf = false
internal_profile {
ttl = "31"
}
type = "IPAMDNS_TYPE_INTERNAL"
tenant_ref = data.avi_tenant.default_tenant.id
}
data "avi_ipamdnsproviderprofile" "testIpamDnsProviderProfile" {
name= "${avi_ipamdnsproviderprofile.testIpamDnsProviderProfile.name}"
}
`