test-kitchen 2.3.0 → 2.3.1

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
  SHA256:
3
- metadata.gz: 42bf489a9ab86a4c1c88cc74e8a257ce2b6241a199fcd337b59a1b7ee32f321f
4
- data.tar.gz: 1c89f445f99ceec9e677ba75cdbbd662b150b36ebbecaadccbf1378d57edca0d
3
+ metadata.gz: 9edd0eb56ff04d6f333344674cbc81289a4d5e02e4fc824d80f38c05fc08dde5
4
+ data.tar.gz: 500f102fd47c3708bc14e35e7e48069f012286b30bab206231b0841d4a50d8e4
5
5
  SHA512:
6
- metadata.gz: f81c55631f7f772e3f0a3a1d6ef25116632b5500ad3e782f8f2e97dfcb691c6c397f2a5589248dac7a90a95459558cde767398e052c322b48525dd896f389388
7
- data.tar.gz: 57e8f9a2ea674ee43f2e589a52b5e259c749840f122a9094a997c6968bf4e35143c4fc20d8e4accf44454c1d03d252429c8b4272c205328a01f56be6d16dcce5
6
+ metadata.gz: b471175533c12991c1053b0007d63007b6c2d246ad0bacba89badc7038f0bbe404f2c375db5d50f71d1e9ca93ca3e909dff63bb5f0bd93756b03600538ec6231
7
+ data.tar.gz: e1ecc75fb49ff9742bb349a97e3e0f6ea7745562c7d576ad096419be697fe3f5eb66ec2e41c24b26f62adfb49ea0676bfc3dff9720d4a16237606d6f2bb1d9f7
@@ -253,7 +253,7 @@ module Kitchen
253
253
  def diagnose
254
254
  result = {}
255
255
  %i{
256
- platform state_file driver provisioner transport verifier
256
+ platform state_file driver provisioner transport verifier lifecycle_hooks
257
257
  }.each do |sym|
258
258
  obj = send(sym)
259
259
  result[sym] = obj.respond_to?(:diagnose) ? obj.diagnose : :unknown
@@ -85,8 +85,10 @@ module Kitchen
85
85
  # @param hook [Hash] Hook configration to use.
86
86
  # @return [void]
87
87
  def run_local_hook(instance, state_file, hook)
88
- cmd = hook.delete(:local)
88
+ cmd = hook.fetch(:local)
89
89
  state = state_file.read
90
+ # set up empty user variable
91
+ user = {}
90
92
  # Set up some environment variables with instance info.
91
93
  environment = {
92
94
  "KITCHEN_INSTANCE_NAME" => instance.name,
@@ -101,6 +103,12 @@ module Kitchen
101
103
  environment[k.to_s] = v.to_s
102
104
  end
103
105
  end
106
+
107
+ # add user to user hash for later merging
108
+ if hook[:user]
109
+ user[:user] = hook[:user]
110
+ end
111
+
104
112
  # Default the cwd to the kitchen root and resolve a relative input cwd against that.
105
113
  cwd = if hook[:cwd]
106
114
  File.expand_path(hook[:cwd], config[:kitchen_root])
@@ -108,7 +116,7 @@ module Kitchen
108
116
  config[:kitchen_root]
109
117
  end
110
118
  # Build the options for mixlib-shellout.
111
- opts = {}.merge(hook).merge(cwd: cwd, environment: environment)
119
+ opts = {}.merge(user).merge(cwd: cwd, environment: environment)
112
120
  run_command(cmd, opts)
113
121
  end
114
122
 
@@ -128,7 +136,8 @@ module Kitchen
128
136
  raise UserError, "Cannot use remote lifecycle hooks during phases when the instance is not available"
129
137
  end
130
138
  end
131
- cmd = hook.delete(:remote)
139
+
140
+ cmd = hook.fetch(:remote)
132
141
  conn = instance.transport.connection(state_file.read)
133
142
  conn.execute(cmd)
134
143
  end
@@ -46,6 +46,7 @@ module Kitchen
46
46
  default_config :username, "root"
47
47
  default_config :keepalive, true
48
48
  default_config :keepalive_interval, 60
49
+ default_config :keepalive_maxcount, 3
49
50
  # needs to be one less than the configured sshd_config MaxSessions
50
51
  default_config :max_ssh_sessions, 9
51
52
  default_config :connection_timeout, 15
@@ -468,6 +469,7 @@ module Kitchen
468
469
  compression_level: data[:compression_level],
469
470
  keepalive: data[:keepalive],
470
471
  keepalive_interval: data[:keepalive_interval],
472
+ keepalive_maxcount: data[:keepalive_maxcount],
471
473
  timeout: data[:connection_timeout],
472
474
  connection_retries: data[:connection_retries],
473
475
  connection_retry_sleep: data[:connection_retry_sleep],
@@ -17,5 +17,5 @@
17
17
  # limitations under the License.
18
18
 
19
19
  module Kitchen
20
- VERSION = "2.3.0".freeze
20
+ VERSION = "2.3.1".freeze
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol