Sha256: 90f05872de707412111c6557b1bcd97ddbf8b65bdafc9443302b1d645dd37d2b

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

module RemoteUnix
  # common utilities which test cases can utilize
  class NetworkCommands
    include Common
    attr_accessor :network_info
    def initialize(params={})
      @ssh = SSH.new(params[:host], params[:user], params[:password])
      @network_info = RemoteUnix::NetworkInfo.new(@ssh) unless @network_info
      set_platform
    end
 
    # params={ :static => 'some ip',
    #          :dynamic => 'any value' --> just checks if key is present
    #          :netmask => 'some netmask'
    #          :gateway => 'some gateway'
    #          :device => proper interface..eth0, eth1, etc..
    def deb_update_interface(params={}) 
      
      unless @platform[:distro] == 'DEB'
        raise ArgumentError, "calling deb specific function on non debian distro"
      end
      
      if !@platform[:sudo]
        nav_path = [
                     {:execute => "",
                      :expected_output => /#{@expected_prompt}/i, :timeout => 1}
                                           
                   ]
      else      
        # TODO: nav_path different for sudo interaction
      end
    
      begin
        puts @ssh.navigate(nav_path).inspect
      rescue => e
        puts "IGNORE: #{e}"
      end
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qa_robusta-0.1.9 remote_unix/lib/network_commands.rb
qa_robusta-0.1.8 remote_unix/lib/network_commands.rb
qa_robusta-0.1.5 remote_unix/lib/network_commands.rb
qa_robusta-0.1.4 remote_unix/lib/network_commands.rb
qa_robusta-0.1.3 remote_unix/lib/network_commands.rb