Class: PSWindows::Host

Inherits:
Windows::Host show all
Includes:
Exec, File, Group, Pkg, User
Defined in:
lib/beaker/host/pswindows.rb

Constant Summary

Constants included from Exec

Exec::ABS_CMD, Exec::CMD

Constants included from Windows::Exec

Windows::Exec::ABS_CMD, Windows::Exec::CMD

Constants inherited from Beaker::Host

Beaker::Host::SELECT_TIMEOUT

Instance Attribute Summary collapse

Attributes included from Beaker::CommandFactory

#assertions

Attributes inherited from Beaker::Host

#host_hash, #logger, #name, #options

Instance Method Summary collapse

Methods included from Pkg

#check_for_command, #check_for_package, #determine_if_x86_64, #install_package, #uninstall_package

Methods included from Beaker::CommandFactory

#execute, #fail_test

Methods included from Exec

#add_env_var, #clear_env_var, #delete_env_var, #echo, #environment_string, #environment_variable_string_pair_array, #get_env_var, #get_ip, #mkdir_p, #mv, #path, #ping, #reboot, #rm_rf, #ssh_permit_user_environment, #ssh_set_user_environment, #touch

Methods included from Beaker::DSL::Wrappers

#encode_command, #powershell

Methods included from File

#file_exist?, #path_split, #tmpdir, #tmpfile

Methods included from Group

#group_absent, #group_get, #group_gid, #group_list, #group_present

Methods included from User

#user_absent, #user_get, #user_list, #user_present

Methods inherited from Windows::Host

#determine_ssh_server, #platform_defaults

Methods included from Windows::Pkg

#check_for_command, #check_for_package, #determine_if_x86_64, #install_package, #pe_puppet_agent_promoted_package_info, #puppet_agent_dev_package_info, #uninstall_package

Methods included from Windows::Exec

#cygwin_installed?, #echo, #get_ip, #path, #ping, #prepend_commands, #reboot, #selinux_enabled?, #ssh_permit_user_environment, #ssh_service_restart, #touch

Methods included from Windows::File

#file_exist?, #path_split, #scp_path, #tmpdir, #tmpfile

Methods included from Windows::Group

#group_absent, #group_get, #group_gid, #group_list, #group_present

Methods included from Windows::User

#user_absent, #user_get, #user_list, #user_present

Methods inherited from Unix::Host

#determine_ssh_server, #platform_defaults, #skip_set_env?, #validate_setup

Methods included from Unix::Pkg

#check_for_command, #check_for_package, #determine_if_x86_64, #extract_rpm_proxy_options, #install_local_package, #install_package, #install_package_with_rpm, #pe_puppet_agent_promoted_package_info, #pe_puppet_agent_promoted_package_install, #pkg_initialize, #puppet_agent_dev_package_info, #solaris_install_local_package, #solaris_puppet_agent_dev_package_info, #uncompress_local_tarball, #uninstall_package, #update_apt_if_needed, #upgrade_package

Methods included from Unix::Exec

#add_env_var, #clear_env_var, #delete_env_var, #echo, #environment_string, #environment_variable_string_pair_array, #get_env_var, #get_ip, #mirror_env_to_profile_d, #mkdir_p, #mv, #path, #ping, #prepend_commands, #reboot, #rm_rf, #selinux_enabled?, #ssh_permit_user_environment, #ssh_service_restart, #ssh_set_user_environment, #touch

Methods included from Unix::File

#file_exist?, #noask_file_text, #package_config_dir, #path_split, #repo_filename, #repo_type, #scp_path, #tmpdir, #tmpfile

Methods included from Unix::Group

#group_absent, #group_get, #group_gid, #group_list, #group_present

Methods included from Unix::User

#user_absent, #user_get, #user_list, #user_present

Methods inherited from Beaker::Host

#+, #[], #[]=, #close, #connection, create, #delete, #do_rsync_to, #do_scp_from, #do_scp_to, #exec, #get_ip, #get_public_ip, #graceful_restarts?, #has_key?, #hostname, #ip, #is_cygwin?, #is_pe?, #is_powershell?, #is_using_passenger?, #is_x86_64?, #log_prefix, #node_name, #pkg_initialize, #platform, #port_open?, #puppet_configprint, #reachable_name, #to_s, #to_str, #up?, #use_service_scripts?, #uses_passenger!, #wait_for_port

Methods included from Beaker::DSL::Patterns

#block_on

Methods included from Beaker::DSL::Helpers::HoconHelpers

#hocon_file_edit_in_place_on, #hocon_file_edit_on, #hocon_file_read_on

Methods included from Beaker::DSL::Helpers::WebHelpers

#link_exists?, #port_open_within?

Methods included from Beaker::DSL::Helpers::TestHelpers

#current_step_name, #current_test_filename, #current_test_name, #set_current_step_name, #set_current_test_filename, #set_current_test_name

Methods included from Beaker::DSL::Helpers::HostHelpers

#add_system32_hosts_entry, #archive_file_from, #backup_the_file, #check_for_package, #create_remote_file, #create_tmpdir_on, #curl_on, #curl_with_retries, #echo_on, #execute_powershell_script_on, #exit_code, #install_package, #on, #retry_on, #rsync_to, #run_script, #run_script_on, #scp_from, #scp_to, #shell, #stderr, #stdout, #upgrade_package

Constructor Details

#initialize(name, host_hash, options) ⇒ Host

Returns a new instance of Host



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/beaker/host/pswindows.rb', line 25

def initialize name, host_hash, options
  super

  @scp_separator = '/'
  # %TEMP% == C:\Users\ADMINI~1\AppData\Local\Temp
  # is a user temp path, not the system path.  Also, it doesn't work, there's
  # probably an issue with the `ADMINI~1` section
  @system_temp_path = 'C:\\Windows\\Temp'
  @external_copy_base = nil
  # @external_copy_base = '/programdata'
end

Instance Attribute Details

#scp_separatorObject (readonly)

attr_reader :network_separator, :external_copy_base, :system_temp_path



24
25
26
# File 'lib/beaker/host/pswindows.rb', line 24

def scp_separator
  @scp_separator
end

#system_temp_pathObject (readonly)

attr_reader :network_separator, :external_copy_base, :system_temp_path



24
25
26
# File 'lib/beaker/host/pswindows.rb', line 24

def system_temp_path
  @system_temp_path
end

Instance Method Details

#external_copy_baseObject



17
18
19
20
21
# File 'lib/beaker/host/pswindows.rb', line 17

def external_copy_base
  return @external_copy_base if @external_copy_base
  @external_copy_base = execute('for %I in (%ALLUSERSPROFILE%) do @echo %~I')
  @external_copy_base
end