@@ -44,7 +44,7 @@ func TestAccResourceNsxtVpcServiceProfile_basic(t *testing.T) {
44
44
{
45
45
Config : testAccNsxtVpcServiceProfileTemplate (true , false ),
46
46
Check : resource .ComposeTestCheckFunc (
47
- testAccNsxtVpcServiceProfileExists (accTestPolicyVpcServiceProfileCreateAttributes [ "display_name" ], testResourceName ),
47
+ testAccNsxtVpcServiceProfileExists (testResourceName ),
48
48
resource .TestCheckResourceAttrSet (testDataSourceName , "path" ),
49
49
resource .TestCheckResourceAttrSet (testDataSourceName , "description" ),
50
50
resource .TestCheckResourceAttr (testResourceName , "display_name" , accTestPolicyVpcServiceProfileCreateAttributes ["display_name" ]),
@@ -67,7 +67,7 @@ func TestAccResourceNsxtVpcServiceProfile_basic(t *testing.T) {
67
67
// add profiles
68
68
Config : testAccNsxtVpcServiceProfileTemplate (true , true ),
69
69
Check : resource .ComposeTestCheckFunc (
70
- testAccNsxtVpcServiceProfileExists (accTestPolicyVpcServiceProfileCreateAttributes [ "display_name" ], testResourceName ),
70
+ testAccNsxtVpcServiceProfileExists (testResourceName ),
71
71
resource .TestCheckResourceAttrSet (testDataSourceName , "path" ),
72
72
resource .TestCheckResourceAttrSet (testDataSourceName , "description" ),
73
73
resource .TestCheckResourceAttr (testResourceName , "display_name" , accTestPolicyVpcServiceProfileCreateAttributes ["display_name" ]),
@@ -94,7 +94,7 @@ func TestAccResourceNsxtVpcServiceProfile_basic(t *testing.T) {
94
94
// update values, no profiles
95
95
Config : testAccNsxtVpcServiceProfileTemplate (false , false ),
96
96
Check : resource .ComposeTestCheckFunc (
97
- testAccNsxtVpcServiceProfileExists (accTestPolicyVpcServiceProfileUpdateAttributes [ "display_name" ], testResourceName ),
97
+ testAccNsxtVpcServiceProfileExists (testResourceName ),
98
98
resource .TestCheckResourceAttr (testResourceName , "display_name" , accTestPolicyVpcServiceProfileUpdateAttributes ["display_name" ]),
99
99
resource .TestCheckResourceAttr (testResourceName , "description" , accTestPolicyVpcServiceProfileUpdateAttributes ["description" ]),
100
100
resource .TestCheckResourceAttr (testResourceName , "dhcp_config.#" , "1" ),
@@ -119,7 +119,7 @@ func TestAccResourceNsxtVpcServiceProfile_basic(t *testing.T) {
119
119
{
120
120
Config : testAccNsxtVpcServiceProfileDhcpRelay (),
121
121
Check : resource .ComposeTestCheckFunc (
122
- testAccNsxtVpcServiceProfileExists (accTestPolicyVpcServiceProfileCreateAttributes [ "display_name" ], testResourceName ),
122
+ testAccNsxtVpcServiceProfileExists (testResourceName ),
123
123
resource .TestCheckResourceAttr (testResourceName , "description" , "" ),
124
124
resource .TestCheckResourceAttrSet (testResourceName , "nsx_id" ),
125
125
resource .TestCheckResourceAttrSet (testResourceName , "path" ),
@@ -131,9 +131,9 @@ func TestAccResourceNsxtVpcServiceProfile_basic(t *testing.T) {
131
131
),
132
132
},
133
133
{
134
- Config : testAccNsxtVpcServiceProfileMinimalistic (),
134
+ Config : testAccNsxtVpcServiceProfileMinimalistic (accTestPolicyVpcServiceProfileCreateAttributes [ "display_name" ] ),
135
135
Check : resource .ComposeTestCheckFunc (
136
- testAccNsxtVpcServiceProfileExists (accTestPolicyVpcServiceProfileCreateAttributes [ "display_name" ], testResourceName ),
136
+ testAccNsxtVpcServiceProfileExists (testResourceName ),
137
137
resource .TestCheckResourceAttr (testResourceName , "description" , "" ),
138
138
resource .TestCheckResourceAttrSet (testResourceName , "nsx_id" ),
139
139
resource .TestCheckResourceAttrSet (testResourceName , "path" ),
@@ -158,7 +158,7 @@ func TestAccResourceNsxtVpcServiceProfile_importBasic(t *testing.T) {
158
158
},
159
159
Steps : []resource.TestStep {
160
160
{
161
- Config : testAccNsxtVpcServiceProfileMinimalistic (),
161
+ Config : testAccNsxtVpcServiceProfileMinimalistic (getAccTestResourceName () ),
162
162
},
163
163
{
164
164
ResourceName : testResourceName ,
@@ -170,7 +170,7 @@ func TestAccResourceNsxtVpcServiceProfile_importBasic(t *testing.T) {
170
170
})
171
171
}
172
172
173
- func testAccNsxtVpcServiceProfileExists (displayName string , resourceName string ) resource.TestCheckFunc {
173
+ func testAccNsxtVpcServiceProfileExists (resourceName string ) resource.TestCheckFunc {
174
174
return func (state * terraform.State ) error {
175
175
176
176
connector := getPolicyConnector (testAccProvider .Meta ().(nsxtClients ))
@@ -310,13 +310,12 @@ resource "nsxt_vpc_service_profile" "test" {
310
310
}` , testAccNsxtProjectContext (), accTestPolicyVpcServiceProfileUpdateAttributes ["display_name" ], accTestPolicyVpcServiceProfileUpdateAttributes ["server_addresses" ])
311
311
}
312
312
313
- func testAccNsxtVpcServiceProfileMinimalistic () string {
313
+ func testAccNsxtVpcServiceProfileMinimalistic (displayName string ) string {
314
314
return fmt .Sprintf (`
315
315
resource "nsxt_vpc_service_profile" "test" {
316
316
%s
317
317
display_name = "%s"
318
318
dhcp_config {
319
319
}
320
-
321
- }` , testAccNsxtProjectContext (), accTestPolicyVpcServiceProfileUpdateAttributes ["display_name" ])
320
+ }` , testAccNsxtProjectContext (), displayName )
322
321
}
0 commit comments