cuken 0.1.4 → 0.1.7

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.
Files changed (41) hide show
  1. data/.relish +2 -0
  2. data/Gemfile +4 -4
  3. data/Gemfile.lock +17 -23
  4. data/VERSION +1 -1
  5. data/cuken.gems +108 -0
  6. data/cuken.gemspec +33 -10
  7. data/features/about.md +15 -2
  8. data/features/chef_examples/cookbooks_cookbook.feature +38 -3
  9. data/features/chef_examples/cookbooks_remote_repo.feature +10 -0
  10. data/features/chef_examples/cookbooks_repo.feature +5 -5
  11. data/features/{chef_steps → chef_examples}/knife_admin_client.feature +4 -4
  12. data/features/chef_examples/knife_client_create.feature +13 -0
  13. data/features/chef_steps/common_steps.feature +2 -2
  14. data/features/chef_steps/cookbook_steps.feature +12 -5
  15. data/features/chef_steps/node_steps.feature +1 -1
  16. data/features/file_steps/file_steps.feature +11 -11
  17. data/lib/cuken/all.rb +4 -0
  18. data/lib/cuken/api/chef/common.rb +46 -8
  19. data/lib/cuken/api/chef/knife.rb +107 -0
  20. data/lib/cuken/api/chef.rb +21 -13
  21. data/lib/cuken/api/common.rb +12 -0
  22. data/lib/cuken/api/rvm.rb +501 -0
  23. data/lib/cuken/api/ssh-forever.rb +237 -0
  24. data/lib/cuken/chef.rb +2 -0
  25. data/lib/cuken/common.rb +1 -0
  26. data/lib/cuken/cucumber/chef/common.rb +4 -2
  27. data/lib/cuken/cucumber/chef/cookbook.rb +87 -12
  28. data/lib/cuken/cucumber/chef/data_bag.rb +27 -0
  29. data/lib/cuken/cucumber/chef/knife.rb +10 -0
  30. data/lib/cuken/cucumber/chef/node.rb +20 -8
  31. data/lib/cuken/cucumber/chef/role.rb +18 -1
  32. data/lib/cuken/cucumber/chef.rb +5 -3
  33. data/lib/cuken/cucumber/cmd.rb +1 -1
  34. data/lib/cuken/cucumber/file.rb +18 -2
  35. data/lib/cuken/cucumber/rvm.rb +4 -0
  36. data/lib/cuken/rvm.rb +3 -0
  37. data/spec/api/knife_spec.rb +94 -0
  38. data/spec/api/rvm_spec.rb +274 -0
  39. data/spec/api/rvmrc_processor_spec.rb +288 -0
  40. data/spec/spec_helper.rb +58 -2
  41. metadata +67 -30
data/.relish ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ project: cuken
data/Gemfile CHANGED
@@ -4,21 +4,21 @@ source "http://rubygems.org"
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
  group :default do
6
6
  gem 'aruba', "~> 0.3.5"
7
- gem 'ssh-forever', "~> 0.4.0",
8
- :git => "git://github.com/hedgehog/ssh-forever.git",
9
- :branch => 'v0.4.0'
10
7
  gem 'chef', "~>0.9.12"
11
8
  gem 'grit', "~>2.4.1"
9
+ gem 'rvm', "~>1.5.2"
12
10
  end
13
11
  # Add dependencies to develop your gem here.
14
12
  # Include everything needed to run rake, tests, features, etc.
15
13
  group :development do
14
+ gem "rr", "~> 1.0.2"
16
15
  gem "rspec", "~> 2.5.0"
17
16
  gem "yard", "~> 0.6.0"
18
17
  gem "cucumber", ">= 0"
19
- gem "bundler", "~> 1.0.10"
18
+ gem "bundler", "~> 1.0.11"
20
19
  gem "jeweler", "~> 1.5.2"
21
20
  gem "rcov", ">= 0"
22
21
  gem "reek", "~> 1.2.8"
23
22
  gem "roodi", "~> 2.1.0"
23
+ gem "fakefs", '~>0.3.1'
24
24
  end
data/Gemfile.lock CHANGED
@@ -1,34 +1,25 @@
1
- GIT
2
- remote: git://github.com/hedgehog/ssh-forever.git
3
- revision: defa8b42019f1081f1a1523883e58c3d165f529f
4
- branch: v0.4.0
5
- specs:
6
- ssh-forever (0.4.0)
7
- open4 (>= 1.0.1)
8
-
9
1
  GEM
10
2
  remote: http://rubygems.org/
11
3
  specs:
12
- abstract (1.0.0)
13
- aruba (0.3.5)
4
+ aruba (0.3.6)
14
5
  childprocess (>= 0.1.7)
15
6
  cucumber (>= 0.10.0)
16
7
  rspec (>= 2.5.0)
17
8
  builder (3.0.0)
18
9
  bunny (0.6.0)
19
- chef (0.9.14)
10
+ chef (0.9.16)
20
11
  bunny (>= 0.6.0)
21
12
  erubis
22
13
  extlib
23
14
  highline
24
- json (<= 1.4.6, >= 1.4.4)
15
+ json (>= 1.4.4, <= 1.4.6)
25
16
  mixlib-authentication (>= 1.1.0)
26
17
  mixlib-cli (>= 1.1.0)
27
18
  mixlib-config (>= 1.1.2)
28
19
  mixlib-log (>= 1.2.0)
29
20
  moneta
30
21
  ohai (>= 0.5.7)
31
- rest-client (< 1.7.0, >= 1.0.4)
22
+ rest-client (>= 1.0.4, < 1.7.0)
32
23
  uuidtools
33
24
  childprocess (0.1.8)
34
25
  ffi (~> 1.0.6)
@@ -39,9 +30,9 @@ GEM
39
30
  json (>= 1.4.6)
40
31
  term-ansicolor (>= 1.0.5)
41
32
  diff-lcs (1.1.2)
42
- erubis (2.6.6)
43
- abstract (>= 1.0.0)
33
+ erubis (2.7.0)
44
34
  extlib (0.9.15)
35
+ fakefs (0.3.1)
45
36
  ffi (1.0.7)
46
37
  rake (>= 0.8.7)
47
38
  gherkin (2.3.5)
@@ -63,14 +54,12 @@ GEM
63
54
  mixlib-config (1.1.2)
64
55
  mixlib-log (1.3.0)
65
56
  moneta (0.6.0)
66
- ohai (0.5.8)
67
- extlib
68
- json (<= 1.4.6, >= 1.4.4)
57
+ ohai (0.6.2)
69
58
  mixlib-cli
70
59
  mixlib-config
71
60
  mixlib-log
72
61
  systemu
73
- open4 (1.0.1)
62
+ yajl-ruby
74
63
  rake (0.8.7)
75
64
  rcov (0.9.9)
76
65
  reek (1.2.8)
@@ -81,6 +70,7 @@ GEM
81
70
  mime-types (>= 1.16)
82
71
  roodi (2.1.0)
83
72
  ruby_parser
73
+ rr (1.0.2)
84
74
  rspec (2.5.0)
85
75
  rspec-core (~> 2.5.0)
86
76
  rspec-expectations (~> 2.5.0)
@@ -94,25 +84,29 @@ GEM
94
84
  sexp_processor (~> 3.0)
95
85
  ruby_parser (2.0.6)
96
86
  sexp_processor (~> 3.0)
87
+ rvm (1.5.2)
97
88
  sexp_processor (3.0.5)
98
- systemu (1.2.0)
89
+ systemu (2.2.0)
99
90
  term-ansicolor (1.0.5)
100
91
  uuidtools (2.1.2)
101
- yard (0.6.5)
92
+ yajl-ruby (0.8.2)
93
+ yard (0.6.8)
102
94
 
103
95
  PLATFORMS
104
96
  ruby
105
97
 
106
98
  DEPENDENCIES
107
99
  aruba (~> 0.3.5)
108
- bundler (~> 1.0.10)
100
+ bundler (~> 1.0.11)
109
101
  chef (~> 0.9.12)
110
102
  cucumber
103
+ fakefs (~> 0.3.1)
111
104
  grit (~> 2.4.1)
112
105
  jeweler (~> 1.5.2)
113
106
  rcov
114
107
  reek (~> 1.2.8)
115
108
  roodi (~> 2.1.0)
109
+ rr (~> 1.0.2)
116
110
  rspec (~> 2.5.0)
117
- ssh-forever (~> 0.4.0)!
111
+ rvm (~> 1.5.2)
118
112
  yard (~> 0.6.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.7
data/cuken.gems ADDED
@@ -0,0 +1,108 @@
1
+ # cuken.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
2
+ abstract -v1.0.0
3
+ activesupport -v3.0.5
4
+ amqp -v0.6.7
5
+ archive-tar-minitar -v0.5.2
6
+ arrayfields -v4.7.4
7
+ aruba -v0.3.5
8
+ aruba -v0.3.4
9
+ aruba -v0.3.3
10
+ aruba -v0.3.2
11
+ builder -v3.0.0
12
+ bundler -v1.0.7
13
+ bunny -v0.6.0
14
+ chef -v0.9.14
15
+ chef -v0.9.12
16
+ childprocess -v0.1.8
17
+ childprocess -v0.1.7
18
+ chronic -v0.2.3
19
+ churn -v0.0.13
20
+ colored -v1.2
21
+ columnize -v0.3.2
22
+ cucumber -v0.10.2
23
+ cucumber -v0.10.0
24
+ cucumber-nagios -v0.9.0
25
+ cucumber-nagios -v0.8.10
26
+ cuken -v0.1.4
27
+ cuken -v0.1.1
28
+ cuken -v0.1.0
29
+ diff-lcs -v1.1.2
30
+ erubis -v2.6.6
31
+ eventmachine -v0.12.10
32
+ extlib -v0.9.15
33
+ fakefs -v0.3.1
34
+ fattr -v2.2.0
35
+ ffi -v1.0.7
36
+ ffi -v0.6.3
37
+ flay -v1.4.2
38
+ flog -v2.5.1
39
+ gherkin -v2.3.5
40
+ gherkin -v2.3.4
41
+ git -v1.2.5
42
+ grit -v2.4.1
43
+ haml -v3.0.25
44
+ highline -v1.6.1
45
+ hirb -v0.4.0
46
+ hoe -v2.9.1
47
+ i18n -v0.5.0
48
+ jeweler -v1.5.2
49
+ json -v1.4.6
50
+ json_pure -v1.5.1
51
+ linecache19 -v0.5.11
52
+ main -v4.4.0
53
+ mechanize -v1.0.0
54
+ metric_fu -v2.0.0
55
+ mime-types -v1.16
56
+ mixlib-authentication -v1.1.4
57
+ mixlib-cli -v1.2.0
58
+ mixlib-config -v1.1.2
59
+ mixlib-log -v1.3.0
60
+ mixlib-log -v1.2.0
61
+ moneta -v0.6.0
62
+ net-ssh -v2.1.3
63
+ net-ssh -v2.1.0
64
+ net-ssh -v2.0.18
65
+ net-ssh-gateway -v1.0.1
66
+ net-ssh-multi -v1.0.1
67
+ nokogiri -v1.4.4
68
+ ohai -v0.5.8
69
+ open4 -v1.0.1
70
+ polyglot -v0.3.1
71
+ rack -v1.2.2
72
+ rack -v1.2.1
73
+ rack-test -v0.5.7
74
+ rails_best_practices -v0.7.1
75
+ rake -v0.8.7
76
+ rcov -v0.9.9
77
+ reek -v1.2.8
78
+ relish -v0.2.2
79
+ rest-client -v1.6.1
80
+ roodi -v2.1.0
81
+ rr -v1.0.2
82
+ rspec -v2.5.0
83
+ rspec -v2.3.0
84
+ rspec-core -v2.5.1
85
+ rspec-core -v2.3.1
86
+ rspec-expectations -v2.5.0
87
+ rspec-expectations -v2.3.0
88
+ rspec-mocks -v2.5.0
89
+ rspec-mocks -v2.3.0
90
+ ruby-debug-base19x -v0.11.26
91
+ ruby-debug-base19x -v0.11.25.jb3
92
+ ruby-debug-ide -v0.4.17.beta3
93
+ ruby-debug-ide -v0.4.17.beta2
94
+ ruby-progressbar -v0.0.9
95
+ ruby2ruby -v1.2.5
96
+ ruby_core_source -v0.1.4
97
+ ruby_parser -v2.0.6
98
+ rvm -v1.5.2
99
+ Saikuro -v1.1.0
100
+ sexp_processor -v3.0.5
101
+ ssh-forever -v0.4.0
102
+ systemu -v1.2.0
103
+ templater -v1.0.0
104
+ term-ansicolor -v1.0.5
105
+ treetop -v1.4.9
106
+ uuidtools -v2.1.2
107
+ webrat -v0.7.2
108
+ yard -v0.6.5
data/cuken.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cuken}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hedgehog"]
12
- s.date = %q{2011-03-29}
12
+ s.date = %q{2011-04-17}
13
13
  s.description = %q{Reusable Cucumber steps and API for post-convergence system integration descriptions}
14
14
  s.email = %q{hedgehogshiatus@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ ".relish",
21
22
  ".rspec",
22
23
  "Gemfile",
23
24
  "Gemfile.lock",
@@ -27,16 +28,19 @@ Gem::Specification.new do |s|
27
28
  "Rakefile",
28
29
  "VERSION",
29
30
  "cucumber.yml",
31
+ "cuken.gems",
30
32
  "cuken.gemspec",
31
33
  "examples/chef/features/support/env.rb",
32
34
  "features/.nav",
33
35
  "features/about.md",
34
36
  "features/chef_examples/cookbooks_cookbook.feature",
35
37
  "features/chef_examples/cookbooks_metadata.feature",
38
+ "features/chef_examples/cookbooks_remote_repo.feature",
36
39
  "features/chef_examples/cookbooks_repo.feature",
40
+ "features/chef_examples/knife_admin_client.feature",
41
+ "features/chef_examples/knife_client_create.feature",
37
42
  "features/chef_steps/common_steps.feature",
38
43
  "features/chef_steps/cookbook_steps.feature",
39
- "features/chef_steps/knife_admin_client.feature",
40
44
  "features/chef_steps/knife_steps.feature",
41
45
  "features/chef_steps/node_steps.feature",
42
46
  "features/command_examples/commands.feature",
@@ -394,11 +398,15 @@ Gem::Specification.new do |s|
394
398
  "features/step_definitions/cuken_steps.rb",
395
399
  "features/support/env.rb",
396
400
  "lib/cuken.rb",
401
+ "lib/cuken/all.rb",
397
402
  "lib/cuken/api/chef.rb",
398
403
  "lib/cuken/api/chef/common.rb",
404
+ "lib/cuken/api/chef/knife.rb",
399
405
  "lib/cuken/api/cmd.rb",
400
406
  "lib/cuken/api/common.rb",
401
407
  "lib/cuken/api/file.rb",
408
+ "lib/cuken/api/rvm.rb",
409
+ "lib/cuken/api/ssh-forever.rb",
402
410
  "lib/cuken/api/ssh.rb",
403
411
  "lib/cuken/api/ssh/password.rb",
404
412
  "lib/cuken/chef.rb",
@@ -408,6 +416,7 @@ Gem::Specification.new do |s|
408
416
  "lib/cuken/cucumber/chef/common.rb",
409
417
  "lib/cuken/cucumber/chef/cookbook.rb",
410
418
  "lib/cuken/cucumber/chef/cookbook_steps.rb",
419
+ "lib/cuken/cucumber/chef/data_bag.rb",
411
420
  "lib/cuken/cucumber/chef/deploy_steps.rb",
412
421
  "lib/cuken/cucumber/chef/done_directory_steps.rb",
413
422
  "lib/cuken/cucumber/chef/done_file_steps.rb",
@@ -431,19 +440,27 @@ Gem::Specification.new do |s|
431
440
  "lib/cuken/cucumber/cmd.rb",
432
441
  "lib/cuken/cucumber/common.rb",
433
442
  "lib/cuken/cucumber/file.rb",
443
+ "lib/cuken/cucumber/rvm.rb",
434
444
  "lib/cuken/cucumber/ssh.rb",
435
445
  "lib/cuken/file.rb",
446
+ "lib/cuken/rvm.rb",
436
447
  "lib/cuken/ssh.rb",
448
+ "spec/api/knife_spec.rb",
449
+ "spec/api/rvm_spec.rb",
450
+ "spec/api/rvmrc_processor_spec.rb",
437
451
  "spec/cuken_spec.rb",
438
452
  "spec/spec_helper.rb"
439
453
  ]
440
454
  s.homepage = %q{http://github.com/hedgehog/cuken}
441
455
  s.licenses = ["Apache 2.0"]
442
456
  s.require_paths = ["lib"]
443
- s.rubygems_version = %q{1.6.2}
457
+ s.rubygems_version = %q{1.7.2}
444
458
  s.summary = %q{Reusable Cucumber steps and API for post-convergence system integration descriptions}
445
459
  s.test_files = [
446
460
  "examples/chef/features/support/env.rb",
461
+ "spec/api/knife_spec.rb",
462
+ "spec/api/rvm_spec.rb",
463
+ "spec/api/rvmrc_processor_spec.rb",
447
464
  "spec/cuken_spec.rb",
448
465
  "spec/spec_helper.rb"
449
466
  ]
@@ -453,44 +470,50 @@ Gem::Specification.new do |s|
453
470
 
454
471
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
455
472
  s.add_runtime_dependency(%q<aruba>, ["~> 0.3.5"])
456
- s.add_runtime_dependency(%q<ssh-forever>, ["~> 0.4.0"])
457
473
  s.add_runtime_dependency(%q<chef>, ["~> 0.9.12"])
458
474
  s.add_runtime_dependency(%q<grit>, ["~> 2.4.1"])
475
+ s.add_runtime_dependency(%q<rvm>, ["~> 1.5.2"])
476
+ s.add_development_dependency(%q<rr>, ["~> 1.0.2"])
459
477
  s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
460
478
  s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
461
479
  s.add_development_dependency(%q<cucumber>, [">= 0"])
462
- s.add_development_dependency(%q<bundler>, ["~> 1.0.10"])
480
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.11"])
463
481
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
464
482
  s.add_development_dependency(%q<rcov>, [">= 0"])
465
483
  s.add_development_dependency(%q<reek>, ["~> 1.2.8"])
466
484
  s.add_development_dependency(%q<roodi>, ["~> 2.1.0"])
485
+ s.add_development_dependency(%q<fakefs>, ["~> 0.3.1"])
467
486
  else
468
487
  s.add_dependency(%q<aruba>, ["~> 0.3.5"])
469
- s.add_dependency(%q<ssh-forever>, ["~> 0.4.0"])
470
488
  s.add_dependency(%q<chef>, ["~> 0.9.12"])
471
489
  s.add_dependency(%q<grit>, ["~> 2.4.1"])
490
+ s.add_dependency(%q<rvm>, ["~> 1.5.2"])
491
+ s.add_dependency(%q<rr>, ["~> 1.0.2"])
472
492
  s.add_dependency(%q<rspec>, ["~> 2.5.0"])
473
493
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
474
494
  s.add_dependency(%q<cucumber>, [">= 0"])
475
- s.add_dependency(%q<bundler>, ["~> 1.0.10"])
495
+ s.add_dependency(%q<bundler>, ["~> 1.0.11"])
476
496
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
477
497
  s.add_dependency(%q<rcov>, [">= 0"])
478
498
  s.add_dependency(%q<reek>, ["~> 1.2.8"])
479
499
  s.add_dependency(%q<roodi>, ["~> 2.1.0"])
500
+ s.add_dependency(%q<fakefs>, ["~> 0.3.1"])
480
501
  end
481
502
  else
482
503
  s.add_dependency(%q<aruba>, ["~> 0.3.5"])
483
- s.add_dependency(%q<ssh-forever>, ["~> 0.4.0"])
484
504
  s.add_dependency(%q<chef>, ["~> 0.9.12"])
485
505
  s.add_dependency(%q<grit>, ["~> 2.4.1"])
506
+ s.add_dependency(%q<rvm>, ["~> 1.5.2"])
507
+ s.add_dependency(%q<rr>, ["~> 1.0.2"])
486
508
  s.add_dependency(%q<rspec>, ["~> 2.5.0"])
487
509
  s.add_dependency(%q<yard>, ["~> 0.6.0"])
488
510
  s.add_dependency(%q<cucumber>, [">= 0"])
489
- s.add_dependency(%q<bundler>, ["~> 1.0.10"])
511
+ s.add_dependency(%q<bundler>, ["~> 1.0.11"])
490
512
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
491
513
  s.add_dependency(%q<rcov>, [">= 0"])
492
514
  s.add_dependency(%q<reek>, ["~> 1.2.8"])
493
515
  s.add_dependency(%q<roodi>, ["~> 2.1.0"])
516
+ s.add_dependency(%q<fakefs>, ["~> 0.3.1"])
494
517
  end
495
518
  end
496
519
 
data/features/about.md CHANGED
@@ -7,6 +7,7 @@ largely uses Aruba's steps and API.
7
7
  Cucumber features where these steps might be useful have been variously described as:
8
8
  - Infrastructure integration tests
9
9
  - Post-convergence system integration
10
+ - Agile Systems Administration/ SysAdmin Testing
10
11
 
11
12
  Cuken grew out of refactoring the [Cucumber-Nagios][3] library.
12
13
  The example features are executable documentation for usage of Cuken.
@@ -16,6 +17,17 @@ The Chef steps assume you have Chef server accessible on `localhost:4040`.
16
17
  If you have ideas to clarify or improve any of these cucumber features,
17
18
  please submit an [issue][9] or [pull request][8].
18
19
 
20
+ ## The Chef JSON Issue
21
+ As of 0.9.12 thru Chef 0.10 beta (latest at the time of writing),
22
+ Chef restricts the JSON gem to versions >= 1.4.4
23
+ and <= 1.4.6. Vagrant requires the JSON gem be version >= 1.5.1.
24
+ Unitl Chef updates it JSON version or moves to somthing else, we
25
+ have to workaround this. This means compromise or introduce conditons.
26
+ Rather than compromise, I've chosen the condition that RVM be required,
27
+ and that you have a gemset named `vargant`, wiht just vagrant installed.
28
+ That's it.
29
+ Hopefully that wasn't too painful.
30
+
19
31
  ## Step contributions:
20
32
  - Ideally the API methods should be covered by RSpec (I've been slack
21
33
  on this simply because I'm trying to get over the initial backlog of
@@ -24,10 +36,10 @@ steps to port).
24
36
 
25
37
  ## Prior Art:
26
38
  - [Aruba][2] confirmed the utility of reusable steps.
27
- - [Auxesis' Cucumber-Nagios][4] served as launch pad.
39
+ - [Auxesis' Cucumber-Nagios][4] served as launch pad, and [had this idea early on][10].
28
40
  - [Chef][5] steps are being ported.
29
41
  - [Virtualbox][6] steps are planned to be ported.
30
- - [SSH-Forever][7] served as API-base for passwordless SSH steps.
42
+ - [SSH-Forever][7] serves as the API-base for passwordless SSH steps.
31
43
 
32
44
  [0]: https://github.com/aslakhellesoy/cucumber
33
45
  [1]: https://github.com/hedgehog/cuken
@@ -39,3 +51,4 @@ steps to port).
39
51
  [7]: https://github.com/mattwynne/ssh-forever
40
52
  [8]: http://help.github.com/pull-requests
41
53
  [9]: https://github.com/hedgehog/cuken/issues
54
+ [10]: http://groups.google.com/group/agile-system-administration/msg/4128b2de36ccf899
@@ -7,8 +7,43 @@ Feature: Cookbook Validity
7
7
  Background:
8
8
  Given a default base Chef repository in "ckbk/scratch/myapp"
9
9
 
10
- Scenario: Clone a cookbook repository
11
- And the remote Cookbook repository "features/data/repositories/cookbooks/hosts/.git"
10
+ Scenario: Clone from a Cookbook repository
11
+ Given the remote Cookbook repository "features/data/repositories/cookbooks/hosts/.git"
12
12
  When I clone the remote Cookbook repository branch "master" to "ckbk/scratch/myapp/cookbooks/hosts"
13
13
  Then the local Cookbook repository exists
14
- And the local cookbook "hosts" exists
14
+ And the local Cookbook "hosts" exists
15
+
16
+ Scenario: Clone a single Cookbook from a Cookbooks URI
17
+ Given the remote Cookbooks URI "git://github.com/cookbooks/"
18
+ When I clone the Cookbook "hosts" branch "master" to "ckbk/scratch/myapp/cookbooks/hosts2"
19
+ Then the local Cookbook repository exists
20
+ And the local Cookbook "hosts" exists
21
+
22
+ Scenario: Clone a single Site-Cookbook from a Cookbooks URI
23
+ Given the remote Cookbooks URI "git://github.com/cookbooks/"
24
+ When I clone the Cookbook "hosts" branch "master" to "ckbk/scratch/myapp/site-cookbooks/hosts2"
25
+ Then the local Site-Cookbook repository exists
26
+ And the local Site-Cookbook "hosts" exists
27
+
28
+ Scenario: Clone multiple Cookbooks from a Cookbooks URI
29
+ Given the remote Cookbooks URI "git://github.com/cookbooks/"
30
+ When I clone the Cookbooks:
31
+ |cookbook | branch | destination |
32
+ | hosts | master | ckbk/scratch/myapp/cookbooks/hosts3 |
33
+ | users | master | ckbk/scratch/myapp/cookbooks/users |
34
+ And these local Cookbooks exist:
35
+ |cookbook |
36
+ | hosts3 |
37
+ | users |
38
+
39
+ Scenario: Clone multiple Site-Cookbooks from a Cookbooks URI
40
+ Given the remote Cookbooks URI "git://github.com/cookbooks/"
41
+ When I clone the Cookbooks:
42
+ |cookbook | branch | destination |
43
+ | hosts | master | ckbk/scratch/myapp/site-cookbooks/hosts4 |
44
+ | users | master | ckbk/scratch/myapp/site-cookbooks/users2 |
45
+ And these local Site-Cookbooks exist:
46
+ |cookbook |
47
+ | hosts4 |
48
+ | users2 |
49
+
@@ -0,0 +1,10 @@
1
+ @announce @cookbooks @chef_repo
2
+ Feature: Clone remote Chef repository for cookbooks
3
+ In order to have a Chef skeleton to build a custom deployment
4
+ As an Administrator
5
+ I want to automatically clone a generic base Chef repository
6
+
7
+ Scenario: Clone a remote Chef skeleton repository
8
+ And the remote Chef repository "git://github.com/opscode/chef-repo.git"
9
+ When I clone the remote Chef repository branch "master" to "myapp"
10
+ Then the local Chef repository exists
@@ -1,5 +1,5 @@
1
- @announce @work_in_cwd @cookbooks @chef_repo
2
- Feature: Base Chef repository for cookbooks
1
+ @announce @cookbooks @chef_repo
2
+ Feature: Clone local Chef repository for cookbooks
3
3
  In order to have a Chef skeleton to build a custom deployment
4
4
  As an Administrator
5
5
  I want to automatically clone a generic base Chef repository
@@ -7,7 +7,7 @@ Feature: Base Chef repository for cookbooks
7
7
  Background:
8
8
  Given a directory named "ckbk/scratch"
9
9
 
10
- Scenario: Clone a Chef skeleton repository
11
- And the remote Chef repository "features/data/repositories/chef-repo/.git"
12
- When I clone the remote Chef repository branch "master" to "tmp/aruba/ckbk/scratch/myapp"
10
+ Scenario: Clone a local Chef skeleton repository
11
+ And the remote Chef repository "./../../features/data/repositories/chef-repo/.git"
12
+ When I clone the remote Chef repository branch "master" to "ckbk/scratch/myapp"
13
13
  Then the local Chef repository exists
@@ -14,9 +14,9 @@ Feature: Reusable Chef Knife steps
14
14
 
15
15
  Background:
16
16
  Given the Chef server URI "http://localhost:4000"
17
- And the Chef admin client "bobo-admin"
18
- Given a directory named "foo/bar"
19
- And a file named "foo/bar/bobo-admin.pem" with:
17
+ And the Chef admin client "bobo-admin" exists
18
+ And a directory named "foo/bar"
19
+ And a file named "foo/bar/bobo-admin.pem" with:
20
20
  """
21
21
  -----BEGIN RSA PRIVATE KEY-----
22
22
  MIIEogIBAAKCAQEA2iu6ETTD3Ig/0dlbbQSPsVcSUGQ3O3Kgt+6h6OwD1HnQUHge
@@ -63,7 +63,7 @@ Feature: Reusable Chef Knife steps
63
63
  Scenario: Knife steps default knife.rb path
64
64
  Given I cd to "foo/bar"
65
65
  When I successfully run `knife node list`
66
- When the output should contain:
66
+ Then the output should contain:
67
67
  """
68
68
  DEBUG: Signing the request as bobo-admin
69
69
  DEBUG: Sending HTTP Request via GET to localhost:4000/nodes
@@ -0,0 +1,13 @@
1
+ #
2
+ # NOTE: This is an example of Cuken usage. Assuming:
3
+ # - A Chef server on localhost:4000 (point to yours)
4
+ # - An admin client named bobo exists on that Chef server
5
+ #
6
+ # If you wish to mock a Chef server, see the Chef project's
7
+ # features setup.
8
+ #
9
+ @announce @knife
10
+ Background:
11
+ Given the Chef server URI "http://localhost:4000"
12
+ And the Chef admin client "bobo-admin" exists
13
+ And a directory named "foo/bar"
@@ -13,8 +13,8 @@ Feature: Listing common steps
13
13
  |a default base Chef repository in "([^"]*)" |
14
14
  |I clone the remote Chef repository branch "([^"]*)" to "([^"]*)" |
15
15
  |the Chef server URI "([^"]*)" |
16
- |the Chef client "([^"]*)" |
17
- |the Chef admin client "([^"]*)" |
16
+ |the Chef client "([^"]*)" exists |
17
+ |the Chef admin client "([^"]*)" exists |
18
18
  |the Chef client private key path "([^"]*)" |
19
19
 
20
20
  Scenario: Local and remote Chef repository commands
@@ -11,14 +11,21 @@ Feature: Listing Cookbook steps
11
11
  Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
12
12
  | step |
13
13
  |a cookbook path "([^"]*)" |
14
- |I clone the remote Cookbook repository branch "([^"]*)" to "([^"]*)" |
14
+ |a cookbooks path "([^"]*)" |
15
15
  |I successfully generate all cookbook metadata |
16
16
  |I successfully generate cookbook "([^"]*)" metadata |
17
17
  |the local cookbook "([^"]*)" exists |
18
18
 
19
19
  Scenario: Local and remote Cookbook repository commands
20
20
  Then these steps are defined for "cuken/cucumber/chef/cookbook.rb":
21
- | step |
22
- |the local Cookbook repository "([^"]*)" |
23
- |the local Cookbook repository exists |
24
- |the remote Cookbook repository "([^"]*)" |
21
+ | step |
22
+ |I clone the Cookbooks: |
23
+ |I clone the Cookbook "([^"]*)" branch "([^"]*)" to "([^"]*)" |
24
+ |I clone the remote Cookbook repository branch "([^"]*)" to "([^"]*)" |
25
+ |the local Cookbook repository "([^"]*)" |
26
+ |the local Cookbook repository exists |
27
+ |the remote Cookbook repository "([^"]*)" |
28
+ |the remote Cookbooks URI "([^"]*)" |
29
+ |these local Cookbooks exist: |
30
+ |these local Site-Cookbooks exist: |
31
+
@@ -11,4 +11,4 @@ Feature: Listing Node steps
11
11
  Then these steps are defined for "cuken/cucumber/chef/node.rb":
12
12
  | step |
13
13
  |a validated node |
14
- |the nodes are: |
14
+ |the Chef nodes are: |
@@ -15,13 +15,12 @@ Feature: Listing file steps
15
15
  Scenario: File and directory existence
16
16
  Then these steps are defined for "cuken/cucumber/file.rb":
17
17
  | step |
18
- |a directory named "([^"]*)" |
19
18
  |I remove the file "([^"]*)" |
19
+ |the directory "([^"]*)" |
20
20
  |the directory "([^"]*)" exists |
21
21
  |the directory "([^"]*)" does not exist |
22
22
  |the file "([^"]*)" exists |
23
23
  |the file "([^"]*)" does not exist |
24
- |the file "([^"]*)" should not exist |
25
24
  |these files exist: |
26
25
  |these files do not exist: |
27
26
  |these directories exist: |
@@ -42,17 +41,18 @@ Feature: Listing file steps
42
41
  Scenario: File and directory content
43
42
  Then these steps are defined for "cuken/cucumber/file.rb":
44
43
  | step |
45
- |the file "([^"]*)" with: |
46
- |the empty file "([^"]*)" |
44
+ |the file "([^"]*)" contains: |
47
45
  |the file "([^"]*)" contains "([^"]*)" |
48
- |the file "([^"]*)" contains \/([^\/]*)\/ |
49
- |the file "([^"]*)" contains exactly: |
50
46
  |the file "([^"]*)" contains "([^"]*)" exactly "(\d+)" times |
47
+ |the file "([^"]*)" contains \/([^\/]*)\/ |
48
+ |the file "([^"]*)" contains exactly: |
49
+ |the file "([^"]*)" contains nothing |
51
50
  |the file "([^"]*)" does not contain "([^"]*)" |
52
- |the file "([^"]*)" does not contain \/([^\/]*)\/ |
53
- |the file "([^"]*)" does not contain exactly: |
54
51
  |the file "([^"]*)" does not contain "([^"]*)" exactly "(\d+)" times |
55
- |I write to "([^"]*)" with: |
56
- |I overwrite "([^"]*)" with: |
57
- |I append to "([^"]*)" with: |
52
+ |the file "([^"]*)" does not contain \/([^\/]*)\/ |
53
+ |the file "([^"]*)" does not contain exactly: |
54
+ |the file "([^"]*)" does not contain nothing |
55
+ |I write to "([^"]*)": |
56
+ |I overwrite "([^"]*)": |
57
+ |I append to "([^"]*)": |
58
58
 
data/lib/cuken/all.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'cuken/cmd'
2
+ require 'cuken/file'
3
+ require 'cuken/ssh'
4
+ require 'cuken/chef'