kitchen-openstack 1.7.0 → 1.7.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6059fb2f510144b58793252bb820a17f15b60e1
4
- data.tar.gz: 1839ff785f4c4864ecee83317e6849c13bf96919
3
+ metadata.gz: ada2dfc8390553bc3b419e50b3561a97a52dcb18
4
+ data.tar.gz: 91b3b46bd248411691f9bff8fa424c3225580cc9
5
5
  SHA512:
6
- metadata.gz: 6237abba4531cb071ea8681478a3069cdc5605c8ba60bef2f9defa56a3a5519699343d000f7ed4805b825867c6123ffcd19e358760a20944529993588599f346
7
- data.tar.gz: 52857088b9f309bcbe3178912f0be5318be8eb0cc587ed16b3500ea8709d415e1cd3fe8a6f6c16728e7f6537732d27bf05ace5edf9b1e8000acfde69e61c56d1
6
+ metadata.gz: cbf3719c9a0baf7c0e54a8618598525be1484910efe0a8d1ec3714a0c9fc3a8b705bc9776db5b2ece5f1e5b532334db814ad2e601a4b5c326a35c5cbb699a493
7
+ data.tar.gz: e4af2de8a2b0433441a58e50bad8557c63800d18bc07cc45633dadac0878808100e1581c8c20b39499a44b5101c054934b14e762069f278b6be557c1300debb2
data/.rubocop.yml CHANGED
@@ -1,10 +1,12 @@
1
1
  CyclomaticComplexity:
2
- Enabled: false
2
+ Max: 8
3
3
  MethodLength:
4
- Enabled: false
4
+ Max: 30
5
5
  ClassLength:
6
- Enabled: false
6
+ Max: 300
7
7
  ClassVars:
8
8
  Enabled: false
9
9
  PerceivedComplexity:
10
10
  Max: 10
11
+ AbcSize:
12
+ Max: 41
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
 
3
- gemfile:
4
- - Gemfile
4
+ sudo: false
5
5
 
6
6
  rvm:
7
7
  - 1.9.3
8
8
  - 2.0.0
9
- - 2.1.1
9
+ - ruby-head
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.7.1 / 2015-01-07
2
+
3
+ * PR [#70][] - Use configured password for SSH access, if provided
4
+
1
5
  # 1.7.0 / 2014-10-25
2
6
 
3
7
  ### New Features
@@ -134,6 +138,7 @@ certain specified NICs; via [@monsterzz][]
134
138
 
135
139
  * Initial release! Woo!
136
140
 
141
+ [#70]: https://github.com/test-kitchen/kitchen-openstack/pull/70
137
142
  [#66]: https://github.com/test-kitchen/kitchen-openstack/pull/66
138
143
  [#63]: https://github.com/test-kitchen/kitchen-openstack/pull/63
139
144
  [#62]: https://github.com/test-kitchen/kitchen-openstack/pull/62
data/README.md CHANGED
@@ -50,6 +50,7 @@ behavior can be overridden with additional options:
50
50
  private_key_path: [PATH TO YOUR PRIVATE SSH KEY]
51
51
  public_key_path: [PATH TO YOUR SSH PUBLIC KEY]
52
52
  username: [SSH USER]
53
+ password: [SSH PASSWORD]
53
54
  port: [SSH PORT]
54
55
  key_name: [SSH KEY NAME]
55
56
  openstack_tenant: [YOUR OPENSTACK TENANT ID]
@@ -45,6 +45,7 @@ module Kitchen
45
45
  driver[:private_key_path] + '.pub'
46
46
  end
47
47
  default_config :username, 'root'
48
+ default_config :password, nil
48
49
  default_config :port, '22'
49
50
  default_config :use_ipv6, false
50
51
  default_config :openstack_tenant, nil
@@ -318,7 +319,7 @@ module Kitchen
318
319
  info "Setting up SSH access for key <#{config[:public_key_path]}>"
319
320
  ssh = Fog::SSH.new(state[:hostname],
320
321
  config[:username],
321
- password: server.password)
322
+ password: config[:password] || server.password)
322
323
  pub_key = open(config[:public_key_path]).read
323
324
  ssh.run([
324
325
  %(mkdir .ssh),
@@ -21,6 +21,6 @@ module Kitchen
21
21
  #
22
22
  # @author Jonathan Hartman <j@p4nt5.com>
23
23
  module Driver
24
- OPENSTACK_VERSION = '1.7.0'
24
+ OPENSTACK_VERSION = '1.7.1'
25
25
  end
26
26
  end
@@ -1033,24 +1033,33 @@ describe Kitchen::Driver::Openstack do
1033
1033
  let(:server) { double(password: 'aloha') }
1034
1034
  let(:state) { { hostname: 'host' } }
1035
1035
  let(:read) { double(read: 'a_key') }
1036
- let(:ssh) do
1037
- s = double('ssh')
1038
- allow(s).to receive(:run) { |args| args }
1039
- s
1036
+ let(:ssh) { double(run: true) }
1037
+
1038
+ before(:each) do
1039
+ allow(driver).to receive(:open).with(config[:public_key_path])
1040
+ .and_return(read)
1040
1041
  end
1041
1042
 
1042
1043
  it 'opens an SSH session to the server' do
1043
- allow(Fog::SSH).to receive(:new).with('host', 'root', password: 'aloha')
1044
- .and_return(ssh)
1045
- allow(driver).to receive(:open).with('/pub_key').and_return(read)
1046
- allow(read).to receive(:read).and_return('a_key')
1047
- res = driver.send(:do_ssh_setup, state, config, server)
1048
- expected = [
1044
+ expect(Fog::SSH).to receive(:new).with(state[:hostname],
1045
+ 'root',
1046
+ password: 'aloha').and_return(ssh)
1047
+ expect(ssh).to receive(:run).with([
1049
1048
  'mkdir .ssh',
1050
1049
  'echo "a_key" >> ~/.ssh/authorized_keys',
1051
1050
  'passwd -l root'
1052
- ]
1053
- expect(res).to eq(expected)
1051
+ ])
1052
+ driver.send(:do_ssh_setup, state, config, server)
1053
+ end
1054
+
1055
+ context 'a configured SSH password' do
1056
+ let(:config) { super().merge(password: '12345') }
1057
+
1058
+ it 'uses the configured password' do
1059
+ expect(Fog::SSH).to receive(:new)
1060
+ .with(state[:hostname], 'root', password: '12345').and_return(ssh)
1061
+ driver.send(:do_ssh_setup, state, config, server)
1062
+ end
1054
1063
  end
1055
1064
  end
1056
1065
 
data/spec/spec_helper.rb CHANGED
@@ -28,6 +28,8 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
28
28
  SimpleCov::Formatter::Console
29
29
  ]
30
30
  SimpleCov.minimum_coverage 90
31
- SimpleCov.start
31
+ SimpleCov.start do
32
+ add_filter '/vendor/'
33
+ end
32
34
 
33
35
  require_relative '../lib/kitchen/driver/openstack'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
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-10-26 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
232
  version: '0'
233
233
  requirements: []
234
234
  rubyforge_project:
235
- rubygems_version: 2.4.1
235
+ rubygems_version: 2.4.5
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: A Test Kitchen OpenStack Nova driver