]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: catch exception during switch shutdown 15903/head
authorY Bharath <y.bharath@samsung.com>
Tue, 7 May 2024 15:01:03 +0000 (20:31 +0530)
committerY Bharath <y.bharath@samsung.com>
Wed, 25 Sep 2024 13:33:31 +0000 (19:03 +0530)
Signed-off-by: y-bharath14 <y.bharath@samsung.com>
tests/topotests/lib/topogen.py

index 7941e5c1d23337258aa7a475dab2cdc105db9f35..14dd61b077eba478c73cb6457cda6949919a1a0e 100644 (file)
@@ -492,7 +492,16 @@ class Topogen(object):
                 "Errors found post shutdown - details follow: {}".format(errors)
             )
 
-        self.net.stop()
+        try:
+            self.net.stop()
+
+        except OSError as error:
+            # OSError exception is raised when mininet tries to stop switch
+            # though switch is stopped once but mininet tries to stop same
+            # switch again, where it ended up with exception
+
+            logger.info(error)
+            logger.info("Exception ignored: switch is already stopped")
 
     def get_exabgp_cmd(self):
         if not self.exabgp_cmd: