Skip to content

Commit

Permalink
Merge "add method required for 26a1619255eb9eced467fd522c6b2dff80bef0…
Browse files Browse the repository at this point in the history
…b1:get the interface name through IP" into R3.0
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 21, 2016
2 parents 8ddb938 + abb72f7 commit 57a970c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fixtures/vm_test.py
Expand Up @@ -2406,6 +2406,18 @@ def get_vm_interface_name(self, mac_address=None):
return name
# end get_vm_interface_name

def get_vm_interface_list(self, ip=None):
'''if ip is None, returns all interfaces list.
this method should work on ubuntu as well as redhat and centos'''

cmd = 'ifconfig -a'
if ip:
cmd = cmd + '| grep %s -A2 -B4' % (ip)
cmd = cmd + '| grep -i \'hwaddr\|flags\' | awk \'{print $1}\' | cut -d \':\' -f 1'
name = self.run_cmd_on_vm([cmd])[cmd].splitlines()

return name

def arping(self, ip, interface=None):
if not interface:
interface_mac = self.mac_addr.values()[0]
Expand Down

0 comments on commit 57a970c

Please sign in to comment.