Skip to content

Commit 090248f

Browse files
author
Joshua Seidel
committed
fix errors
1 parent cd58da7 commit 090248f

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

builtin/provisioners/chef/linux_provisioner_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
2020
"server_url": "https://chef.local",
2121
"validation_client_name": "validator",
2222
"validation_key_path": "validator.pem",
23+
"secret_key_path": "encrypted_data_bag_secret",
2324
}),
2425

2526
Commands: map[string]bool{
@@ -37,6 +38,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
3738
"server_url": "https://chef.local",
3839
"validation_client_name": "validator",
3940
"validation_key_path": "validator.pem",
41+
"secret_key_path": "encrypted_data_bag_secret",
4042
}),
4143

4244
Commands: map[string]bool{
@@ -55,6 +57,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
5557
"server_url": "https://chef.local",
5658
"validation_client_name": "validator",
5759
"validation_key_path": "validator.pem",
60+
"secret_key_path": "encrypted_data_bag_secret",
5861
}),
5962

6063
Commands: map[string]bool{
@@ -73,6 +76,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
7376
"server_url": "https://chef.local",
7477
"validation_client_name": "validator",
7578
"validation_key_path": "validator.pem",
79+
"secret_key_path": "encrypted_data_bag_secret",
7680
}),
7781

7882
Commands: map[string]bool{
@@ -92,6 +96,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
9296
"server_url": "https://chef.local",
9397
"validation_client_name": "validator",
9498
"validation_key_path": "validator.pem",
99+
"secret_key_path": "encrypted_data_bag_secret",
95100
}),
96101

97102
Commands: map[string]bool{
@@ -112,6 +117,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
112117
"server_url": "https://chef.local",
113118
"validation_client_name": "validator",
114119
"validation_key_path": "validator.pem",
120+
"secret_key_path": "encrypted_data_bag_secret",
115121
"version": "11.18.6",
116122
}),
117123

@@ -158,6 +164,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
158164
"server_url": "https://chef.local",
159165
"validation_client_name": "validator",
160166
"validation_key_path": "test-fixtures/validator.pem",
167+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
161168
}),
162169

163170
Commands: map[string]bool{
@@ -170,6 +177,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
170177

171178
Uploads: map[string]string{
172179
linuxConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
180+
linuxConfDir + "/encrypted_data_bag_secret":"SECRET-KEY-FILE",
173181
linuxConfDir + "/ohai/hints/ohaihint.json": "OHAI-HINT-FILE",
174182
linuxConfDir + "/client.rb": defaultLinuxClientConf,
175183
linuxConfDir + "/first-boot.json": `{"run_list":["cookbook::recipe"]}`,
@@ -184,6 +192,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
184192
"server_url": "https://chef.local",
185193
"validation_client_name": "validator",
186194
"validation_key_path": "test-fixtures/validator.pem",
195+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
187196
}),
188197

189198
Commands: map[string]bool{
@@ -192,6 +201,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
192201

193202
Uploads: map[string]string{
194203
linuxConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
204+
linuxConfDir + "/encrypted_data_bag_secret":"SECRET-KEY-FILE",
195205
linuxConfDir + "/client.rb": defaultLinuxClientConf,
196206
linuxConfDir + "/first-boot.json": `{"run_list":["cookbook::recipe"]}`,
197207
},
@@ -208,6 +218,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
208218
"server_url": "https://chef.local",
209219
"validation_client_name": "validator",
210220
"validation_key_path": "test-fixtures/validator.pem",
221+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
211222
}),
212223

213224
Commands: map[string]bool{
@@ -216,6 +227,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
216227

217228
Uploads: map[string]string{
218229
linuxConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
230+
linuxConfDir + "/encrypted_data_bag_secret":"SECRET-KEY-FILE",
219231
linuxConfDir + "/client.rb": proxyLinuxClientConf,
220232
linuxConfDir + "/first-boot.json": `{"run_list":["cookbook::recipe"]}`,
221233
},
@@ -250,6 +262,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
250262
"server_url": "https://chef.local",
251263
"validation_client_name": "validator",
252264
"validation_key_path": "test-fixtures/validator.pem",
265+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
253266
}),
254267

255268
Commands: map[string]bool{
@@ -258,6 +271,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
258271

259272
Uploads: map[string]string{
260273
linuxConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
274+
linuxConfDir + "/encrypted_data_bag_secret": "SECRET-KEY-FILE",
261275
linuxConfDir + "/client.rb": defaultLinuxClientConf,
262276
linuxConfDir + "/first-boot.json": `{"key1":{"subkey1":{"subkey2a":["val1","val2","val3"],` +
263277
`"subkey2b":{"subkey3":"value3"}}},"key2":"value2","run_list":["cookbook::recipe"]}`,

builtin/provisioners/chef/resource_provisioner_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestResourceProvider_runChefClient(t *testing.T) {
6969
"server_url": "https://chef.local",
7070
"validation_client_name": "validator",
7171
"validation_key_path": "test-fixtures/validator.pem",
72-
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
72+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
7373
}),
7474

7575
ConfDir: linuxConfDir,
@@ -87,7 +87,7 @@ func TestResourceProvider_runChefClient(t *testing.T) {
8787
"server_url": "https://chef.local",
8888
"validation_client_name": "validator",
8989
"validation_key_path": "test-fixtures/validator.pem",
90-
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
90+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
9191
}),
9292

9393
ConfDir: linuxConfDir,
@@ -106,7 +106,7 @@ func TestResourceProvider_runChefClient(t *testing.T) {
106106
"server_url": "https://chef.local",
107107
"validation_client_name": "validator",
108108
"validation_key_path": "test-fixtures/validator.pem",
109-
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
109+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
110110
}),
111111

112112
ConfDir: windowsConfDir,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SECRET-KEY-FILE

builtin/provisioners/chef/windows_provisioner_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func TestResourceProvider_windowsInstallChefClient(t *testing.T) {
2222
"server_url": "https://chef.local",
2323
"validation_client_name": "validator",
2424
"validation_key_path": "validator.pem",
25+
"secret_key_path": "encrypted_data_bag_secret",
2526
}),
2627

2728
Commands: map[string]bool{
@@ -42,6 +43,7 @@ func TestResourceProvider_windowsInstallChefClient(t *testing.T) {
4243
"server_url": "https://chef.local",
4344
"validation_client_name": "validator",
4445
"validation_key_path": "validator.pem",
46+
"secret_key_path": "encrypted_data_bag_secret",
4547
}),
4648

4749
Commands: map[string]bool{
@@ -60,6 +62,7 @@ func TestResourceProvider_windowsInstallChefClient(t *testing.T) {
6062
"server_url": "https://chef.local",
6163
"validation_client_name": "validator",
6264
"validation_key_path": "validator.pem",
65+
"secret_key_path": "encrypted_data_bag_secret",
6366
"version": "11.18.6",
6467
}),
6568

@@ -109,6 +112,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
109112
"server_url": "https://chef.local",
110113
"validation_client_name": "validator",
111114
"validation_key_path": "test-fixtures/validator.pem",
115+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
112116
}),
113117

114118
Commands: map[string]bool{
@@ -120,6 +124,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
120124

121125
Uploads: map[string]string{
122126
windowsConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
127+
windowsConfDir + "/encrypted_data_bag_secret":"SECRET-KEY-FILE",
123128
windowsConfDir + "/ohai/hints/ohaihint.json": "OHAI-HINT-FILE",
124129
windowsConfDir + "/client.rb": defaultWindowsClientConf,
125130
windowsConfDir + "/first-boot.json": `{"run_list":["cookbook::recipe"]}`,
@@ -136,6 +141,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
136141
"server_url": "https://chef.local",
137142
"validation_client_name": "validator",
138143
"validation_key_path": "test-fixtures/validator.pem",
144+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
139145
}),
140146

141147
Commands: map[string]bool{
@@ -144,6 +150,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
144150

145151
Uploads: map[string]string{
146152
windowsConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
153+
windowsConfDir + "/encrypted_data_bag_secret":"SECRET-KEY-FILE",
147154
windowsConfDir + "/client.rb": proxyWindowsClientConf,
148155
windowsConfDir + "/first-boot.json": `{"run_list":["cookbook::recipe"]}`,
149156
},
@@ -177,6 +184,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
177184
"server_url": "https://chef.local",
178185
"validation_client_name": "validator",
179186
"validation_key_path": "test-fixtures/validator.pem",
187+
"secret_key_path": "test-fixtures/encrypted_data_bag_secret",
180188
}),
181189

182190
Commands: map[string]bool{
@@ -185,6 +193,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
185193

186194
Uploads: map[string]string{
187195
windowsConfDir + "/validation.pem": "VALIDATOR-PEM-FILE",
196+
windowsConfDir + "/encrypted_data_bag_secret":"SECRET-KEY-FILE",
188197
windowsConfDir + "/client.rb": defaultWindowsClientConf,
189198
windowsConfDir + "/first-boot.json": `{"key1":{"subkey1":{"subkey2a":["val1","val2","val3"],` +
190199
`"subkey2b":{"subkey3":"value3"}}},"key2":"value2","run_list":["cookbook::recipe"]}`,

0 commit comments

Comments
 (0)