knife-essentials 0.9.8 → 1.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/chef/knife/delete_essentials.rb +3 -3
- data/lib/chef/knife/deps_essentials.rb +1 -1
- data/lib/chef/knife/edit_essentials.rb +1 -1
- data/lib/chef/knife/list_essentials.rb +23 -17
- data/lib/chef/knife/show_essentials.rb +14 -7
- data/lib/chef/knife/xargs_essentials.rb +1 -1
- data/lib/chef_fs/command_line.rb +100 -84
- data/lib/chef_fs/file_system.rb +77 -35
- data/lib/chef_fs/file_system/chef_server_root_dir.rb +7 -7
- data/lib/chef_fs/file_system/cookbook_dir.rb +1 -1
- data/lib/chef_fs/file_system/rest_list_entry.rb +2 -0
- data/lib/chef_fs/knife.rb +24 -4
- data/lib/chef_fs/parallelizer.rb +127 -0
- data/lib/chef_fs/raw_request.rb +8 -4
- data/lib/chef_fs/version.rb +1 -1
- data/spec/integration/chef_repo_path_spec.rb +76 -1
- data/spec/integration/delete_spec.rb +256 -13
- data/spec/integration/deps_spec.rb +20 -20
- data/spec/integration/diff_spec.rb +47 -120
- data/spec/integration/download_spec.rb +92 -237
- data/spec/integration/list_spec.rb +114 -0
- data/spec/integration/redirection_spec.rb +49 -0
- data/spec/integration/upload_spec.rb +120 -305
- data/spec/support/file_system_support.rb +1 -1
- data/spec/support/knife_support.rb +4 -0
- metadata +7 -5
@@ -9,6 +9,8 @@ describe 'knife delete' do
|
|
9
9
|
|
10
10
|
let :everything do
|
11
11
|
<<EOM
|
12
|
+
/clients
|
13
|
+
/clients/x.json
|
12
14
|
/cookbooks
|
13
15
|
/cookbooks/x
|
14
16
|
/cookbooks/x/metadata.rb
|
@@ -18,27 +20,64 @@ describe 'knife delete' do
|
|
18
20
|
/environments
|
19
21
|
/environments/_default.json
|
20
22
|
/environments/x.json
|
23
|
+
/nodes
|
24
|
+
/nodes/x.json
|
21
25
|
/roles
|
22
26
|
/roles/x.json
|
27
|
+
/users
|
28
|
+
/users/x.json
|
23
29
|
EOM
|
24
30
|
end
|
25
31
|
|
32
|
+
let :server_everything do
|
33
|
+
<<EOM
|
34
|
+
/clients
|
35
|
+
/clients/chef-validator.json
|
36
|
+
/clients/chef-webui.json
|
37
|
+
/clients/x.json
|
38
|
+
/cookbooks
|
39
|
+
/cookbooks/x
|
40
|
+
/cookbooks/x/metadata.rb
|
41
|
+
/data_bags
|
42
|
+
/data_bags/x
|
43
|
+
/data_bags/x/y.json
|
44
|
+
/environments
|
45
|
+
/environments/_default.json
|
46
|
+
/environments/x.json
|
47
|
+
/nodes
|
48
|
+
/nodes/x.json
|
49
|
+
/roles
|
50
|
+
/roles/x.json
|
51
|
+
/users
|
52
|
+
/users/admin.json
|
53
|
+
/users/x.json
|
54
|
+
EOM
|
55
|
+
end
|
26
56
|
let :server_nothing do
|
27
57
|
<<EOM
|
58
|
+
/clients
|
59
|
+
/clients/chef-validator.json
|
60
|
+
/clients/chef-webui.json
|
28
61
|
/cookbooks
|
29
62
|
/data_bags
|
30
63
|
/environments
|
31
64
|
/environments/_default.json
|
65
|
+
/nodes
|
32
66
|
/roles
|
67
|
+
/users
|
68
|
+
/users/admin.json
|
33
69
|
EOM
|
34
70
|
end
|
35
71
|
|
36
72
|
let :nothing do
|
37
73
|
<<EOM
|
74
|
+
/clients
|
38
75
|
/cookbooks
|
39
76
|
/data_bags
|
40
77
|
/environments
|
78
|
+
/nodes
|
41
79
|
/roles
|
80
|
+
/users
|
42
81
|
EOM
|
43
82
|
end
|
44
83
|
|
@@ -66,13 +105,17 @@ EOM
|
|
66
105
|
ERROR: /cookbooks/x (remote) must be deleted recursively! Pass -r to knife delete.
|
67
106
|
ERROR: /cookbooks/x (local) must be deleted recursively! Pass -r to knife delete.
|
68
107
|
EOM
|
69
|
-
knife('list -Rf /').should_succeed
|
108
|
+
knife('list -Rf /').should_succeed server_everything
|
70
109
|
knife('list -Rf --local /').should_succeed everything
|
71
110
|
end
|
72
111
|
|
73
112
|
it 'knife delete -r /cookbooks/x deletes x' do
|
74
113
|
knife('delete -r /cookbooks/x').should_succeed "Deleted /cookbooks/x\n"
|
75
114
|
knife('list -Rf /').should_succeed <<EOM
|
115
|
+
/clients
|
116
|
+
/clients/chef-validator.json
|
117
|
+
/clients/chef-webui.json
|
118
|
+
/clients/x.json
|
76
119
|
/cookbooks
|
77
120
|
/data_bags
|
78
121
|
/data_bags/x
|
@@ -80,10 +123,17 @@ EOM
|
|
80
123
|
/environments
|
81
124
|
/environments/_default.json
|
82
125
|
/environments/x.json
|
126
|
+
/nodes
|
127
|
+
/nodes/x.json
|
83
128
|
/roles
|
84
129
|
/roles/x.json
|
130
|
+
/users
|
131
|
+
/users/admin.json
|
132
|
+
/users/x.json
|
85
133
|
EOM
|
86
134
|
knife('list -Rf --local /').should_succeed <<EOM
|
135
|
+
/clients
|
136
|
+
/clients/x.json
|
87
137
|
/cookbooks
|
88
138
|
/data_bags
|
89
139
|
/data_bags/x
|
@@ -91,15 +141,21 @@ EOM
|
|
91
141
|
/environments
|
92
142
|
/environments/_default.json
|
93
143
|
/environments/x.json
|
144
|
+
/nodes
|
145
|
+
/nodes/x.json
|
94
146
|
/roles
|
95
147
|
/roles/x.json
|
148
|
+
/users
|
149
|
+
/users/x.json
|
96
150
|
EOM
|
97
151
|
end
|
98
152
|
|
99
153
|
it 'knife delete -r --local-only /cookbooks/x deletes x locally but not remotely' do
|
100
154
|
knife('delete -r --local-only /cookbooks/x').should_succeed "Deleted /cookbooks/x\n"
|
101
|
-
knife('list -Rf /').should_succeed
|
155
|
+
knife('list -Rf /').should_succeed server_everything
|
102
156
|
knife('list -Rf --local /').should_succeed <<EOM
|
157
|
+
/clients
|
158
|
+
/clients/x.json
|
103
159
|
/cookbooks
|
104
160
|
/data_bags
|
105
161
|
/data_bags/x
|
@@ -107,14 +163,22 @@ EOM
|
|
107
163
|
/environments
|
108
164
|
/environments/_default.json
|
109
165
|
/environments/x.json
|
166
|
+
/nodes
|
167
|
+
/nodes/x.json
|
110
168
|
/roles
|
111
169
|
/roles/x.json
|
170
|
+
/users
|
171
|
+
/users/x.json
|
112
172
|
EOM
|
113
173
|
end
|
114
174
|
|
115
175
|
it 'knife delete -r --remote-only /cookbooks/x deletes x remotely but not locally' do
|
116
176
|
knife('delete -r --remote-only /cookbooks/x').should_succeed "Deleted /cookbooks/x\n"
|
117
177
|
knife('list -Rf /').should_succeed <<EOM
|
178
|
+
/clients
|
179
|
+
/clients/chef-validator.json
|
180
|
+
/clients/chef-webui.json
|
181
|
+
/clients/x.json
|
118
182
|
/cookbooks
|
119
183
|
/data_bags
|
120
184
|
/data_bags/x
|
@@ -122,8 +186,13 @@ EOM
|
|
122
186
|
/environments
|
123
187
|
/environments/_default.json
|
124
188
|
/environments/x.json
|
189
|
+
/nodes
|
190
|
+
/nodes/x.json
|
125
191
|
/roles
|
126
192
|
/roles/x.json
|
193
|
+
/users
|
194
|
+
/users/admin.json
|
195
|
+
/users/x.json
|
127
196
|
EOM
|
128
197
|
knife('list -Rf --local /').should_succeed everything
|
129
198
|
end
|
@@ -138,6 +207,10 @@ ERROR: /data_bags/empty (remote) must be deleted recursively! Pass -r to knife
|
|
138
207
|
ERROR: /data_bags/empty (local) must be deleted recursively! Pass -r to knife delete.
|
139
208
|
EOM
|
140
209
|
knife('list -Rf /').should_succeed <<EOM
|
210
|
+
/clients
|
211
|
+
/clients/chef-validator.json
|
212
|
+
/clients/chef-webui.json
|
213
|
+
/clients/x.json
|
141
214
|
/cookbooks
|
142
215
|
/cookbooks/x
|
143
216
|
/cookbooks/x/metadata.rb
|
@@ -148,10 +221,17 @@ EOM
|
|
148
221
|
/environments
|
149
222
|
/environments/_default.json
|
150
223
|
/environments/x.json
|
224
|
+
/nodes
|
225
|
+
/nodes/x.json
|
151
226
|
/roles
|
152
227
|
/roles/x.json
|
228
|
+
/users
|
229
|
+
/users/admin.json
|
230
|
+
/users/x.json
|
153
231
|
EOM
|
154
232
|
knife('list -Rf --local /').should_succeed <<EOM
|
233
|
+
/clients
|
234
|
+
/clients/x.json
|
155
235
|
/cookbooks
|
156
236
|
/cookbooks/x
|
157
237
|
/cookbooks/x/metadata.rb
|
@@ -162,8 +242,12 @@ EOM
|
|
162
242
|
/environments
|
163
243
|
/environments/_default.json
|
164
244
|
/environments/x.json
|
245
|
+
/nodes
|
246
|
+
/nodes/x.json
|
165
247
|
/roles
|
166
248
|
/roles/x.json
|
249
|
+
/users
|
250
|
+
/users/x.json
|
167
251
|
EOM
|
168
252
|
end
|
169
253
|
end
|
@@ -173,13 +257,17 @@ EOM
|
|
173
257
|
ERROR: /data_bags/x (remote) must be deleted recursively! Pass -r to knife delete.
|
174
258
|
ERROR: /data_bags/x (local) must be deleted recursively! Pass -r to knife delete.
|
175
259
|
EOM
|
176
|
-
knife('list -Rf /').should_succeed
|
260
|
+
knife('list -Rf /').should_succeed server_everything
|
177
261
|
knife('list -Rf --local /').should_succeed everything
|
178
262
|
end
|
179
263
|
|
180
264
|
it 'knife delete -r /data_bags/x deletes x' do
|
181
265
|
knife('delete -r /data_bags/x').should_succeed "Deleted /data_bags/x\n"
|
182
266
|
knife('list -Rf /').should_succeed <<EOM
|
267
|
+
/clients
|
268
|
+
/clients/chef-validator.json
|
269
|
+
/clients/chef-webui.json
|
270
|
+
/clients/x.json
|
183
271
|
/cookbooks
|
184
272
|
/cookbooks/x
|
185
273
|
/cookbooks/x/metadata.rb
|
@@ -187,10 +275,17 @@ EOM
|
|
187
275
|
/environments
|
188
276
|
/environments/_default.json
|
189
277
|
/environments/x.json
|
278
|
+
/nodes
|
279
|
+
/nodes/x.json
|
190
280
|
/roles
|
191
281
|
/roles/x.json
|
282
|
+
/users
|
283
|
+
/users/admin.json
|
284
|
+
/users/x.json
|
192
285
|
EOM
|
193
286
|
knife('list -Rf --local /').should_succeed <<EOM
|
287
|
+
/clients
|
288
|
+
/clients/x.json
|
194
289
|
/cookbooks
|
195
290
|
/cookbooks/x
|
196
291
|
/cookbooks/x/metadata.rb
|
@@ -198,14 +293,22 @@ EOM
|
|
198
293
|
/environments
|
199
294
|
/environments/_default.json
|
200
295
|
/environments/x.json
|
296
|
+
/nodes
|
297
|
+
/nodes/x.json
|
201
298
|
/roles
|
202
299
|
/roles/x.json
|
300
|
+
/users
|
301
|
+
/users/x.json
|
203
302
|
EOM
|
204
303
|
end
|
205
304
|
|
206
305
|
it 'knife delete /environments/x.json deletes x' do
|
207
306
|
knife('delete /environments/x.json').should_succeed "Deleted /environments/x.json\n"
|
208
307
|
knife('list -Rf /').should_succeed <<EOM
|
308
|
+
/clients
|
309
|
+
/clients/chef-validator.json
|
310
|
+
/clients/chef-webui.json
|
311
|
+
/clients/x.json
|
209
312
|
/cookbooks
|
210
313
|
/cookbooks/x
|
211
314
|
/cookbooks/x/metadata.rb
|
@@ -214,10 +317,17 @@ EOM
|
|
214
317
|
/data_bags/x/y.json
|
215
318
|
/environments
|
216
319
|
/environments/_default.json
|
320
|
+
/nodes
|
321
|
+
/nodes/x.json
|
217
322
|
/roles
|
218
323
|
/roles/x.json
|
324
|
+
/users
|
325
|
+
/users/admin.json
|
326
|
+
/users/x.json
|
219
327
|
EOM
|
220
328
|
knife('list -Rf --local /').should_succeed <<EOM
|
329
|
+
/clients
|
330
|
+
/clients/x.json
|
221
331
|
/cookbooks
|
222
332
|
/cookbooks/x
|
223
333
|
/cookbooks/x/metadata.rb
|
@@ -226,14 +336,22 @@ EOM
|
|
226
336
|
/data_bags/x/y.json
|
227
337
|
/environments
|
228
338
|
/environments/_default.json
|
339
|
+
/nodes
|
340
|
+
/nodes/x.json
|
229
341
|
/roles
|
230
342
|
/roles/x.json
|
343
|
+
/users
|
344
|
+
/users/x.json
|
231
345
|
EOM
|
232
346
|
end
|
233
347
|
|
234
348
|
it 'knife delete /roles/x.json deletes x' do
|
235
349
|
knife('delete /roles/x.json').should_succeed "Deleted /roles/x.json\n"
|
236
350
|
knife('list -Rf /').should_succeed <<EOM
|
351
|
+
/clients
|
352
|
+
/clients/chef-validator.json
|
353
|
+
/clients/chef-webui.json
|
354
|
+
/clients/x.json
|
237
355
|
/cookbooks
|
238
356
|
/cookbooks/x
|
239
357
|
/cookbooks/x/metadata.rb
|
@@ -243,9 +361,16 @@ EOM
|
|
243
361
|
/environments
|
244
362
|
/environments/_default.json
|
245
363
|
/environments/x.json
|
364
|
+
/nodes
|
365
|
+
/nodes/x.json
|
246
366
|
/roles
|
367
|
+
/users
|
368
|
+
/users/admin.json
|
369
|
+
/users/x.json
|
247
370
|
EOM
|
248
371
|
knife('list -Rf --local /').should_succeed <<EOM
|
372
|
+
/clients
|
373
|
+
/clients/x.json
|
249
374
|
/cookbooks
|
250
375
|
/cookbooks/x
|
251
376
|
/cookbooks/x/metadata.rb
|
@@ -255,14 +380,20 @@ EOM
|
|
255
380
|
/environments
|
256
381
|
/environments/_default.json
|
257
382
|
/environments/x.json
|
383
|
+
/nodes
|
384
|
+
/nodes/x.json
|
258
385
|
/roles
|
386
|
+
/users
|
387
|
+
/users/x.json
|
259
388
|
EOM
|
260
389
|
end
|
261
390
|
|
262
391
|
it 'knife delete /environments/_default.json fails but still deletes the local copy' do
|
263
392
|
knife('delete /environments/_default.json').should_fail :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", :stdout => "Deleted /environments/_default.json\n"
|
264
|
-
knife('list -Rf /').should_succeed
|
393
|
+
knife('list -Rf /').should_succeed server_everything
|
265
394
|
knife('list -Rf --local /').should_succeed <<EOM
|
395
|
+
/clients
|
396
|
+
/clients/x.json
|
266
397
|
/cookbooks
|
267
398
|
/cookbooks/x
|
268
399
|
/cookbooks/x/metadata.rb
|
@@ -271,14 +402,18 @@ EOM
|
|
271
402
|
/data_bags/x/y.json
|
272
403
|
/environments
|
273
404
|
/environments/x.json
|
405
|
+
/nodes
|
406
|
+
/nodes/x.json
|
274
407
|
/roles
|
275
408
|
/roles/x.json
|
409
|
+
/users
|
410
|
+
/users/x.json
|
276
411
|
EOM
|
277
412
|
end
|
278
413
|
|
279
414
|
it 'knife delete /environments/nonexistent.json fails' do
|
280
415
|
knife('delete /environments/nonexistent.json').should_fail "ERROR: /environments/nonexistent.json: No such file or directory\n"
|
281
|
-
knife('list -Rf /').should_succeed
|
416
|
+
knife('list -Rf /').should_succeed server_everything
|
282
417
|
knife('list -Rf --local /').should_succeed everything
|
283
418
|
end
|
284
419
|
|
@@ -287,7 +422,7 @@ EOM
|
|
287
422
|
ERROR: / (remote) cannot be deleted.
|
288
423
|
ERROR: / (local) cannot be deleted.
|
289
424
|
EOM
|
290
|
-
knife('list -Rf /').should_succeed
|
425
|
+
knife('list -Rf /').should_succeed server_everything
|
291
426
|
knife('list -Rf --local /').should_succeed everything
|
292
427
|
end
|
293
428
|
|
@@ -295,16 +430,22 @@ EOM
|
|
295
430
|
knife('delete -r /*').should_fail <<EOM
|
296
431
|
ERROR: / (remote) cannot be deleted.
|
297
432
|
ERROR: / (local) cannot be deleted.
|
433
|
+
ERROR: /clients (remote) cannot be deleted.
|
434
|
+
ERROR: /clients (local) cannot be deleted.
|
298
435
|
ERROR: /cookbooks (remote) cannot be deleted.
|
299
436
|
ERROR: /cookbooks (local) cannot be deleted.
|
300
437
|
ERROR: /data_bags (remote) cannot be deleted.
|
301
438
|
ERROR: /data_bags (local) cannot be deleted.
|
302
439
|
ERROR: /environments (remote) cannot be deleted.
|
303
440
|
ERROR: /environments (local) cannot be deleted.
|
441
|
+
ERROR: /nodes (remote) cannot be deleted.
|
442
|
+
ERROR: /nodes (local) cannot be deleted.
|
304
443
|
ERROR: /roles (remote) cannot be deleted.
|
305
444
|
ERROR: /roles (local) cannot be deleted.
|
445
|
+
ERROR: /users (remote) cannot be deleted.
|
446
|
+
ERROR: /users (local) cannot be deleted.
|
306
447
|
EOM
|
307
|
-
knife('list -Rf /').should_succeed
|
448
|
+
knife('list -Rf /').should_succeed server_everything
|
308
449
|
knife('list -Rf --local /').should_succeed everything
|
309
450
|
end
|
310
451
|
end
|
@@ -320,13 +461,17 @@ EOM
|
|
320
461
|
|
321
462
|
it 'knife delete /cookbooks/x fails' do
|
322
463
|
knife('delete /cookbooks/x').should_fail "ERROR: /cookbooks/x (remote) must be deleted recursively! Pass -r to knife delete.\n"
|
323
|
-
knife('list -Rf /').should_succeed
|
464
|
+
knife('list -Rf /').should_succeed server_everything
|
324
465
|
knife('list -Rf --local /').should_succeed nothing
|
325
466
|
end
|
326
467
|
|
327
468
|
it 'knife delete -r /cookbooks/x deletes x' do
|
328
469
|
knife('delete -r /cookbooks/x').should_succeed "Deleted /cookbooks/x\n"
|
329
470
|
knife('list -Rf /').should_succeed <<EOM
|
471
|
+
/clients
|
472
|
+
/clients/chef-validator.json
|
473
|
+
/clients/chef-webui.json
|
474
|
+
/clients/x.json
|
330
475
|
/cookbooks
|
331
476
|
/data_bags
|
332
477
|
/data_bags/x
|
@@ -334,21 +479,30 @@ EOM
|
|
334
479
|
/environments
|
335
480
|
/environments/_default.json
|
336
481
|
/environments/x.json
|
482
|
+
/nodes
|
483
|
+
/nodes/x.json
|
337
484
|
/roles
|
338
485
|
/roles/x.json
|
486
|
+
/users
|
487
|
+
/users/admin.json
|
488
|
+
/users/x.json
|
339
489
|
EOM
|
340
490
|
knife('list -Rf --local /').should_succeed nothing
|
341
491
|
end
|
342
492
|
|
343
493
|
it 'knife delete /data_bags/x fails' do
|
344
494
|
knife('delete /data_bags/x').should_fail "ERROR: /data_bags/x (remote) must be deleted recursively! Pass -r to knife delete.\n"
|
345
|
-
knife('list -Rf /').should_succeed
|
495
|
+
knife('list -Rf /').should_succeed server_everything
|
346
496
|
knife('list -Rf --local /').should_succeed nothing
|
347
497
|
end
|
348
498
|
|
349
499
|
it 'knife delete -r /data_bags/x deletes x' do
|
350
500
|
knife('delete -r /data_bags/x').should_succeed "Deleted /data_bags/x\n"
|
351
501
|
knife('list -Rf /').should_succeed <<EOM
|
502
|
+
/clients
|
503
|
+
/clients/chef-validator.json
|
504
|
+
/clients/chef-webui.json
|
505
|
+
/clients/x.json
|
352
506
|
/cookbooks
|
353
507
|
/cookbooks/x
|
354
508
|
/cookbooks/x/metadata.rb
|
@@ -356,8 +510,13 @@ EOM
|
|
356
510
|
/environments
|
357
511
|
/environments/_default.json
|
358
512
|
/environments/x.json
|
513
|
+
/nodes
|
514
|
+
/nodes/x.json
|
359
515
|
/roles
|
360
516
|
/roles/x.json
|
517
|
+
/users
|
518
|
+
/users/admin.json
|
519
|
+
/users/x.json
|
361
520
|
EOM
|
362
521
|
knife('list -Rf --local /').should_succeed nothing
|
363
522
|
end
|
@@ -365,6 +524,10 @@ EOM
|
|
365
524
|
it 'knife delete /environments/x.json deletes x' do
|
366
525
|
knife('delete /environments/x.json').should_succeed "Deleted /environments/x.json\n"
|
367
526
|
knife('list -Rf /').should_succeed <<EOM
|
527
|
+
/clients
|
528
|
+
/clients/chef-validator.json
|
529
|
+
/clients/chef-webui.json
|
530
|
+
/clients/x.json
|
368
531
|
/cookbooks
|
369
532
|
/cookbooks/x
|
370
533
|
/cookbooks/x/metadata.rb
|
@@ -373,8 +536,13 @@ EOM
|
|
373
536
|
/data_bags/x/y.json
|
374
537
|
/environments
|
375
538
|
/environments/_default.json
|
539
|
+
/nodes
|
540
|
+
/nodes/x.json
|
376
541
|
/roles
|
377
542
|
/roles/x.json
|
543
|
+
/users
|
544
|
+
/users/admin.json
|
545
|
+
/users/x.json
|
378
546
|
EOM
|
379
547
|
knife('list -Rf --local /').should_succeed nothing
|
380
548
|
end
|
@@ -382,6 +550,10 @@ EOM
|
|
382
550
|
it 'knife delete /roles/x.json deletes x' do
|
383
551
|
knife('delete /roles/x.json').should_succeed "Deleted /roles/x.json\n"
|
384
552
|
knife('list -Rf /').should_succeed <<EOM
|
553
|
+
/clients
|
554
|
+
/clients/chef-validator.json
|
555
|
+
/clients/chef-webui.json
|
556
|
+
/clients/x.json
|
385
557
|
/cookbooks
|
386
558
|
/cookbooks/x
|
387
559
|
/cookbooks/x/metadata.rb
|
@@ -391,20 +563,25 @@ EOM
|
|
391
563
|
/environments
|
392
564
|
/environments/_default.json
|
393
565
|
/environments/x.json
|
566
|
+
/nodes
|
567
|
+
/nodes/x.json
|
394
568
|
/roles
|
569
|
+
/users
|
570
|
+
/users/admin.json
|
571
|
+
/users/x.json
|
395
572
|
EOM
|
396
573
|
knife('list -Rf --local /').should_succeed nothing
|
397
574
|
end
|
398
575
|
|
399
576
|
it 'knife delete /environments/_default.json fails' do
|
400
577
|
knife('delete /environments/_default.json').should_fail "", :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n"
|
401
|
-
knife('list -Rf /').should_succeed
|
578
|
+
knife('list -Rf /').should_succeed server_everything
|
402
579
|
knife('list -Rf --local /').should_succeed nothing
|
403
580
|
end
|
404
581
|
|
405
582
|
it 'knife delete / fails' do
|
406
583
|
knife('delete /').should_fail "ERROR: / (remote) cannot be deleted.\nERROR: / (local) cannot be deleted.\n"
|
407
|
-
knife('list -Rf /').should_succeed
|
584
|
+
knife('list -Rf /').should_succeed server_everything
|
408
585
|
knife('list -Rf --local /').should_succeed nothing
|
409
586
|
end
|
410
587
|
|
@@ -412,22 +589,28 @@ EOM
|
|
412
589
|
knife('delete -r /*').should_fail <<EOM
|
413
590
|
ERROR: / (remote) cannot be deleted.
|
414
591
|
ERROR: / (local) cannot be deleted.
|
592
|
+
ERROR: /clients (remote) cannot be deleted.
|
593
|
+
ERROR: /clients (local) cannot be deleted.
|
415
594
|
ERROR: /cookbooks (remote) cannot be deleted.
|
416
595
|
ERROR: /cookbooks (local) cannot be deleted.
|
417
596
|
ERROR: /data_bags (remote) cannot be deleted.
|
418
597
|
ERROR: /data_bags (local) cannot be deleted.
|
419
598
|
ERROR: /environments (remote) cannot be deleted.
|
420
599
|
ERROR: /environments (local) cannot be deleted.
|
600
|
+
ERROR: /nodes (remote) cannot be deleted.
|
601
|
+
ERROR: /nodes (local) cannot be deleted.
|
421
602
|
ERROR: /roles (remote) cannot be deleted.
|
422
603
|
ERROR: /roles (local) cannot be deleted.
|
604
|
+
ERROR: /users (remote) cannot be deleted.
|
605
|
+
ERROR: /users (local) cannot be deleted.
|
423
606
|
EOM
|
424
|
-
knife('list -Rf /').should_succeed
|
607
|
+
knife('list -Rf /').should_succeed server_everything
|
425
608
|
knife('list -Rf --local /').should_succeed nothing
|
426
609
|
end
|
427
610
|
|
428
611
|
it 'knife delete /environments/nonexistent.json fails' do
|
429
612
|
knife('delete /environments/nonexistent.json').should_fail "ERROR: /environments/nonexistent.json: No such file or directory\n"
|
430
|
-
knife('list -Rf /').should_succeed
|
613
|
+
knife('list -Rf /').should_succeed server_everything
|
431
614
|
knife('list -Rf --local /').should_succeed nothing
|
432
615
|
end
|
433
616
|
|
@@ -436,6 +619,10 @@ EOM
|
|
436
619
|
it 'knife delete fails' do
|
437
620
|
knife('delete').should_fail "FATAL: Must specify at least one argument. If you want to delete everything in this directory, type \"knife delete --recurse .\"\n", :stdout => /USAGE/
|
438
621
|
knife('list -Rf /').should_succeed <<EOM
|
622
|
+
clients
|
623
|
+
clients/chef-validator.json
|
624
|
+
clients/chef-webui.json
|
625
|
+
clients/x.json
|
439
626
|
cookbooks
|
440
627
|
cookbooks/x
|
441
628
|
cookbooks/x/metadata.rb
|
@@ -445,14 +632,22 @@ data_bags/x/y.json
|
|
445
632
|
environments
|
446
633
|
environments/_default.json
|
447
634
|
environments/x.json
|
635
|
+
nodes
|
636
|
+
nodes/x.json
|
448
637
|
roles
|
449
638
|
roles/x.json
|
639
|
+
users
|
640
|
+
users/admin.json
|
641
|
+
users/x.json
|
450
642
|
EOM
|
451
643
|
knife('list -Rf --local /').should_succeed <<EOM
|
644
|
+
clients
|
452
645
|
cookbooks
|
453
646
|
data_bags
|
454
647
|
environments
|
648
|
+
nodes
|
455
649
|
roles
|
650
|
+
users
|
456
651
|
EOM
|
457
652
|
end
|
458
653
|
end
|
@@ -480,6 +675,8 @@ EOM
|
|
480
675
|
knife('delete -r /cookbooks/x').should_succeed "Deleted /cookbooks/x\n"
|
481
676
|
knife('list -Rf /').should_succeed server_nothing
|
482
677
|
knife('list -Rf --local /').should_succeed <<EOM
|
678
|
+
/clients
|
679
|
+
/clients/x.json
|
483
680
|
/cookbooks
|
484
681
|
/data_bags
|
485
682
|
/data_bags/x
|
@@ -487,8 +684,12 @@ EOM
|
|
487
684
|
/environments
|
488
685
|
/environments/_default.json
|
489
686
|
/environments/x.json
|
687
|
+
/nodes
|
688
|
+
/nodes/x.json
|
490
689
|
/roles
|
491
690
|
/roles/x.json
|
691
|
+
/users
|
692
|
+
/users/x.json
|
492
693
|
EOM
|
493
694
|
end
|
494
695
|
|
@@ -502,6 +703,8 @@ EOM
|
|
502
703
|
knife('delete -r /data_bags/x').should_succeed "Deleted /data_bags/x\n"
|
503
704
|
knife('list -Rf /').should_succeed server_nothing
|
504
705
|
knife('list -Rf --local /').should_succeed <<EOM
|
706
|
+
/clients
|
707
|
+
/clients/x.json
|
505
708
|
/cookbooks
|
506
709
|
/cookbooks/x
|
507
710
|
/cookbooks/x/metadata.rb
|
@@ -509,8 +712,12 @@ EOM
|
|
509
712
|
/environments
|
510
713
|
/environments/_default.json
|
511
714
|
/environments/x.json
|
715
|
+
/nodes
|
716
|
+
/nodes/x.json
|
512
717
|
/roles
|
513
718
|
/roles/x.json
|
719
|
+
/users
|
720
|
+
/users/x.json
|
514
721
|
EOM
|
515
722
|
end
|
516
723
|
|
@@ -518,6 +725,8 @@ EOM
|
|
518
725
|
knife('delete /environments/x.json').should_succeed "Deleted /environments/x.json\n"
|
519
726
|
knife('list -Rf /').should_succeed server_nothing
|
520
727
|
knife('list -Rf --local /').should_succeed <<EOM
|
728
|
+
/clients
|
729
|
+
/clients/x.json
|
521
730
|
/cookbooks
|
522
731
|
/cookbooks/x
|
523
732
|
/cookbooks/x/metadata.rb
|
@@ -526,8 +735,12 @@ EOM
|
|
526
735
|
/data_bags/x/y.json
|
527
736
|
/environments
|
528
737
|
/environments/_default.json
|
738
|
+
/nodes
|
739
|
+
/nodes/x.json
|
529
740
|
/roles
|
530
741
|
/roles/x.json
|
742
|
+
/users
|
743
|
+
/users/x.json
|
531
744
|
EOM
|
532
745
|
end
|
533
746
|
|
@@ -535,6 +748,8 @@ EOM
|
|
535
748
|
knife('delete /roles/x.json').should_succeed "Deleted /roles/x.json\n"
|
536
749
|
knife('list -Rf /').should_succeed server_nothing
|
537
750
|
knife('list -Rf --local /').should_succeed <<EOM
|
751
|
+
/clients
|
752
|
+
/clients/x.json
|
538
753
|
/cookbooks
|
539
754
|
/cookbooks/x
|
540
755
|
/cookbooks/x/metadata.rb
|
@@ -544,7 +759,11 @@ EOM
|
|
544
759
|
/environments
|
545
760
|
/environments/_default.json
|
546
761
|
/environments/x.json
|
762
|
+
/nodes
|
763
|
+
/nodes/x.json
|
547
764
|
/roles
|
765
|
+
/users
|
766
|
+
/users/x.json
|
548
767
|
EOM
|
549
768
|
end
|
550
769
|
|
@@ -552,6 +771,8 @@ EOM
|
|
552
771
|
knife('delete /environments/_default.json').should_fail :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", :stdout => "Deleted /environments/_default.json\n"
|
553
772
|
knife('list -Rf /').should_succeed server_nothing
|
554
773
|
knife('list -Rf --local /').should_succeed <<EOM
|
774
|
+
/clients
|
775
|
+
/clients/x.json
|
555
776
|
/cookbooks
|
556
777
|
/cookbooks/x
|
557
778
|
/cookbooks/x/metadata.rb
|
@@ -560,8 +781,12 @@ EOM
|
|
560
781
|
/data_bags/x/y.json
|
561
782
|
/environments
|
562
783
|
/environments/x.json
|
784
|
+
/nodes
|
785
|
+
/nodes/x.json
|
563
786
|
/roles
|
564
787
|
/roles/x.json
|
788
|
+
/users
|
789
|
+
/users/x.json
|
565
790
|
EOM
|
566
791
|
end
|
567
792
|
|
@@ -575,14 +800,20 @@ EOM
|
|
575
800
|
knife('delete -r /*').should_fail <<EOM
|
576
801
|
ERROR: / (remote) cannot be deleted.
|
577
802
|
ERROR: / (local) cannot be deleted.
|
803
|
+
ERROR: /clients (remote) cannot be deleted.
|
804
|
+
ERROR: /clients (local) cannot be deleted.
|
578
805
|
ERROR: /cookbooks (remote) cannot be deleted.
|
579
806
|
ERROR: /cookbooks (local) cannot be deleted.
|
580
807
|
ERROR: /data_bags (remote) cannot be deleted.
|
581
808
|
ERROR: /data_bags (local) cannot be deleted.
|
582
809
|
ERROR: /environments (remote) cannot be deleted.
|
583
810
|
ERROR: /environments (local) cannot be deleted.
|
811
|
+
ERROR: /nodes (remote) cannot be deleted.
|
812
|
+
ERROR: /nodes (local) cannot be deleted.
|
584
813
|
ERROR: /roles (remote) cannot be deleted.
|
585
814
|
ERROR: /roles (local) cannot be deleted.
|
815
|
+
ERROR: /users (remote) cannot be deleted.
|
816
|
+
ERROR: /users (local) cannot be deleted.
|
586
817
|
EOM
|
587
818
|
knife('list -Rf /').should_succeed server_nothing
|
588
819
|
knife('list -Rf --local /').should_succeed everything
|
@@ -599,13 +830,21 @@ EOM
|
|
599
830
|
it 'knife delete fails' do
|
600
831
|
knife('delete').should_fail "FATAL: Must specify at least one argument. If you want to delete everything in this directory, type \"knife delete --recurse .\"\n", :stdout => /USAGE/
|
601
832
|
knife('list -Rf /').should_succeed <<EOM
|
833
|
+
clients
|
834
|
+
clients/chef-validator.json
|
835
|
+
clients/chef-webui.json
|
602
836
|
cookbooks
|
603
837
|
data_bags
|
604
838
|
environments
|
605
839
|
environments/_default.json
|
840
|
+
nodes
|
606
841
|
roles
|
842
|
+
users
|
843
|
+
users/admin.json
|
607
844
|
EOM
|
608
845
|
knife('list -Rf --local /').should_succeed <<EOM
|
846
|
+
clients
|
847
|
+
clients/x.json
|
609
848
|
cookbooks
|
610
849
|
cookbooks/x
|
611
850
|
cookbooks/x/metadata.rb
|
@@ -615,8 +854,12 @@ data_bags/x/y.json
|
|
615
854
|
environments
|
616
855
|
environments/_default.json
|
617
856
|
environments/x.json
|
857
|
+
nodes
|
858
|
+
nodes/x.json
|
618
859
|
roles
|
619
860
|
roles/x.json
|
861
|
+
users
|
862
|
+
users/x.json
|
620
863
|
EOM
|
621
864
|
end
|
622
865
|
end
|