forked from vmware/terraform-provider-nsxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_source_nsxt_edge_cluster_test.go
39 lines (33 loc) · 1.13 KB
/
data_source_nsxt_edge_cluster_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
/* Copyright © 2017 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: MPL-2.0 */
package nsxt
import (
"fmt"
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func TestAccDataSourceNsxtEdgeCluster_basic(t *testing.T) {
edgeClusterName := getEdgeClusterName()
testResourceName := "data.nsxt_edge_cluster.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccOnlyLocalManager(t); testAccTestDeprecated(t); testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccNSXEdgeClusterReadTemplate(edgeClusterName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(testResourceName, "display_name", edgeClusterName),
resource.TestCheckResourceAttrSet(testResourceName, "id"),
resource.TestCheckResourceAttrSet(testResourceName, "member_node_type"),
resource.TestCheckResourceAttrSet(testResourceName, "deployment_type"),
),
},
},
})
}
func testAccNSXEdgeClusterReadTemplate(name string) string {
return fmt.Sprintf(`
data "nsxt_edge_cluster" "test" {
display_name = "%s"
}`, name)
}