kitchen-rackspace 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.travis.yml +1 -2
- data/CHANGELOG.md +12 -0
- data/Gemfile +2 -2
- data/Rakefile +7 -10
- data/data/images.json +46 -13
- data/kitchen-rackspace.gemspec +3 -4
- data/lib/kitchen/driver/rackspace.rb +20 -20
- data/lib/kitchen/driver/rackspace_version.rb +5 -5
- data/spec/kitchen/driver/rackspace_spec.rb +52 -52
- data/spec/spec_helper.rb +1 -3
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDhiYjVjYjhmZWUwYjExZTM0MDYxZjczZWU5OWRjNWI2MjQ0ZDJjYg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 60ca9ba10b0323e9e2221039cafb71ffc9f2fea7
|
4
|
+
data.tar.gz: db8228a2b5e8bf2810135c0aca3c7284f8073a2e
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YzdjYWI1YzI4MTRkZjQ5Mjk1ZDM1NGZiODAwODMwYjMzYjcxZDRhODk2ODRi
|
11
|
-
ZDBlMjkxMDAxNDdkYTI2MWIzYmJmMmFhYTJlODJhZWNjNWIzZjU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NDc5YTMzNGUyNDg4YTQyZWUyMjBlOGE3MmQxOTM1NWUzZTE1NDI2ZjZiNmFh
|
14
|
-
MWRhYmFkMzA5YjE5ZGIwMWJhZGIxOGU5YWI2MDUxOWE0MTg4ZTdiZDM5YzQ1
|
15
|
-
MzQxZTRhZWFhODgwNDY5NTY0ZDcyMDA1NDcwOTRiYWZhOWI2YWQ=
|
6
|
+
metadata.gz: bed4707a5e46252639c7c1219ac3d247b25ac8521471823670fe43576cf1e40676e06abfab67746b4292b7204f249c7f1da880afb2a1f1d4ab1e509909acc05b
|
7
|
+
data.tar.gz: 88cfa21ff019dba95c46b978379a391cd660a9dee86503c825e8e127bd64f120157719b30cca7f8bef92ae4158602e5c0e7c7fc096d3024fd5ffa028844e177f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 0.5.0 / 2014-05-01
|
2
|
+
|
3
|
+
### Improvements
|
4
|
+
|
5
|
+
* PR [#23][] - Switch to PVHVM images, where available
|
6
|
+
* PR [#22][] - Update all the images with new IDs
|
7
|
+
* PR [#21][] - Add Ubunutu 14.04 to the list of known images; via [@pezholio][]
|
8
|
+
|
1
9
|
# 0.4.0 / 2014-01-27
|
2
10
|
|
3
11
|
### New Features
|
@@ -38,11 +46,15 @@ boot times, via [@coderanger][]
|
|
38
46
|
|
39
47
|
* Initial release! Woo!
|
40
48
|
|
49
|
+
[#23]: https://github.com/test-kitchen/kitchen-rackspace/pull/23
|
50
|
+
[#22]: https://github.com/test-kitchen/kitchen-rackspace/pull/22
|
51
|
+
[#21]: https://github.com/test-kitchen/kitchen-rackspace/pull/21
|
41
52
|
[#17]: https://github.com/test-kitchen/kitchen-rackspace/pull/17
|
42
53
|
[#15]: https://github.com/test-kitchen/kitchen-rackspace/pull/15
|
43
54
|
[#9]: https://github.com/test-kitchen/kitchen-rackspace/pull/9
|
44
55
|
[#8]: https://github.com/test-kitchen/kitchen-rackspace/pull/8
|
45
56
|
[#7]: https://github.com/test-kitchen/kitchen-rackspace/pull/7
|
46
57
|
|
58
|
+
[@pezholio]: https://github.com/pezholio
|
47
59
|
[@coderanger]: https://github.com/coderanger
|
48
60
|
[@claco]: https://github.com/claco
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Encoding: UTF-8
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'rubocop/rake_task'
|
3
5
|
require 'cane/rake_task'
|
4
6
|
require 'rspec/core/rake_task'
|
5
7
|
|
6
|
-
desc 'Run Cane to check quality metrics'
|
7
8
|
Cane::RakeTask.new
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
task.file_set '**/**/*.rb'
|
10
|
+
Rubocop::RakeTask.new do |task|
|
11
|
+
task.patterns = %w(**/*.rb)
|
12
12
|
end
|
13
13
|
|
14
14
|
desc 'Display LOC stats'
|
@@ -17,9 +17,6 @@ task :loc do
|
|
17
17
|
sh 'countloc -r lib/kitchen'
|
18
18
|
end
|
19
19
|
|
20
|
-
desc 'Run RSpec unit tests'
|
21
20
|
RSpec::Core::RakeTask.new(:spec)
|
22
21
|
|
23
|
-
task :default => [ :cane, :
|
24
|
-
|
25
|
-
# vim: ai et ts=2 sts=2 sw=2 ft=ruby fdm=marker
|
22
|
+
task :default => [ :cane, :rubocop, :loc, :spec ]
|
data/data/images.json
CHANGED
@@ -1,17 +1,50 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"centos-
|
7
|
-
"centos-5
|
2
|
+
"arch": "8a605fb2-57c5-43eb-9bd3-4f990802e478",
|
3
|
+
"arch-2014": "8a605fb2-57c5-43eb-9bd3-4f990802e478",
|
4
|
+
"arch-2014.4": "8a605fb2-57c5-43eb-9bd3-4f990802e478",
|
5
|
+
"centos": "592c879e-f37d-43e6-8b54-8c2d97cf04d4",
|
6
|
+
"centos-6": "592c879e-f37d-43e6-8b54-8c2d97cf04d4",
|
7
|
+
"centos-6.5": "592c879e-f37d-43e6-8b54-8c2d97cf04d4",
|
8
8
|
"centos-5": "9522c27d-51d9-44ee-8eb3-fb7b14fd4042",
|
9
|
-
"centos-
|
10
|
-
"
|
9
|
+
"centos-5.10": "9522c27d-51d9-44ee-8eb3-fb7b14fd4042",
|
10
|
+
"debian": "77e32de8-3304-44f3-b230-436d95fceb19",
|
11
|
+
"debian-7": "77e32de8-3304-44f3-b230-436d95fceb19",
|
11
12
|
"debian-6": "695ca76e-fc0d-4e36-82e0-8ed66480a999",
|
12
|
-
"debian-
|
13
|
-
"fedora
|
14
|
-
"fedora-19": "
|
15
|
-
"
|
16
|
-
"freebsd
|
13
|
+
"debian-6.06": "695ca76e-fc0d-4e36-82e0-8ed66480a999",
|
14
|
+
"fedora": "c21acd84-a6c5-44df-ba7d-2483cd5b3ccb",
|
15
|
+
"fedora-19": "4b81c45a-90d6-4654-972c-73972b1d0aea",
|
16
|
+
"fedora-20": "c21acd84-a6c5-44df-ba7d-2483cd5b3ccb",
|
17
|
+
"freebsd": "e5d7ca78-a487-4d7e-9dd1-73165df3f9fd",
|
18
|
+
"freebsd-10": "e5d7ca78-a487-4d7e-9dd1-73165df3f9fd",
|
19
|
+
"freebsd-10.0": "e5d7ca78-a487-4d7e-9dd1-73165df3f9fd",
|
20
|
+
"gentoo": "6c031e2c-0d2c-4fa0-aadb-70265957a37d",
|
21
|
+
"gentoo-14": "6c031e2c-0d2c-4fa0-aadb-70265957a37d",
|
22
|
+
"gentoo-14.2": "6c031e2c-0d2c-4fa0-aadb-70265957a37d",
|
23
|
+
"opensuse": "6ae8a615-57f1-4a19-83d4-e09f8ae25327",
|
24
|
+
"opensuse-13": "6ae8a615-57f1-4a19-83d4-e09f8ae25327",
|
25
|
+
"opensuse-13.1": "6ae8a615-57f1-4a19-83d4-e09f8ae25327",
|
26
|
+
"redhat": "271e1090-77ad-4400-a1f7-73a922aca8e2",
|
27
|
+
"redhat-6": "271e1090-77ad-4400-a1f7-73a922aca8e2",
|
28
|
+
"redhat-6.5": "271e1090-77ad-4400-a1f7-73a922aca8e2",
|
29
|
+
"redhat-5": "56ad2db2-d9cd-462e-a2a4-7f3a4fc91ee8",
|
30
|
+
"redhat-5.10": "56ad2db2-d9cd-462e-a2a4-7f3a4fc91ee8",
|
31
|
+
"scientific": "dbb59b04-bd50-4eef-b05e-6a6451ef9bf2",
|
32
|
+
"scientific-6": "dbb59b04-bd50-4eef-b05e-6a6451ef9bf2",
|
33
|
+
"scientific-6.5": "dbb59b04-bd50-4eef-b05e-6a6451ef9bf2",
|
34
|
+
"ubuntu": "bb02b1a3-bc77-4d17-ab5b-421d89850fca",
|
35
|
+
"ubuntu-14": "bb02b1a3-bc77-4d17-ab5b-421d89850fca",
|
36
|
+
"ubuntu-14.04": "bb02b1a3-bc77-4d17-ab5b-421d89850fca",
|
37
|
+
"ubuntu-13": "aca656d3-dd70-4d7e-a9e5-f12182871cde",
|
38
|
+
"ubuntu-13.10": "aca656d3-dd70-4d7e-a9e5-f12182871cde",
|
39
|
+
"ubuntu-12": "a4286a42-137c-46ce-a796-dbd2b12a078c",
|
40
|
+
"ubuntu-12.04": "a4286a42-137c-46ce-a796-dbd2b12a078c",
|
41
|
+
"ubuntu-10": "aab63bcf-89aa-440f-b0c7-c7a1c611914b",
|
42
|
+
"ubuntu-10.04": "aab63bcf-89aa-440f-b0c7-c7a1c611914b",
|
43
|
+
"vyatta": "59b394f6-b2e0-4f11-b7d1-7fea4abc60a0",
|
44
|
+
"vyatta-6": "59b394f6-b2e0-4f11-b7d1-7fea4abc60a0",
|
45
|
+
"vyatta-6.5": "59b394f6-b2e0-4f11-b7d1-7fea4abc60a0",
|
46
|
+
"vyatta-6.5.r2": "59b394f6-b2e0-4f11-b7d1-7fea4abc60a0",
|
47
|
+
"windows": "c50f70fc-79ec-4c71-bd4a-a4ac8f1641e1",
|
48
|
+
"windows-2012": "c50f70fc-79ec-4c71-bd4a-a4ac8f1641e1",
|
49
|
+
"windows-2008": "8f39aeb0-79d6-45eb-9505-fb0bf31556d7"
|
17
50
|
}
|
data/kitchen-rackspace.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# Encoding: UTF-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'kitchen/driver/rackspace_version'
|
@@ -25,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
25
26
|
|
26
27
|
spec.add_development_dependency 'bundler'
|
27
28
|
spec.add_development_dependency 'rake'
|
28
|
-
spec.add_development_dependency '
|
29
|
+
spec.add_development_dependency 'rubocop'
|
29
30
|
spec.add_development_dependency 'cane'
|
30
31
|
spec.add_development_dependency 'countloc'
|
31
32
|
spec.add_development_dependency 'rspec'
|
@@ -33,5 +34,3 @@ Gem::Specification.new do |spec|
|
|
33
34
|
spec.add_development_dependency 'simplecov-console'
|
34
35
|
spec.add_development_dependency 'coveralls'
|
35
36
|
end
|
36
|
-
|
37
|
-
# vim: ai et ts=2 sts=2 sw=2 ft=ruby
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Encoding: UTF-8
|
2
2
|
#
|
3
3
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
4
|
#
|
@@ -32,7 +32,7 @@ module Kitchen
|
|
32
32
|
default_config :flavor_id, 'performance1-1'
|
33
33
|
default_config :username, 'root'
|
34
34
|
default_config :port, '22'
|
35
|
-
default_config :rackspace_region,
|
35
|
+
default_config :rackspace_region, 'dfw'
|
36
36
|
|
37
37
|
default_config :image_id do |driver|
|
38
38
|
driver.default_image
|
@@ -42,20 +42,20 @@ module Kitchen
|
|
42
42
|
driver.default_name
|
43
43
|
end
|
44
44
|
|
45
|
-
default_config :public_key_path do
|
45
|
+
default_config :public_key_path do
|
46
46
|
[
|
47
47
|
File.expand_path('~/.ssh/id_rsa.pub'),
|
48
48
|
File.expand_path('~/.ssh/id_dsa.pub'),
|
49
49
|
File.expand_path('~/.ssh/identity.pub'),
|
50
|
-
File.expand_path('~/.ssh/id_ecdsa.pub')
|
51
|
-
].find { |path| File.
|
50
|
+
File.expand_path('~/.ssh/id_ecdsa.pub')
|
51
|
+
].find { |path| File.exist?(path) }
|
52
52
|
end
|
53
53
|
|
54
|
-
default_config :rackspace_username do
|
54
|
+
default_config :rackspace_username do
|
55
55
|
ENV['RACKSPACE_USERNAME'] || ENV['OS_USERNAME']
|
56
56
|
end
|
57
57
|
|
58
|
-
default_config :rackspace_api_key do
|
58
|
+
default_config :rackspace_api_key do
|
59
59
|
ENV['RACKSPACE_API_KEY'] || ENV['OS_PASSWORD']
|
60
60
|
end
|
61
61
|
|
@@ -68,9 +68,11 @@ module Kitchen
|
|
68
68
|
server = create_server
|
69
69
|
state[:server_id] = server.id
|
70
70
|
info("Rackspace instance <#{state[:server_id]}> created.")
|
71
|
-
server.wait_for { ready? }
|
71
|
+
server.wait_for { ready? }
|
72
|
+
puts '(server ready)'
|
72
73
|
state[:hostname] = server.public_ip_address
|
73
|
-
wait_for_sshd(state[:hostname])
|
74
|
+
wait_for_sshd(state[:hostname])
|
75
|
+
puts '(ssh ready)'
|
74
76
|
rescue Fog::Errors::Error, Excon::Errors::Error => ex
|
75
77
|
raise ActionFailed, ex.message
|
76
78
|
end
|
@@ -99,10 +101,10 @@ module Kitchen
|
|
99
101
|
|
100
102
|
def compute
|
101
103
|
server_def = {
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
:
|
104
|
+
provider: 'Rackspace',
|
105
|
+
version: config[:version],
|
106
|
+
rackspace_username: config[:rackspace_username],
|
107
|
+
rackspace_api_key: config[:rackspace_api_key]
|
106
108
|
}
|
107
109
|
if config[:rackspace_region]
|
108
110
|
server_def[:rackspace_region] = config[:rackspace_region]
|
@@ -112,17 +114,17 @@ module Kitchen
|
|
112
114
|
|
113
115
|
def create_server
|
114
116
|
compute.servers.bootstrap(
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
:
|
117
|
+
name: config[:server_name],
|
118
|
+
image_id: config[:image_id],
|
119
|
+
flavor_id: config[:flavor_id],
|
120
|
+
public_key_path: config[:public_key_path]
|
119
121
|
)
|
120
122
|
end
|
121
123
|
|
122
124
|
def images
|
123
125
|
@images ||= begin
|
124
126
|
json_file = File.expand_path(
|
125
|
-
File.join(%w
|
127
|
+
File.join(%w(.. .. .. .. data images.json)),
|
126
128
|
__FILE__
|
127
129
|
)
|
128
130
|
JSON.load(IO.read(json_file))
|
@@ -131,5 +133,3 @@ module Kitchen
|
|
131
133
|
end
|
132
134
|
end
|
133
135
|
end
|
134
|
-
|
135
|
-
# vim: ai et ts=2 sts=2 sw=2 ft=ruby
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Encoding: UTF-8
|
2
2
|
#
|
3
3
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
4
|
#
|
@@ -17,10 +17,10 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
19
|
module Kitchen
|
20
|
+
# Version string for Rackspace Kitchen driver
|
21
|
+
#
|
22
|
+
# @author Jonathan Hartman <j@p4nt5.com>
|
20
23
|
module Driver
|
21
|
-
|
22
|
-
RACKSPACE_VERSION = '0.4.0'
|
24
|
+
RACKSPACE_VERSION = '0.5.0'
|
23
25
|
end
|
24
26
|
end
|
25
|
-
|
26
|
-
# vim: ai et ts=2 sts=2 sw=2 ft=ruby
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Encoding: UTF-8
|
2
2
|
#
|
3
3
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
4
|
#
|
@@ -32,10 +32,10 @@ describe Kitchen::Driver::Rackspace do
|
|
32
32
|
|
33
33
|
let(:instance) do
|
34
34
|
double(
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
35
|
+
name: 'potatoes',
|
36
|
+
logger: logger,
|
37
|
+
to_str: 'instance',
|
38
|
+
platform: double(name: platform_name)
|
39
39
|
)
|
40
40
|
end
|
41
41
|
|
@@ -62,7 +62,7 @@ describe Kitchen::Driver::Rackspace do
|
|
62
62
|
|
63
63
|
it "defaults to local user's SSH public key" do
|
64
64
|
path = File.expand_path('~/.ssh/id_rsa.pub')
|
65
|
-
expect(File).to receive(:
|
65
|
+
expect(File).to receive(:exist?).with(path).and_return(true)
|
66
66
|
expect(driver[:public_key_path]).to eq(path)
|
67
67
|
end
|
68
68
|
|
@@ -75,8 +75,8 @@ describe Kitchen::Driver::Rackspace do
|
|
75
75
|
expect(driver[:server_name]).to be_a(String)
|
76
76
|
end
|
77
77
|
|
78
|
-
it 'defaults to
|
79
|
-
expect(driver[:rackspace_region]).to eq(
|
78
|
+
it 'defaults to the DFW region' do
|
79
|
+
expect(driver[:rackspace_region]).to eq('dfw')
|
80
80
|
end
|
81
81
|
|
82
82
|
it 'defaults to username from $RACKSPACE_USERNAME' do
|
@@ -88,31 +88,33 @@ describe Kitchen::Driver::Rackspace do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
91
|
+
platforms = {
|
92
|
+
'ubuntu-12.04' => 'a4286a42-137c-46ce-a796-dbd2b12a078c',
|
93
|
+
'ubuntu-12' => 'a4286a42-137c-46ce-a796-dbd2b12a078c',
|
94
|
+
'ubuntu' => 'bb02b1a3-bc77-4d17-ab5b-421d89850fca',
|
95
|
+
'centos-5.10' => '9522c27d-51d9-44ee-8eb3-fb7b14fd4042',
|
96
|
+
'centos-5' => '9522c27d-51d9-44ee-8eb3-fb7b14fd4042',
|
97
|
+
'centos' => '592c879e-f37d-43e6-8b54-8c2d97cf04d4'
|
98
|
+
}
|
99
|
+
platforms.each do |platform, id|
|
100
|
+
context "name is #{platform}" do
|
101
|
+
let(:platform_name) { platform }
|
102
|
+
|
103
|
+
it 'defaults to the correct image ID' do
|
104
|
+
expect(driver[:image_id]).to eq(id)
|
105
|
+
end
|
104
106
|
end
|
105
107
|
end
|
106
108
|
|
107
109
|
context 'overridden options' do
|
108
110
|
config = {
|
109
|
-
:
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
111
|
+
image_id: '22',
|
112
|
+
flavor_id: '33',
|
113
|
+
public_key_path: '/tmp',
|
114
|
+
username: 'admin',
|
115
|
+
port: '2222',
|
116
|
+
server_name: 'puppy',
|
117
|
+
rackspace_region: 'ord'
|
116
118
|
}
|
117
119
|
|
118
120
|
let(:config) { config }
|
@@ -144,8 +146,8 @@ describe Kitchen::Driver::Rackspace do
|
|
144
146
|
|
145
147
|
describe '#create' do
|
146
148
|
let(:server) do
|
147
|
-
double(:
|
148
|
-
|
149
|
+
double(id: 'test123', wait_for: true,
|
150
|
+
public_ip_address: '1.2.3.4')
|
149
151
|
end
|
150
152
|
let(:driver) do
|
151
153
|
d = Kitchen::Driver::Rackspace.new(config)
|
@@ -159,8 +161,8 @@ describe Kitchen::Driver::Rackspace do
|
|
159
161
|
context 'username and API key only provided' do
|
160
162
|
let(:config) do
|
161
163
|
{
|
162
|
-
:
|
163
|
-
:
|
164
|
+
rackspace_username: 'hello',
|
165
|
+
rackspace_api_key: 'world'
|
164
166
|
}
|
165
167
|
end
|
166
168
|
|
@@ -184,10 +186,10 @@ describe Kitchen::Driver::Rackspace do
|
|
184
186
|
describe '#destroy' do
|
185
187
|
let(:server_id) { '12345' }
|
186
188
|
let(:hostname) { 'example.com' }
|
187
|
-
let(:state) { { :
|
188
|
-
let(:server) { double(
|
189
|
-
let(:servers) { double(:
|
190
|
-
let(:compute) { double(:
|
189
|
+
let(:state) { { server_id: server_id, hostname: hostname } }
|
190
|
+
let(:server) { double(nil?: false, destroy: true) }
|
191
|
+
let(:servers) { double(get: server) }
|
192
|
+
let(:compute) { double(servers: servers) }
|
191
193
|
|
192
194
|
let(:driver) do
|
193
195
|
d = Kitchen::Driver::Rackspace.new(config)
|
@@ -221,7 +223,7 @@ describe Kitchen::Driver::Rackspace do
|
|
221
223
|
s.stub(:get).with('12345').and_return(nil)
|
222
224
|
s
|
223
225
|
end
|
224
|
-
let(:compute) { double(:
|
226
|
+
let(:compute) { double(servers: servers) }
|
225
227
|
let(:driver) do
|
226
228
|
d = Kitchen::Driver::Rackspace.new(config)
|
227
229
|
d.instance = instance
|
@@ -239,23 +241,23 @@ describe Kitchen::Driver::Rackspace do
|
|
239
241
|
describe '#compute' do
|
240
242
|
let(:config) do
|
241
243
|
{
|
242
|
-
:
|
243
|
-
:
|
244
|
-
:
|
244
|
+
rackspace_username: 'monkey',
|
245
|
+
rackspace_api_key: 'potato',
|
246
|
+
rackspace_region: 'ord'
|
245
247
|
}
|
246
248
|
end
|
247
249
|
|
248
250
|
context 'all requirements provided' do
|
249
251
|
it 'creates a new compute connection' do
|
250
252
|
Fog::Compute.stub(:new) { |arg| arg }
|
251
|
-
res = config.merge(
|
253
|
+
res = config.merge(provider: 'Rackspace', version: 'v2')
|
252
254
|
expect(driver.send(:compute)).to eq(res)
|
253
255
|
end
|
254
256
|
end
|
255
257
|
|
256
258
|
context 'no username provided' do
|
257
259
|
let(:config) do
|
258
|
-
{ :
|
260
|
+
{ rackspace_username: nil, rackspace_api_key: '1234' }
|
259
261
|
end
|
260
262
|
|
261
263
|
it 'raises an error' do
|
@@ -265,7 +267,7 @@ describe Kitchen::Driver::Rackspace do
|
|
265
267
|
|
266
268
|
context 'no API key provided' do
|
267
269
|
let(:config) do
|
268
|
-
{ :
|
270
|
+
{ rackspace_username: 'monkey', rackspace_api_key: nil }
|
269
271
|
end
|
270
272
|
|
271
273
|
it 'raises an error' do
|
@@ -277,15 +279,15 @@ describe Kitchen::Driver::Rackspace do
|
|
277
279
|
describe '#create_server' do
|
278
280
|
let(:config) do
|
279
281
|
{
|
280
|
-
:
|
281
|
-
:
|
282
|
-
:
|
283
|
-
:
|
282
|
+
server_name: 'hello',
|
283
|
+
image_id: 'there',
|
284
|
+
flavor_id: 'captain',
|
285
|
+
public_key_path: 'tarpals'
|
284
286
|
}
|
285
287
|
end
|
286
288
|
before(:each) do
|
287
|
-
@expected = config.merge(:
|
288
|
-
@expected.delete_if do |k,
|
289
|
+
@expected = config.merge(name: config[:server_name])
|
290
|
+
@expected.delete_if do |k, _|
|
289
291
|
k == :server_name
|
290
292
|
end
|
291
293
|
end
|
@@ -294,7 +296,7 @@ describe Kitchen::Driver::Rackspace do
|
|
294
296
|
s.stub(:bootstrap) { |arg| arg }
|
295
297
|
s
|
296
298
|
end
|
297
|
-
let(:compute) { double(:
|
299
|
+
let(:compute) { double(servers: servers) }
|
298
300
|
let(:driver) do
|
299
301
|
d = Kitchen::Driver::Rackspace.new(config)
|
300
302
|
d.instance = instance
|
@@ -319,5 +321,3 @@ describe Kitchen::Driver::Rackspace do
|
|
319
321
|
end
|
320
322
|
end
|
321
323
|
end
|
322
|
-
|
323
|
-
# vim: ai et ts=2 sts=2 sw=2 ft=ruby
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Encoding: UTF-8
|
2
2
|
#
|
3
3
|
# Author:: Jonathan Hartman (<j@p4nt5.com>)
|
4
4
|
#
|
@@ -31,5 +31,3 @@ SimpleCov.minimum_coverage 90
|
|
31
31
|
SimpleCov.start
|
32
32
|
|
33
33
|
require_relative '../lib/kitchen/driver/rackspace'
|
34
|
-
|
35
|
-
# vim: ai et ts=2 sts=2 sw=2 ft=ruby
|
metadata
CHANGED
@@ -1,181 +1,181 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-rackspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Hartman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fog
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.18'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.18'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: unf
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: cane
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: countloc
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: simplecov
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: simplecov-console
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: coveralls
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
181
|
description: A Test Kitchen Rackspace driver
|
@@ -185,8 +185,8 @@ executables: []
|
|
185
185
|
extensions: []
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
|
-
- .gitignore
|
189
|
-
- .travis.yml
|
188
|
+
- ".gitignore"
|
189
|
+
- ".travis.yml"
|
190
190
|
- CHANGELOG.md
|
191
191
|
- Gemfile
|
192
192
|
- LICENSE.txt
|
@@ -208,17 +208,17 @@ require_paths:
|
|
208
208
|
- lib
|
209
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
|
-
- -
|
211
|
+
- - ">="
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
215
|
requirements:
|
216
|
-
- -
|
216
|
+
- - ">="
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.2.
|
221
|
+
rubygems_version: 2.2.2
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: A Test Kitchen Rackspace driver
|