From: Kailash Khalasi Date: Wed, 10 Jun 2015 17:45:43 +0000 (+0000) Subject: Changing the way the mac addrs is extracted from OVS switches. X-Git-Tag: release/lithium~56 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=3682c148c7433fe09259e34f9c99cd9747bd1b01;p=integration.git Changing the way the mac addrs is extracted from OVS switches. Since the "s1" interface and "s1" is hard-coded, this is a safer approach. On Fedora, I found that the mac addr wasnt being extracted(but worked for Ubuntu). This command will work for both platforms, and others as it uses regular expression. Change-Id: I008b1a3681eabdace6fbe26346750fb3b1169f7d Signed-off-by: Kailash Khalasi (cherry picked from commit ea8419aaafb07e6599cfcf26b4b0f5ddaf88c423) --- diff --git a/test/csit/libraries/SwitchClasses/Ovs.py b/test/csit/libraries/SwitchClasses/Ovs.py index 0b47d3f3..58b13c42 100644 --- a/test/csit/libraries/SwitchClasses/Ovs.py +++ b/test/csit/libraries/SwitchClasses/Ovs.py @@ -1,5 +1,5 @@ """ -Provision 3800 Object Definition +Open vSwitch Object Definition Authors: james.luhrsen@hp.com Created: 2014-10-02 """ @@ -86,7 +86,8 @@ class Ovs(BaseSwitch): @property def datapath_id_output_command(self): - return '/sbin/ifconfig | egrep \'^s1\' | awk \'{print $5}\'' + '''This regex will extract the macaddr of the ovs switch''' + return '/sbin/ifconfig s1 | grep -o -E "([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}"' datapath_id_output_string = '' datapath_id = ''