Module: Unix::Exec

Includes:
Beaker::CommandFactory
Included in:
Mac::Host, Host
Defined in:
lib/beaker/host/unix/exec.rb

Instance Attribute Summary

Attributes included from Beaker::CommandFactory

#assertions

Instance Method Summary collapse

Methods included from Beaker::CommandFactory

#execute, #fail_test

Instance Method Details

#echo(msg, abs = true) ⇒ Object



4
5
6
# File 'lib/beaker/host/unix/exec.rb', line 4

def echo(msg, abs=true)
  (abs ? '/bin/echo' : 'echo') + " #{msg}"
end

#get_ipObject



16
17
18
19
20
21
22
# File 'lib/beaker/host/unix/exec.rb', line 16

def get_ip
  if self['platform'].include?('solaris') || self['platform'].include?('osx')
    execute("ifconfig -a inet| awk '/broadcast/ {print $2}' | cut -d/ -f1 | head -1").strip
  else
    execute("ip a|awk '/global/{print$2}' | cut -d/ -f1 | head -1").strip
  end
end

#pathObject



12
13
14
# File 'lib/beaker/host/unix/exec.rb', line 12

def path
  '/bin:/usr/bin'
end

#touch(file, abs = true) ⇒ Object



8
9
10
# File 'lib/beaker/host/unix/exec.rb', line 8

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