class Windows::Host

A windows host with cygwin tools installed

Attributes

scp_separator[R]

Public Class Methods

new(name, host_hash, options) click to toggle source
Calls superclass method Unix::Host::new
# File lib/beaker/host/windows.rb, line 54
def initialize name, host_hash, options
  super

  @ssh_server         = nil
  @scp_separator      = '\\'
  @external_copy_base = nil
end

Public Instance Methods

determine_ssh_server() click to toggle source

Determines which SSH Server is in use on this host

@return [Symbol] Value for the SSH Server in use

(:bitvise or :openssh at this point).
# File lib/beaker/host/windows.rb, line 38
def determine_ssh_server
  return @ssh_server if @ssh_server

  @ssh_server = :openssh
  status = execute('cmd.exe /c sc query BvSshServer', :accept_all_exit_codes => true)
  if status&.include?('4  RUNNING')
    @ssh_server = :bitvise
  else
    status = execute('cmd.exe /c sc qc sshd', :accept_all_exit_codes => true)
    @ssh_server = :win32_openssh if status&.include?('C:\\Windows\\System32\\OpenSSH\\sshd.exe')
  end
  @ssh_server
end
external_copy_base() click to toggle source
# File lib/beaker/host/windows.rb, line 27
def external_copy_base
  return @external_copy_base if @external_copy_base

  @external_copy_base = execute('echo `cygpath -smF 35`/')
  @external_copy_base
end
platform_defaults() click to toggle source
# File lib/beaker/host/windows.rb, line 18
def platform_defaults
  h = Beaker::Options::OptionsHash.new
  h.merge({
            'user' => 'Administrator',
            'group' => 'Administrators',
            'pathseparator' => ';',
          })
end