summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorY Bharath <y.bharath@samsung.com>2024-05-07 20:31:03 +0530
committerY Bharath <y.bharath@samsung.com>2024-09-25 19:03:31 +0530
commit5118fd10184b14e8d2e1f1e9f5a858a907a1bd78 (patch)
treea5088d18db1281b25895f6b411e542299b58bd63
parent2203dc4777a3b72c0be428de224e398e523809f2 (diff)
tests: catch exception during switch shutdown
Signed-off-by: y-bharath14 <y.bharath@samsung.com>
-rw-r--r--tests/topotests/lib/topogen.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py
index 7941e5c1d2..14dd61b077 100644
--- a/tests/topotests/lib/topogen.py
+++ b/tests/topotests/lib/topogen.py
@@ -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: