cloudstack_spec 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +13 -0
  5. data/README.md +127 -0
  6. data/Rakefile +2 -0
  7. data/bin/cloudstackspec-init +7 -0
  8. data/cloudstack_spec.gemspec +29 -0
  9. data/examples/output_example.txt +56 -0
  10. data/lib/cloudstack_spec.rb +56 -0
  11. data/lib/cloudstack_spec/helper.rb +9 -0
  12. data/lib/cloudstack_spec/helper/api.rb +40 -0
  13. data/lib/cloudstack_spec/helper/resource.rb +19 -0
  14. data/lib/cloudstack_spec/matcher.rb +12 -0
  15. data/lib/cloudstack_spec/matcher/be_allocated.rb +23 -0
  16. data/lib/cloudstack_spec/matcher/be_created.rb +30 -0
  17. data/lib/cloudstack_spec/matcher/be_ready.rb +17 -0
  18. data/lib/cloudstack_spec/matcher/be_running.rb +17 -0
  19. data/lib/cloudstack_spec/matcher/be_set.rb +18 -0
  20. data/lib/cloudstack_spec/resource.rb +1 -0
  21. data/lib/cloudstack_spec/resource/account.rb +102 -0
  22. data/lib/cloudstack_spec/resource/base.rb +58 -0
  23. data/lib/cloudstack_spec/resource/domain.rb +71 -0
  24. data/lib/cloudstack_spec/resource/network.rb +90 -0
  25. data/lib/cloudstack_spec/resource/project.rb +66 -0
  26. data/lib/cloudstack_spec/resource/snapshot.rb +53 -0
  27. data/lib/cloudstack_spec/resource/system_vm.rb +55 -0
  28. data/lib/cloudstack_spec/resource/template.rb +41 -0
  29. data/lib/cloudstack_spec/resource/template_from_snapshot.rb +73 -0
  30. data/lib/cloudstack_spec/resource/virtual_machine.rb +245 -0
  31. data/lib/cloudstack_spec/resource/vpc.rb +139 -0
  32. data/lib/cloudstack_spec/resource/vpc_tier.rb +81 -0
  33. data/lib/cloudstack_spec/resource/zone.rb +51 -0
  34. data/lib/cloudstack_spec/setup.rb +191 -0
  35. data/lib/cloudstack_spec/version.rb +3 -0
  36. data/spec/config.yml +5 -0
  37. data/spec/lib/1_zone_spec.rb +18 -0
  38. data/spec/lib/domain_spec.rb +20 -0
  39. data/spec/lib/network_spec.rb +45 -0
  40. data/spec/lib/snapshot_spec.rb +41 -0
  41. data/spec/lib/template_spec.rb +11 -0
  42. data/spec/lib/virtual_machine_spec.rb +17 -0
  43. data/spec/lib/vpc_spec.rb +40 -0
  44. data/spec/preprod/001_zone_spec.rb +65 -0
  45. data/spec/preprod/010_domain_spec.rb +18 -0
  46. data/spec/preprod/snapshot_spec.rb +27 -0
  47. data/spec/spec_helper.rb +31 -0
  48. metadata +207 -0
@@ -0,0 +1,3 @@
1
+ module CloudstackSpec
2
+ VERSION = "0.0.4"
3
+ end
@@ -0,0 +1,5 @@
1
+ cloudstack:
2
+ url: http://<ip>:8080/client/api
3
+ api_key:
4
+ secret_key:
5
+ use_ssl: false
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe zone do
4
+ it { should exist }
5
+ it { should be_allocated }
6
+ its(:local_storage) { should be_set }
7
+ its(:security_group) { should_not be_set }
8
+ its(:network_type) { should match("Advanced") }
9
+ end
10
+
11
+ %w(consoleproxy secondarystoragevm).each do |svm|
12
+ describe system_vm(svm) do
13
+ it { should exist }
14
+ it { should be_running }
15
+ it { should be_reachable }
16
+ end
17
+ end
18
+
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe domain("test44") do
4
+ it { should be_created }
5
+ it { should exist }
6
+ # it { should be_destroy }
7
+
8
+ describe account('joeblow') do
9
+ it { should be_created }
10
+ it { should exist }
11
+ its(:registerUserKeys) { should be_set }
12
+ end
13
+
14
+ describe project('x') do
15
+ it { should be_created }
16
+ it { should exist }
17
+ end
18
+
19
+ end
20
+
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+
3
+ describe network("priv_net1") do
4
+ it { should exist }
5
+ it { should be_ready }
6
+ end
7
+
8
+
9
+
10
+ # describe vpc('patate') do
11
+ #
12
+ # it { should exist }
13
+ # it { should be_ready }
14
+ # it { should be_reachable }
15
+ # # its(:enable_remote_vpn) { should be_set }
16
+ # # its(:remote_vpn_enabled?) { should be }
17
+ # its(:open_pf_ssh) { should be_set }
18
+ #
19
+ # describe network('tier41') do
20
+ # subject do
21
+ # network = CloudstackSpec::Resource::Network.new('tier41')
22
+ # network.vpcname << 'patate'
23
+ # network
24
+ # end
25
+ # it { should exist }
26
+ # end
27
+ #
28
+ # end
29
+
30
+ # describe network('tier41') do
31
+ # it { should exist }
32
+ # end
33
+
34
+
35
+
36
+ #describe network('tier41', 'patate') do
37
+ # let(:network) { network.vpcname << 'patate'}
38
+ # it { should exist }
39
+ #end
40
+ #describe vpc('test4') do
41
+ # it { should be_created }
42
+ # it { should be_ready }
43
+ # it { should be_reachable }
44
+
45
+ #end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+
4
+ describe vpc('spec-vpc2') do
5
+ it { should be_created }
6
+ it { should exist }
7
+ it { should be_reachable }
8
+
9
+ describe vpc_tier('tier2') do
10
+ it { should be_created }
11
+ it { should exist }
12
+ end
13
+
14
+ describe virtual_machine('test-vm1') do
15
+ it { should be_created }
16
+ it { should exist }
17
+ it { should be_running }
18
+ describe snapshot do
19
+ it { should be_created }
20
+ it { should exist }
21
+ end
22
+ end
23
+
24
+ end
25
+
26
+ describe template_from_snapshot('test-vm1') do
27
+ it { should be_created }
28
+ end
29
+
30
+ describe virtual_machine('bling-bling2') do
31
+ subject do
32
+ vm_from_template = CloudstackSpec::Resource::VirtualMachine.new('bling-bling2')
33
+ vm_from_template.template_name << 'test-vm1'
34
+ vm_from_template
35
+ end
36
+ it { should be_created }
37
+ end
38
+
39
+
40
+
41
+
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe template("CentOS 5.6(64-bit) no GUI (XenServer)") do
4
+ it { should exist }
5
+ it { should be_ready }
6
+ end
7
+
8
+ describe template('Ubuntu 14.04 LTS') do
9
+ it { should exist }
10
+ it { should be_ready }
11
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+ # require 'pry'
3
+ #
4
+ # describe zone do
5
+ # it { should exist }
6
+ # it { should be_allocated }
7
+ # its(:local_storage) { should be_set }
8
+ # its(:security_group) { should_not be_set }
9
+ # its(:network_type) { should match("Advanced") }
10
+ # end
11
+
12
+ describe virtual_machine('bling-bling1') do
13
+ it { should be_created }
14
+ it { should be_running }
15
+ it { should_not be_reachable }
16
+ # it { should be_destroy }
17
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe vpc('spec-vpc1') do
4
+ it { should be_created }
5
+ it { should exist }
6
+ it { should be_ready }
7
+ it { should be_reachable }
8
+ its(:enable_remote_vpn) { should be_set }
9
+ its(:remote_vpn_enabled?) { should be }
10
+
11
+ describe vpc_tier('tier11') do
12
+ it { should be_created }
13
+ it { should exist }
14
+
15
+ describe virtual_machine('vm-test1') do
16
+ it { should be_created }
17
+ it { should_not be_reachable } # internal IP of the VM should not be reachable
18
+ it { should exist }
19
+ it { should be_running }
20
+ its(:open_pf_ssh) { should be_set }
21
+ context 'With port forwarding' do
22
+ it { should be_reachable.with( :port => 22, :proto => 'tcp' ) }
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+
29
+ # Delete everything
30
+ describe virtual_machine('bling-bling1') do
31
+ it { should be_destroy }
32
+ end
33
+
34
+ describe vpc_tier('tier11') do
35
+ it { should be_destroy }
36
+ end
37
+
38
+ describe vpc('spec-vpc1') do
39
+ it { should be_destroy }
40
+ end
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+
3
+ describe zone do
4
+ it { should exist }
5
+ it { should be_allocated }
6
+ its(:local_storage) { should be_set }
7
+ its(:security_group) { should_not be_set }
8
+ its(:network_type) { should match("Advanced") }
9
+ end
10
+
11
+ %w(consoleproxy secondarystoragevm).each do |svm|
12
+ describe system_vm(svm) do
13
+ it { should exist }
14
+ it { should be_running }
15
+ it { should be_reachable }
16
+ end
17
+ end
18
+
19
+ describe template('CentOS 6.6 base (64bit)') do
20
+ it { should exist }
21
+ it { should be_ready }
22
+ end
23
+
24
+ describe vpc('spec-vpc1') do
25
+ it { should be_created }
26
+ it { should exist }
27
+ it { should be_ready }
28
+ it { should be_reachable }
29
+ its(:enable_remote_vpn) { should be_set }
30
+ its(:remote_vpn_enabled?) { should be }
31
+
32
+ describe vpc_tier('tier11') do
33
+ it { should be_created }
34
+ it { should exist }
35
+ end
36
+
37
+ describe virtual_machine('bling-bling1') do
38
+ it { should be_created }
39
+ it { should exist }
40
+ # describe snapshot do
41
+ # it { should be_created }
42
+ # it { should exist }
43
+ # end
44
+ it { should be_running }
45
+ its(:open_pf_ssh) { should be_set }
46
+ end
47
+
48
+ end
49
+
50
+ #describe template_from_snapshot('bling-bling1') do
51
+ # it { should be_created }
52
+ #end
53
+
54
+ #describe virtual_machine('bling-bling2') do
55
+ # subject do
56
+ # vm_from_template = CloudstackSpec::Resource::VirtualMachine.new('bling-bling2')
57
+ # vm_from_template.template_name << 'bling-bling1'
58
+ # vm_from_template
59
+ # end
60
+ # it { should be_created }
61
+ #end
62
+
63
+
64
+
65
+
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe domain("domainX") do
4
+ it { should be_created }
5
+ it { should exist }
6
+ # it { should be_destroy }
7
+
8
+ describe account('joeblow') do
9
+ it { should be_created }
10
+ it { should exist }
11
+ its(:registerUserKeys) { should be_set }
12
+ end
13
+
14
+ describe project('projectX') do
15
+ it { should be_created }
16
+ it { should exist }
17
+ end
18
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ # describe virtual_machine('bling-bling3') do
4
+ # it { should be_created }
5
+ # it { should exist }
6
+ # describe snapshot do
7
+ # it { should be_created }
8
+ # it { should exist }
9
+ # end
10
+ # it { should be_running }
11
+ # #its(:open_pf_ssh) { should be_set }
12
+ # end
13
+
14
+
15
+
16
+ describe template_from_snapshot('bling-bling3') do
17
+ it { should be_created }
18
+ end
19
+
20
+ describe virtual_machine('bling-bling4') do
21
+ subject do
22
+ vm_from_template = CloudstackSpec::Resource::VirtualMachine.new('bling-bling4')
23
+ vm_from_template.template_name << 'bling-bling3'
24
+ vm_from_template
25
+ end
26
+ it { should be_created }
27
+ end
@@ -0,0 +1,31 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ require 'yaml'
8
+ require 'cloudstack_ruby_client'
9
+ require 'uuid'
10
+ require 'cloudstack_spec'
11
+ require 'rspec/expectations'
12
+
13
+ require 'serverspec'
14
+ #require 'specinfra'
15
+ set :backend, :exec
16
+
17
+
18
+
19
+ RSpec.configure do |config|
20
+ config.run_all_when_everything_filtered = true
21
+ # config.filter_run :focus
22
+
23
+ # Run specs in random order to surface order dependencies. If you find an
24
+ # order dependency and want to debug it, you can fix the order by providing
25
+ # the seed, which is printed after each run.
26
+ # --seed 1234
27
+ config.order = 'defined'
28
+ config.formatter = 'documentation'
29
+ config.color = true
30
+ end
31
+
metadata ADDED
@@ -0,0 +1,207 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cloudstack_spec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Pierre-Luc Dion
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yaml
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-its
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: uuid
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: cloudstack_ruby_client
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.0'
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 1.0.2
107
+ type: :runtime
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '1.0'
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 1.0.2
117
+ description: Servespec like tests for Apache CloudStack using Rspec.
118
+ email:
119
+ - pdion891@apache.org
120
+ executables:
121
+ - cloudstackspec-init
122
+ extensions: []
123
+ extra_rdoc_files: []
124
+ files:
125
+ - ".gitignore"
126
+ - Gemfile
127
+ - LICENSE.txt
128
+ - README.md
129
+ - Rakefile
130
+ - bin/cloudstackspec-init
131
+ - cloudstack_spec.gemspec
132
+ - examples/output_example.txt
133
+ - lib/cloudstack_spec.rb
134
+ - lib/cloudstack_spec/helper.rb
135
+ - lib/cloudstack_spec/helper/api.rb
136
+ - lib/cloudstack_spec/helper/resource.rb
137
+ - lib/cloudstack_spec/matcher.rb
138
+ - lib/cloudstack_spec/matcher/be_allocated.rb
139
+ - lib/cloudstack_spec/matcher/be_created.rb
140
+ - lib/cloudstack_spec/matcher/be_ready.rb
141
+ - lib/cloudstack_spec/matcher/be_running.rb
142
+ - lib/cloudstack_spec/matcher/be_set.rb
143
+ - lib/cloudstack_spec/resource.rb
144
+ - lib/cloudstack_spec/resource/account.rb
145
+ - lib/cloudstack_spec/resource/base.rb
146
+ - lib/cloudstack_spec/resource/domain.rb
147
+ - lib/cloudstack_spec/resource/network.rb
148
+ - lib/cloudstack_spec/resource/project.rb
149
+ - lib/cloudstack_spec/resource/snapshot.rb
150
+ - lib/cloudstack_spec/resource/system_vm.rb
151
+ - lib/cloudstack_spec/resource/template.rb
152
+ - lib/cloudstack_spec/resource/template_from_snapshot.rb
153
+ - lib/cloudstack_spec/resource/virtual_machine.rb
154
+ - lib/cloudstack_spec/resource/vpc.rb
155
+ - lib/cloudstack_spec/resource/vpc_tier.rb
156
+ - lib/cloudstack_spec/resource/zone.rb
157
+ - lib/cloudstack_spec/setup.rb
158
+ - lib/cloudstack_spec/version.rb
159
+ - spec/config.yml
160
+ - spec/lib/1_zone_spec.rb
161
+ - spec/lib/domain_spec.rb
162
+ - spec/lib/network_spec.rb
163
+ - spec/lib/snapshot_spec.rb
164
+ - spec/lib/template_spec.rb
165
+ - spec/lib/virtual_machine_spec.rb
166
+ - spec/lib/vpc_spec.rb
167
+ - spec/preprod/001_zone_spec.rb
168
+ - spec/preprod/010_domain_spec.rb
169
+ - spec/preprod/snapshot_spec.rb
170
+ - spec/spec_helper.rb
171
+ homepage: https://github.com/pdion891/cloudstack_spec
172
+ licenses:
173
+ - Apache 2.0
174
+ metadata: {}
175
+ post_install_message:
176
+ rdoc_options: []
177
+ require_paths:
178
+ - lib
179
+ required_ruby_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ required_rubygems_version: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ requirements: []
190
+ rubyforge_project:
191
+ rubygems_version: 2.4.5
192
+ signing_key:
193
+ specification_version: 4
194
+ summary: RSpec tests for Apache CloudStack.
195
+ test_files:
196
+ - spec/config.yml
197
+ - spec/lib/1_zone_spec.rb
198
+ - spec/lib/domain_spec.rb
199
+ - spec/lib/network_spec.rb
200
+ - spec/lib/snapshot_spec.rb
201
+ - spec/lib/template_spec.rb
202
+ - spec/lib/virtual_machine_spec.rb
203
+ - spec/lib/vpc_spec.rb
204
+ - spec/preprod/001_zone_spec.rb
205
+ - spec/preprod/010_domain_spec.rb
206
+ - spec/preprod/snapshot_spec.rb
207
+ - spec/spec_helper.rb