cuken 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +8 -8
  3. data/VERSION +1 -1
  4. data/cuken.gemspec +19 -5
  5. data/features/about.md +110 -27
  6. data/features/chef_examples/cookbooks_cookbook.feature +2 -2
  7. data/features/chef_examples/zenoss/01_chef_server_setup.feature +205 -0
  8. data/features/chef_examples/zenoss/02_monitor_vm_setup.feature +139 -0
  9. data/features/chef_examples/zenoss/03_monitor_chef_setup.feature +109 -0
  10. data/features/step_definitions/cuken_steps.rb +16 -0
  11. data/features/support/env.rb +1 -0
  12. data/lib/cuken/api/chef/common.rb +20 -0
  13. data/lib/cuken/api/chef/cookbook.rb +62 -1
  14. data/lib/cuken/api/chef/data_bag.rb +89 -0
  15. data/lib/cuken/api/chef/knife.rb +16 -0
  16. data/lib/cuken/api/chef/role.rb +71 -0
  17. data/lib/cuken/api/chef.rb +51 -9
  18. data/lib/cuken/api/file.rb +68 -0
  19. data/lib/cuken/api/vagrant/common.rb +85 -0
  20. data/lib/cuken/api/vagrant/v_m.rb +125 -0
  21. data/lib/cuken/api/vagrant.rb +83 -0
  22. data/lib/cuken/chef.rb +16 -0
  23. data/lib/cuken/cucumber/chef/common.rb +4 -0
  24. data/lib/cuken/cucumber/chef/cookbook.rb +16 -2
  25. data/lib/cuken/cucumber/chef/data_bag.rb +48 -16
  26. data/lib/cuken/cucumber/chef/role.rb +30 -0
  27. data/lib/cuken/cucumber/chef.rb +16 -5
  28. data/lib/cuken/cucumber/cmd.rb +16 -0
  29. data/lib/cuken/cucumber/common.rb +16 -0
  30. data/lib/cuken/cucumber/file.rb +52 -0
  31. data/lib/cuken/cucumber/git/hooks.rb +28 -0
  32. data/lib/cuken/cucumber/rvm.rb +16 -0
  33. data/lib/cuken/cucumber/ssh/hooks.rb +31 -0
  34. data/lib/cuken/cucumber/ssh.rb +16 -0
  35. data/lib/cuken/cucumber/vagrant/common.rb +93 -0
  36. data/lib/cuken/cucumber/vagrant/hooks.rb +35 -0
  37. data/lib/cuken/cucumber/vagrant.rb +26 -0
  38. data/lib/cuken/vagrant.rb +19 -0
  39. metadata +18 -4
@@ -0,0 +1,28 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ Before('@git_quick') do
18
+ ::Grit::Git.git_timeout = 20
19
+ end
20
+ Before('@git_slow') do
21
+ ::Grit::Git.git_timeout = 60
22
+ end
23
+ Before('@git_glacial') do
24
+ ::Grit::Git.git_timeout = 600
25
+ end
26
+ Before('@git_cosmic') do
27
+ ::Grit::Git.git_timeout = 3600
28
+ end
@@ -1,3 +1,19 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
1
17
  load 'aruba/cucumber.rb' unless defined? ::Aruba
2
18
 
3
19
  World(::Cuken::Api::Rvm)
@@ -0,0 +1,31 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ Before('@ssh_local') do
18
+ @aruba_io_wait_seconds.nil? || @aruba_io_wait_seconds < 0.3 ? @aruba_io_wait_seconds = 0.3 : @aruba_io_wait_seconds
19
+ end
20
+
21
+ Before('@ssh_remote') do
22
+ @aruba_io_wait_seconds.nil? || @aruba_io_wait_seconds < 1 ? @aruba_io_wait_seconds = 1 : @aruba_io_wait_seconds
23
+ end
24
+
25
+ Before('@ssh_pigeon') do
26
+ @aruba_io_wait_seconds.nil? || @aruba_io_wait_seconds < 3 ? @aruba_io_wait_seconds = 3 : @aruba_io_wait_seconds
27
+ end
28
+
29
+ Before('@ssh_dodo') do
30
+ @aruba_io_wait_seconds.nil? || @aruba_io_wait_seconds < 10 ? @aruba_io_wait_seconds = 10 : @aruba_io_wait_seconds
31
+ end
@@ -1,3 +1,19 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
1
17
  load 'aruba/cucumber.rb' unless defined? ::Aruba
2
18
 
3
19
  World(::Cuken::Api::Ssh)
@@ -0,0 +1,93 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ World(::Cuken::Api::Vagrant)
18
+
19
+ ########################################################################################################################
20
+ #
21
+ # Generic (Given, When or Then)
22
+ #
23
+ ########################################################################################################################
24
+
25
+ ########################################################################################################################
26
+ #
27
+ # Given
28
+ #
29
+ ########################################################################################################################
30
+
31
+ ########################################################################################################################
32
+ #
33
+ # When
34
+ #
35
+ ########################################################################################################################
36
+
37
+ ########################################################################################################################
38
+ #
39
+ # Then
40
+ #
41
+ ########################################################################################################################
42
+
43
+ And /^I switch Vagrant environment$/ do
44
+ switch_vagrant_environment
45
+ end
46
+
47
+ And /^the state of VM "([^"]*)" is "([^"]*)"$/ do |name, state|
48
+ check_vm_state(name, state.to_sym)
49
+ end
50
+
51
+ And /^the state of VM "([^"]*)" is not "([^"]*)"$/ do |name, state|
52
+ check_vm_state(name, state.to_sym, false)
53
+ end
54
+
55
+ When /^I ssh to VM "([^\"]*)"$/ do |boxname|
56
+ establish_vm_interactive_ssh(boxname)
57
+ end
58
+
59
+ And /^the Vagrantfile "([^\"]*)" exists$/ do |path|
60
+ check_vagrant_file_presence(path)
61
+ end
62
+
63
+ And /^the Vagrantfile "([^\"]*)" does not exist$/ do |path|
64
+ check_vagrant_file_presence(path, false)
65
+ end
66
+
67
+ When /^I launch the VM "([^"]*)"$/ do |vm_name|
68
+ run_vm_manager_command(:up, vm_name)
69
+ end
70
+
71
+ When /^I halt the VM "([^"]*)"$/ do |vm_name|
72
+ run_vm_manager_command(:halt, vm_name)
73
+ end
74
+
75
+ When /^I destroy the VM "([^"]*)"$/ do |vm_name|
76
+ run_vm_manager_command(:destroy, vm_name)
77
+ end
78
+
79
+ When /^I provision the VM "([^"]*)"$/ do |vm_name|
80
+ run_vm_manager_command(:provision, vm_name)
81
+ end
82
+
83
+ When /^I suspend the VM "([^"]*)"$/ do |vm_name|
84
+ run_vm_manager_command(:suspend, vm_name)
85
+ end
86
+
87
+ When /^I resume the VM "([^"]*)"$/ do |vm_name|
88
+ run_vm_manager_command(:resume, vm_name)
89
+ end
90
+
91
+ When /^I reload the VM "([^"]*)"$/ do |vm_name|
92
+ run_vm_manager_command(:reload, vm_name)
93
+ end
@@ -0,0 +1,35 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ Before('@fast') do
19
+ @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 6 ? @aruba_timeout_seconds = 6 : @aruba_timeout_seconds
20
+ end
21
+ Before('@quick') do
22
+ @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 20 ? @aruba_timeout_seconds = 20 : @aruba_timeout_seconds
23
+ end
24
+ Before('@slow') do
25
+ @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 60 ? @aruba_timeout_seconds = 60 : @aruba_timeout_seconds
26
+ end
27
+ Before('@glacial') do
28
+ @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 600 ? @aruba_timeout_seconds = 600 : @aruba_timeout_seconds
29
+ end
30
+ # Some VM builds can take a while, depending on package repository speeds etc.
31
+ # Note:
32
+ # In a genuine disaster scenario you are more likely to, eventually, trying throwing this at the top of a feature file :(
33
+ Before('@cosmic') do
34
+ @aruba_timeout_seconds.nil? || @aruba_timeout_seconds < 3600 ? @aruba_timeout_seconds = 3600 : @aruba_timeout_seconds
35
+ end
@@ -0,0 +1,26 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ load 'aruba/cucumber.rb' unless defined? ::Aruba
18
+ require 'grit'
19
+
20
+ World(::Cuken::Api::Vagrant)
21
+
22
+ require 'cuken/cucumber/git/hooks'
23
+ require 'cuken/cucumber/ssh/hooks'
24
+
25
+ require 'cuken/cucumber/vagrant/hooks'
26
+ require 'cuken/cucumber/vagrant/common'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Author:: Hedgehog (<hedgehogshiatus@gmail.com>)
3
+ # Copyright:: Copyright (c) 2011 Hedgehog.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+ require 'cuken/common'
18
+ require 'cuken/api/vagrant'
19
+ require 'cuken/cucumber/vagrant'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cuken
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.11
5
+ version: 0.1.12
6
6
  platform: ruby
7
7
  authors:
8
8
  - Hedgehog
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-02 00:00:00 Z
13
+ date: 2011-05-03 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aruba
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - ~>
43
43
  - !ruby/object:Gem::Version
44
- version: 0.10.0.rc.0
44
+ version: 0.10.0
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: *id003
@@ -231,6 +231,9 @@ files:
231
231
  - features/chef_examples/cookbooks_repo.feature
232
232
  - features/chef_examples/knife_admin_client.feature
233
233
  - features/chef_examples/knife_client_create.feature
234
+ - features/chef_examples/zenoss/01_chef_server_setup.feature
235
+ - features/chef_examples/zenoss/02_monitor_vm_setup.feature
236
+ - features/chef_examples/zenoss/03_monitor_chef_setup.feature
234
237
  - features/chef_steps/common_steps.feature
235
238
  - features/chef_steps/cookbook_steps.feature
236
239
  - features/chef_steps/knife_steps.feature
@@ -594,7 +597,9 @@ files:
594
597
  - lib/cuken/api/chef.rb
595
598
  - lib/cuken/api/chef/common.rb
596
599
  - lib/cuken/api/chef/cookbook.rb
600
+ - lib/cuken/api/chef/data_bag.rb
597
601
  - lib/cuken/api/chef/knife.rb
602
+ - lib/cuken/api/chef/role.rb
598
603
  - lib/cuken/api/cmd.rb
599
604
  - lib/cuken/api/common.rb
600
605
  - lib/cuken/api/file.rb
@@ -602,6 +607,9 @@ files:
602
607
  - lib/cuken/api/ssh-forever.rb
603
608
  - lib/cuken/api/ssh.rb
604
609
  - lib/cuken/api/ssh/password.rb
610
+ - lib/cuken/api/vagrant.rb
611
+ - lib/cuken/api/vagrant/common.rb
612
+ - lib/cuken/api/vagrant/v_m.rb
605
613
  - lib/cuken/chef.rb
606
614
  - lib/cuken/cmd.rb
607
615
  - lib/cuken/common.rb
@@ -633,11 +641,17 @@ files:
633
641
  - lib/cuken/cucumber/cmd.rb
634
642
  - lib/cuken/cucumber/common.rb
635
643
  - lib/cuken/cucumber/file.rb
644
+ - lib/cuken/cucumber/git/hooks.rb
636
645
  - lib/cuken/cucumber/rvm.rb
637
646
  - lib/cuken/cucumber/ssh.rb
647
+ - lib/cuken/cucumber/ssh/hooks.rb
648
+ - lib/cuken/cucumber/vagrant.rb
649
+ - lib/cuken/cucumber/vagrant/common.rb
650
+ - lib/cuken/cucumber/vagrant/hooks.rb
638
651
  - lib/cuken/file.rb
639
652
  - lib/cuken/rvm.rb
640
653
  - lib/cuken/ssh.rb
654
+ - lib/cuken/vagrant.rb
641
655
  - spec/api/knife_spec.rb
642
656
  - spec/api/rvm_spec.rb
643
657
  - spec/api/rvmrc_processor_spec.rb
@@ -656,7 +670,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
656
670
  requirements:
657
671
  - - ">="
658
672
  - !ruby/object:Gem::Version
659
- hash: 1919764971976983115
673
+ hash: 782328980720716796
660
674
  segments:
661
675
  - 0
662
676
  version: "0"