test-kitchen 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81b8adb0709ab4a153dcc6a0eba1c51e871d7dde
4
- data.tar.gz: 97fbf58b65c2696f67dfae8c70ba089f14ef0ba9
3
+ metadata.gz: 616a0d59e9500a9ae80507ef5efdf7175bb4adba
4
+ data.tar.gz: 3108f9221ad1ef480d3282e107e581a65f1c5873
5
5
  SHA512:
6
- metadata.gz: 1d21fba7803bdf1592b7d1554cf4897f98817470d7559422f72f6fb8fbba38257484acf12dc89ee4f20cf7a0146053016a5f7c7b517ef7d8bf2591366e268a31
7
- data.tar.gz: 32d72aac0d92f2c8dc12e0d1a4e66589d126c90f3c6f937230d28ef591a33e4e722a91613c6b316183360634457858f9f4e0c7bdc76f1afc88e024b49514600d
6
+ metadata.gz: 6b2851f54a37c72e95a6ae3e1842cbb54165508cc3ff1129ee2456fef1c06558c6647a19c361e21aaefdc9a13717d337bad07b122658b7ffb3e92e2e9c1f69b6
7
+ data.tar.gz: a0b3a27e700d82e0295004f9bf4a38e86148a3922d9ef7ac108de22b95341c718be87db1589b8970284ae608c0a8eb19a038544a50f81423b19c5c7ed1b5ccdf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.13.0](https://github.com/test-kitchen/test-kitchen/tree/v1.13.0) (2016-09-16)
4
+ [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.12.0...v1.13.0)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Add `kitchen status` command [\#87](https://github.com/test-kitchen/test-kitchen/issues/87)
9
+ - Add support for Windows Nano installs via chef provisioners [\#1119](https://github.com/test-kitchen/test-kitchen/pull/1119) ([mwrock](https://github.com/mwrock))
10
+ - Add package driver command [\#1074](https://github.com/test-kitchen/test-kitchen/pull/1074) ([neillturner](https://github.com/neillturner))
11
+
12
+ **Fixed bugs:**
13
+
14
+ - SSH Transport: Bastion proxy results in broken pipe error [\#1079](https://github.com/test-kitchen/test-kitchen/issues/1079)
15
+
3
16
  ## [v1.12.0](https://github.com/test-kitchen/test-kitchen/tree/v1.12.0) (2016-09-02)
4
17
  [Full Changelog](https://github.com/test-kitchen/test-kitchen/compare/v1.11.1...v1.12.0)
5
18
 
data/Gemfile CHANGED
@@ -3,11 +3,11 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
  gem "rack", "< 2.0"
5
5
 
6
- gem "train", :github => "chef/train", :branch => "winrm-v2"
6
+ gem "train", "~> 0.19.0"
7
7
 
8
8
  group :integration do
9
9
  gem "berkshelf", "~> 4.3"
10
- gem "kitchen-inspec", :git => "https://github.com/mwrock/kitchen-inspec", :branch => "winrm-v2"
10
+ gem "kitchen-inspec", "~> 0.15.1"
11
11
  end
12
12
 
13
13
  group :test do
@@ -3,34 +3,34 @@
3
3
  require "tmpdir"
4
4
  require "pathname"
5
5
 
6
- # Given(/^a sandboxed GEM_HOME directory named "(.*?)"$/) do |name|
7
- # backup_envvar("GEM_HOME")
8
- # backup_envvar("GEM_PATH")
6
+ Given(/^a sandboxed GEM_HOME directory named "(.*?)"$/) do |name|
7
+ backup_envvar("GEM_HOME")
8
+ backup_envvar("GEM_PATH")
9
9
 
10
- # @aruba_timeout_seconds = 30
10
+ @aruba_timeout_seconds = 30
11
11
 
12
- # gem_home = Pathname.new(Dir.mktmpdir(name))
13
- # aruba.environment["GEM_HOME"] = gem_home.to_s
14
- # aruba.environment["GEM_PATH"] = [gem_home.to_s, ENV["GEM_PATH"]].join(":")
15
- # @cleanup_dirs << gem_home
16
- # end
12
+ gem_home = Pathname.new(Dir.mktmpdir(name))
13
+ aruba.environment["GEM_HOME"] = gem_home.to_s
14
+ aruba.environment["GEM_PATH"] = [gem_home.to_s, ENV["GEM_PATH"]].join(":")
15
+ @cleanup_dirs << gem_home
16
+ end
17
17
 
18
- # Then(/^a gem named "(.*?)" is installed with version "(.*?)"$/) do |name, version|
19
- # unbundlerize do
20
- # run_simple(
21
- # sanitize_text("gem list #{name} --version #{version} -i"),
22
- # :fail_on_error => true,
23
- # :exit_timeout => nil
24
- # )
25
- # end
26
- # end
18
+ Then(/^a gem named "(.*?)" is installed with version "(.*?)"$/) do |name, version|
19
+ unbundlerize do
20
+ run_simple(
21
+ sanitize_text("gem list #{name} --version #{version} -i"),
22
+ :fail_on_error => true,
23
+ :exit_timeout => nil
24
+ )
25
+ end
26
+ end
27
27
 
28
- # Then(/^a gem named "(.*?)" is installed$/) do |name|
29
- # unbundlerize do
30
- # run_simple(
31
- # sanitize_text("gem list #{name} -i"),
32
- # :fail_on_error => true,
33
- # :exit_timeout => nil
34
- # )
35
- # end
36
- # end
28
+ Then(/^a gem named "(.*?)" is installed$/) do |name|
29
+ unbundlerize do
30
+ run_simple(
31
+ sanitize_text("gem list #{name} -i"),
32
+ :fail_on_error => true,
33
+ :exit_timeout => nil
34
+ )
35
+ end
36
+ end
data/lib/kitchen/cli.rb CHANGED
@@ -119,6 +119,7 @@ module Kitchen
119
119
  update_config!
120
120
  perform("list", "list", args)
121
121
  end
122
+ map :status => :list
122
123
 
123
124
  desc "diagnose [INSTANCE|REGEXP|all]", "Show computed diagnostic configuration"
124
125
  method_option :loader,
@@ -239,6 +240,13 @@ module Kitchen
239
240
  perform("login", "login", args)
240
241
  end
241
242
 
243
+ desc "package INSTANCE|REGEXP", "package an instance"
244
+ log_options
245
+ def package(*args)
246
+ update_config!
247
+ perform("package", "package", args)
248
+ end
249
+
242
250
  desc "exec INSTANCE|REGEXP -c REMOTE_COMMAND",
243
251
  "Execute command on one or more instance"
244
252
  method_option :command,
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ require "kitchen/command"
17
+
18
+ module Kitchen
19
+
20
+ module Command
21
+
22
+ # Execute command on remote instance.
23
+ #
24
+ class Package < Kitchen::Command::Base
25
+
26
+ # Invoke the command.
27
+ def call
28
+ results = parse_subcommand(args.first)
29
+ results.each do |instance|
30
+ banner "Package on #{instance.name}."
31
+ instance.package_action
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -255,7 +255,7 @@ module Kitchen
255
255
  def reload_ps1_path
256
256
  [
257
257
  %{$env:PATH},
258
- %{[System.Environment]::GetEnvironmentVariable("PATH","Machine")\n\n}
258
+ %(try { [System.Environment]::GetEnvironmentVariable("PATH","Machine") } catch {}\n\n)
259
259
  ].join(" = ")
260
260
  end
261
261
 
@@ -52,6 +52,13 @@ module Kitchen
52
52
  def destroy(state) # rubocop:disable Lint/UnusedMethodArgument
53
53
  end
54
54
 
55
+ # Package an instance.
56
+ #
57
+ # @param state [Hash] mutable instance and driver state
58
+ # @raise [ActionFailed] if the action could not be completed
59
+ def package(state) # rubocop:disable Lint/UnusedMethodArgument
60
+ end
61
+
55
62
  class << self
56
63
  # @return [Array<Symbol>] an array of action method names that cannot
57
64
  # be run concurrently and must be run in serial via a shared mutex
@@ -130,6 +130,12 @@ module Kitchen
130
130
  backcompat_merged_state(state)
131
131
  end
132
132
 
133
+ # Package an instance.
134
+ #
135
+ # (see Base#package)
136
+ def package(state) # rubocop:disable Lint/UnusedMethodArgument
137
+ end
138
+
133
139
  # (see Base#login_command)
134
140
  def login_command(state)
135
141
  instance.transport.connection(backcompat_merged_state(state)).
@@ -229,6 +229,13 @@ module Kitchen
229
229
  end
230
230
  end
231
231
 
232
+ # Perform package.
233
+ #
234
+ def package_action
235
+ banner "Packaging remote instance"
236
+ driver.package(state_file.read)
237
+ end
238
+
232
239
  # Returns a Hash of configuration and other useful diagnostic information.
233
240
  #
234
241
  # @return [Hash] a diagnostic hash
@@ -197,7 +197,7 @@ module Kitchen
197
197
 
198
198
  RESCUE_EXCEPTIONS_ON_ESTABLISH = [
199
199
  Errno::EACCES, Errno::EADDRINUSE, Errno::ECONNREFUSED, Errno::ETIMEDOUT,
200
- Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH,
200
+ Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH, Errno::EPIPE,
201
201
  Net::SSH::Disconnect, Net::SSH::AuthenticationFailed, Net::SSH::ConnectionTimeout,
202
202
  Timeout::Error
203
203
  ].freeze
@@ -17,5 +17,5 @@
17
17
  # limitations under the License.
18
18
 
19
19
  module Kitchen
20
- VERSION = "1.12.0"
20
+ VERSION = "1.13.0"
21
21
  end
@@ -500,7 +500,7 @@ describe Kitchen::Provisioner::ChefSolo do
500
500
 
501
501
  it "reloads PATH for older chef omnibus packages" do
502
502
  cmd.must_match regexify("$env:PATH = " +
503
- %{[System.Environment]::GetEnvironmentVariable("PATH","Machine")})
503
+ %(try { [System.Environment]::GetEnvironmentVariable("PATH","Machine") } catch {}))
504
504
  end
505
505
 
506
506
  it "calls the chef-solo command from :chef_solo_path" do
@@ -818,7 +818,7 @@ describe Kitchen::Provisioner::ChefZero do
818
818
 
819
819
  it "reloads PATH for older chef omnibus packages" do
820
820
  cmd.must_match regexify("$env:PATH = " +
821
- %{[System.Environment]::GetEnvironmentVariable("PATH","Machine")})
821
+ %(try { [System.Environment]::GetEnvironmentVariable("PATH","Machine") } catch {}))
822
822
  end
823
823
 
824
824
  it "calls the chef-client command from :chef_client_path" do
@@ -979,7 +979,7 @@ describe Kitchen::Provisioner::ChefZero do
979
979
 
980
980
  it "reloads PATH for older chef omnibus packages" do
981
981
  cmd.must_match regexify("$env:PATH = " +
982
- %{[System.Environment]::GetEnvironmentVariable("PATH","Machine")})
982
+ %(try { [System.Environment]::GetEnvironmentVariable("PATH","Machine") } catch {}))
983
983
  end
984
984
  end
985
985
  end
data/test-kitchen.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.add_dependency "net-ssh-gateway", "~> 1.2.0"
30
30
  gem.add_dependency "safe_yaml", "~> 1.0"
31
31
  gem.add_dependency "thor", "~> 0.18"
32
- gem.add_dependency "mixlib-install", "~> 1.0", ">= 1.0.4"
32
+ gem.add_dependency "mixlib-install", "~> 1.2"
33
33
 
34
34
  gem.add_development_dependency "pry"
35
35
  gem.add_development_dependency "pry-byebug"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-02 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -112,20 +112,14 @@ dependencies:
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '1.0'
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: 1.0.4
115
+ version: '1.2'
119
116
  type: :runtime
120
117
  prerelease: false
121
118
  version_requirements: !ruby/object:Gem::Requirement
122
119
  requirements:
123
120
  - - "~>"
124
121
  - !ruby/object:Gem::Version
125
- version: '1.0'
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: 1.0.4
122
+ version: '1.2'
129
123
  - !ruby/object:Gem::Dependency
130
124
  name: pry
131
125
  requirement: !ruby/object:Gem::Requirement
@@ -480,6 +474,7 @@ files:
480
474
  - lib/kitchen/command/exec.rb
481
475
  - lib/kitchen/command/list.rb
482
476
  - lib/kitchen/command/login.rb
477
+ - lib/kitchen/command/package.rb
483
478
  - lib/kitchen/command/sink.rb
484
479
  - lib/kitchen/command/test.rb
485
480
  - lib/kitchen/config.rb