1
- package tests
1
+ package batch_test
2
2
3
3
import (
4
4
"fmt"
@@ -42,68 +42,68 @@ func TestValidateBatchAccountName(t *testing.T) {
42
42
}
43
43
}
44
44
45
- func TestAccAzureRMBatchAccount_basic (t * testing.T ) {
45
+ func TestAccBatchAccount_basic (t * testing.T ) {
46
46
data := acceptance .BuildTestData (t , "azurerm_batch_account" , "test" )
47
47
48
48
resource .ParallelTest (t , resource.TestCase {
49
49
PreCheck : func () { acceptance .PreCheck (t ) },
50
50
Providers : acceptance .SupportedProviders ,
51
- CheckDestroy : testCheckAzureRMBatchAccountDestroy ,
51
+ CheckDestroy : testCheckBatchAccountDestroy ,
52
52
Steps : []resource.TestStep {
53
53
{
54
- Config : testAccAzureRMBatchAccount_basic (data ),
54
+ Config : testAccBatchAccount_basic (data ),
55
55
Check : resource .ComposeTestCheckFunc (
56
- testCheckAzureRMBatchAccountExists (data .ResourceName ),
56
+ testCheckBatchAccountExists (data .ResourceName ),
57
57
resource .TestCheckResourceAttr (data .ResourceName , "pool_allocation_mode" , "BatchService" ),
58
58
),
59
59
},
60
60
},
61
61
})
62
62
}
63
63
64
- func TestAccAzureRMBatchAccount_requiresImport (t * testing.T ) {
64
+ func TestAccBatchAccount_requiresImport (t * testing.T ) {
65
65
data := acceptance .BuildTestData (t , "azurerm_batch_account" , "test" )
66
66
67
67
resource .ParallelTest (t , resource.TestCase {
68
68
PreCheck : func () { acceptance .PreCheck (t ) },
69
69
Providers : acceptance .SupportedProviders ,
70
- CheckDestroy : testCheckAzureRMBatchAccountDestroy ,
70
+ CheckDestroy : testCheckBatchAccountDestroy ,
71
71
Steps : []resource.TestStep {
72
72
{
73
- Config : testAccAzureRMBatchAccount_basic (data ),
73
+ Config : testAccBatchAccount_basic (data ),
74
74
Check : resource .ComposeTestCheckFunc (
75
- testCheckAzureRMBatchAccountExists (data .ResourceName ),
75
+ testCheckBatchAccountExists (data .ResourceName ),
76
76
),
77
77
},
78
78
{
79
- Config : testAccAzureRMBatchAccount_requiresImport (data ),
79
+ Config : testAccBatchAccount_requiresImport (data ),
80
80
ExpectError : acceptance .RequiresImportError ("azurerm_batch_account" ),
81
81
},
82
82
},
83
83
})
84
84
}
85
85
86
- func TestAccAzureRMBatchAccount_complete (t * testing.T ) {
86
+ func TestAccBatchAccount_complete (t * testing.T ) {
87
87
data := acceptance .BuildTestData (t , "azurerm_batch_account" , "test" )
88
88
89
89
resource .ParallelTest (t , resource.TestCase {
90
90
PreCheck : func () { acceptance .PreCheck (t ) },
91
91
Providers : acceptance .SupportedProviders ,
92
- CheckDestroy : testCheckAzureRMBatchAccountDestroy ,
92
+ CheckDestroy : testCheckBatchAccountDestroy ,
93
93
Steps : []resource.TestStep {
94
94
{
95
- Config : testAccAzureRMBatchAccount_complete (data ),
95
+ Config : testAccBatchAccount_complete (data ),
96
96
Check : resource .ComposeTestCheckFunc (
97
- testCheckAzureRMBatchAccountExists (data .ResourceName ),
97
+ testCheckBatchAccountExists (data .ResourceName ),
98
98
resource .TestCheckResourceAttr (data .ResourceName , "pool_allocation_mode" , "BatchService" ),
99
99
resource .TestCheckResourceAttr (data .ResourceName , "tags.%" , "1" ),
100
100
resource .TestCheckResourceAttr (data .ResourceName , "tags.env" , "test" ),
101
101
),
102
102
},
103
103
{
104
- Config : testAccAzureRMBatchAccount_completeUpdated (data ),
104
+ Config : testAccBatchAccount_completeUpdated (data ),
105
105
Check : resource .ComposeTestCheckFunc (
106
- testCheckAzureRMBatchAccountExists (data .ResourceName ),
106
+ testCheckBatchAccountExists (data .ResourceName ),
107
107
resource .TestCheckResourceAttr (data .ResourceName , "pool_allocation_mode" , "BatchService" ),
108
108
resource .TestCheckResourceAttr (data .ResourceName , "tags.%" , "2" ),
109
109
resource .TestCheckResourceAttr (data .ResourceName , "tags.env" , "test" ),
@@ -114,27 +114,27 @@ func TestAccAzureRMBatchAccount_complete(t *testing.T) {
114
114
})
115
115
}
116
116
117
- func TestAccAzureRMBatchAccount_userSubscription (t * testing.T ) {
117
+ func TestAccBatchAccount_userSubscription (t * testing.T ) {
118
118
data := acceptance .BuildTestData (t , "azurerm_batch_account" , "test" )
119
119
tenantID := os .Getenv ("ARM_TENANT_ID" )
120
120
121
121
resource .ParallelTest (t , resource.TestCase {
122
122
PreCheck : func () { acceptance .PreCheck (t ) },
123
123
Providers : acceptance .SupportedProviders ,
124
- CheckDestroy : testCheckAzureRMBatchAccountDestroy ,
124
+ CheckDestroy : testCheckBatchAccountDestroy ,
125
125
Steps : []resource.TestStep {
126
126
{
127
- Config : testAccAzureRMBatchAccount_userSubscription (data , tenantID ),
127
+ Config : testAccBatchAccount_userSubscription (data , tenantID ),
128
128
Check : resource .ComposeTestCheckFunc (
129
- testCheckAzureRMBatchAccountExists (data .ResourceName ),
129
+ testCheckBatchAccountExists (data .ResourceName ),
130
130
resource .TestCheckResourceAttr (data .ResourceName , "pool_allocation_mode" , "UserSubscription" ),
131
131
),
132
132
},
133
133
},
134
134
})
135
135
}
136
136
137
- func testCheckAzureRMBatchAccountExists (resourceName string ) resource.TestCheckFunc {
137
+ func testCheckBatchAccountExists (resourceName string ) resource.TestCheckFunc {
138
138
return func (s * terraform.State ) error {
139
139
ctx := acceptance .AzureProvider .Meta ().(* clients.Client ).StopContext
140
140
conn := acceptance .AzureProvider .Meta ().(* clients.Client ).Batch .AccountClient
@@ -165,7 +165,7 @@ func testCheckAzureRMBatchAccountExists(resourceName string) resource.TestCheckF
165
165
}
166
166
}
167
167
168
- func testCheckAzureRMBatchAccountDestroy (s * terraform.State ) error {
168
+ func testCheckBatchAccountDestroy (s * terraform.State ) error {
169
169
conn := acceptance .AzureProvider .Meta ().(* clients.Client ).Batch .AccountClient
170
170
ctx := acceptance .AzureProvider .Meta ().(* clients.Client ).StopContext
171
171
@@ -192,7 +192,7 @@ func testCheckAzureRMBatchAccountDestroy(s *terraform.State) error {
192
192
return nil
193
193
}
194
194
195
- func testAccAzureRMBatchAccount_basic (data acceptance.TestData ) string {
195
+ func testAccBatchAccount_basic (data acceptance.TestData ) string {
196
196
return fmt .Sprintf (`
197
197
provider "azurerm" {
198
198
features {}
@@ -212,8 +212,8 @@ resource "azurerm_batch_account" "test" {
212
212
` , data .RandomInteger , data .Locations .Primary , data .RandomString )
213
213
}
214
214
215
- func testAccAzureRMBatchAccount_requiresImport (data acceptance.TestData ) string {
216
- template := testAccAzureRMBatchAccount_basic (data )
215
+ func testAccBatchAccount_requiresImport (data acceptance.TestData ) string {
216
+ template := testAccBatchAccount_basic (data )
217
217
return fmt .Sprintf (`
218
218
%s
219
219
resource "azurerm_batch_account" "import" {
@@ -225,7 +225,7 @@ resource "azurerm_batch_account" "import" {
225
225
` , template )
226
226
}
227
227
228
- func testAccAzureRMBatchAccount_complete (data acceptance.TestData ) string {
228
+ func testAccBatchAccount_complete (data acceptance.TestData ) string {
229
229
return fmt .Sprintf (`
230
230
provider "azurerm" {
231
231
features {}
@@ -258,7 +258,7 @@ resource "azurerm_batch_account" "test" {
258
258
` , data .RandomInteger , data .Locations .Primary , data .RandomString , data .RandomString )
259
259
}
260
260
261
- func testAccAzureRMBatchAccount_completeUpdated (data acceptance.TestData ) string {
261
+ func testAccBatchAccount_completeUpdated (data acceptance.TestData ) string {
262
262
return fmt .Sprintf (`
263
263
provider "azurerm" {
264
264
features {}
@@ -292,7 +292,7 @@ resource "azurerm_batch_account" "test" {
292
292
` , data .RandomInteger , data .Locations .Primary , data .RandomString , data .RandomString )
293
293
}
294
294
295
- func testAccAzureRMBatchAccount_userSubscription (data acceptance.TestData , tenantID string ) string {
295
+ func testAccBatchAccount_userSubscription (data acceptance.TestData , tenantID string ) string {
296
296
return fmt .Sprintf (`
297
297
provider "azurerm" {
298
298
features {}
0 commit comments