test-kitchen 2.8.0 → 2.9.0

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
  SHA256:
3
- metadata.gz: b776d094e27dc25c3f569ad96100866c9015d60593d9d99b54e30b8b6b0e4b03
4
- data.tar.gz: 598635116f83455b7852cee81a77efc907f6ea2a9c52f8312526b9a7e6ca0922
3
+ metadata.gz: 58365d9f59d1210a1c8f56f7fe095f285fde61e6251c61b164569b783d75d6f8
4
+ data.tar.gz: ceef4069cb15be71c35992173d3d347717f8149dc3a7fe2f4863e5a8aaac98c5
5
5
  SHA512:
6
- metadata.gz: ae5d8636e834c68d3565a73b9cb5a3af46246fb9b2427a80166716366cd254947049667a80a23c569f1f9eda26eb28bac4bc50fbb8eceaf55fa54cf5548a6554
7
- data.tar.gz: d91650528d01dcac17ad882cfd260d41b2d7c1ce3118aa0a8ddecfafd935ed1b237cf5507067a512ef5fe7dc003e23d57983f5f5f5cde994e5766a02385ea8af
6
+ metadata.gz: bf9e9206b2b78a39fa9fdeca2104e3cf17fed69821644f0055e7638e23a15f50dc11c9923718e5cb997d9a2ef416bbe2e48649fc6d6e7c02fd8627fbbe86f6b1
7
+ data.tar.gz: 86102634d2ad1b336cd5e18fdfe005ea7ef18f77e185351f041567aeb32b224609e457ca6904ea865bb18f278e836fdca4ae9afedff1877dd71564ed17d54d1b
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
 
18
18
  # CI tests fail without an explicit unconditional require of Thor
19
- require "thor" # rubocop:disable ChefRuby/UnlessDefinedRequire
19
+ require "thor" # rubocop:disable Chef/Ruby/UnlessDefinedRequire
20
20
 
21
21
  require_relative "../kitchen"
22
22
  require_relative "generator/init"
@@ -146,7 +146,7 @@ module Kitchen
146
146
  end
147
147
  end
148
148
  logger.fatal("The `chef` executable cannot be found in your " \
149
- "PATH. Ensure you have installed ChefDK or Chef Workstation " \
149
+ "PATH. Ensure you have installed Chef Workstation " \
150
150
  "from https://downloads.chef.io and that your PATH " \
151
151
  "setting includes the path to the `chef` command.")
152
152
  raise UserError,
@@ -308,16 +308,20 @@ module Kitchen
308
308
 
309
309
  # Builds a `LoginCommand` for use by Linux-based platforms.
310
310
  #
311
- # TODO: determine whether or not `desktop` exists
312
- #
313
311
  # @return [LoginCommand] a login command
314
312
  # @api private
315
313
  def login_command_for_linux
316
- args = %W{-u #{options[:user]}}
317
- args += %W{-p #{options[:password]}} if options.key?(:password)
318
- args += %W{#{URI.parse(options[:endpoint]).host}:#{rdp_port}}
314
+ xfreerdp = Util.command_exists? "xfreerdp"
315
+ unless xfreerdp
316
+ raise WinrmFailed, "xfreerdp binary not found. Please install freerdp2-x11 on Debian-based systems or freerdp on Redhat-based systems."
317
+ end
318
+
319
+ args = %W{/u:#{options[:user]}}
320
+ args += %W{/p:#{options[:password]}} if options.key?(:password)
321
+ args += %W{/v:#{URI.parse(options[:endpoint]).host}:#{rdp_port}}
322
+ args += %W{/cert-tofu} # always accept certificate
319
323
 
320
- LoginCommand.new("rdesktop", args)
324
+ LoginCommand.new(xfreerdp, args)
321
325
  end
322
326
 
323
327
  # Builds a `LoginCommand` for use by Mac-based platforms.
@@ -215,5 +215,15 @@ module Kitchen
215
215
  def self.snake_case(a_string)
216
216
  Thor::Util.snake_case(a_string)
217
217
  end
218
+
219
+ # Check if a cmd exists on the PATH
220
+ def self.command_exists?(cmd)
221
+ paths = ENV["PATH"].split(File::PATH_SEPARATOR) + [ "/bin", "/usr/bin", "/sbin", "/usr/sbin" ]
222
+ paths.each do |path|
223
+ filename = File.join(path, cmd)
224
+ return filename if File.executable?(filename)
225
+ end
226
+ false
227
+ end
218
228
  end
219
229
  end
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
 
18
18
  module Kitchen
19
- VERSION = "2.8.0".freeze
19
+ VERSION = "2.9.0".freeze
20
20
  end
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: 2.8.0
4
+ version: 2.9.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: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout