Fixing cleanup and setup
authorJesus Arechiga <jesus.arechiga@gmail.com>
Fri, 8 May 2015 17:55:42 +0000 (10:55 -0700)
committerJesus Arechiga <jesus.arechiga@gmail.com>
Tue, 12 May 2015 17:33:57 +0000 (10:33 -0700)
Change to switch initialization:
Making sure the interface is up after config by sending ifconfig up.
Otherwise If the interface had previously existed and brought down,
it never comes up and the  test case will fail.

Change to switch tear down:
Make sure to list down interfaces when deleting bridges, by using ifconfig -a modifier.
Otherwise if the interface is down (due to previous ifconfig down) the bridge is not deleted.

Also removing blank lines to pass tox test.

Change-Id: Ief23ca02d9f3bd0d14155642b517695ef23dcbe1
Signed-off-by: Jesus Arechiga <jesus.arechiga@gmail.com>
test/csit/libraries/SwitchClasses/Ovs.py

index c5c69dbd59be860c6bf59ff9d120000f3062d5c2..0b47d3f32461515dffa6d3d8f104b85f6b012caa 100644 (file)
@@ -31,7 +31,7 @@ class Ovs(BaseSwitch):
 
     @property
     def cleanup_cmds(self):
-        return ['/sbin/ifconfig | egrep \'^s\' | awk \'{print \"sudo ovs-vsctl del-br\",$1}\' | sh']
+        return ['/sbin/ifconfig -a | egrep \'^s\' | awk \'{print \"sudo ovs-vsctl del-br\",$1}\' | sh']
 
     @property
     def initialization_cmds(self):
@@ -41,7 +41,8 @@ class Ovs(BaseSwitch):
     def base_openflow_config(self):
         return ['sudo ovs-vsctl add-br s1',
                 'sudo ovs-vsctl set bridge s1 protocols=OpenFlow13',
-                'sudo ovs-vsctl set-controller s1 tcp:' + self.of_controller_ip]
+                'sudo ovs-vsctl set-controller s1 tcp:' + self.of_controller_ip,
+                'sudo ifconfig s1 up']
 
     @property
     def openflow_validation_cmd(self):