Sha256: fc1bc54533703ca6db9c4b3a48cb82efc657436297a7d198102b6983982d3fa6

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

module Mac::Exec
  include Beaker::CommandFactory

  def touch(file, abs=true)
    (abs ? '/usr/bin/touch' : 'touch') + " #{file}"
  end

  # Restarts the SSH service
  #
  # @return [Result] result of starting SSH service
  def ssh_service_restart
    launch_daemons_plist = '/System/Library/LaunchDaemons/ssh.plist'
    exec(Beaker::Command.new("launchctl unload #{launch_daemons_plist}"))
    exec(Beaker::Command.new("launchctl load #{launch_daemons_plist}"))
  end

  # Sets the PermitUserEnvironment setting & restarts the SSH service
  #
  # @api private
  # @return [Result] result of the command starting the SSH service
  #   (from {#ssh_service_restart})
  def ssh_permit_user_environment
    ssh_config_file = '/etc/sshd_config'
    ssh_config_file = '/private/etc/ssh/sshd_config' if self['platform'] =~ /^osx-/

    exec(Beaker::Command.new("echo '\nPermitUserEnvironment yes' >> #{ssh_config_file}"))
    ssh_service_restart()
  end

  # Checks if selinux is enabled
  # selinux is not availble on OS X
  #
  # @return [Boolean] false
  def selinux_enabled?()
    false
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
beaker-4.21.0 lib/beaker/host/mac/exec.rb
beaker-4.20.0 lib/beaker/host/mac/exec.rb
beaker-4.19.0 lib/beaker/host/mac/exec.rb
beaker-4.18.0 lib/beaker/host/mac/exec.rb
beaker-4.17.0 lib/beaker/host/mac/exec.rb
beaker-4.16.0 lib/beaker/host/mac/exec.rb
beaker-4.15.0 lib/beaker/host/mac/exec.rb