diff options
| author | Russ White <russ@riw.us> | 2024-10-08 08:27:12 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-08 08:27:12 -0400 | 
| commit | 382e4e93384f2509e04755684a62c88169f45a51 (patch) | |
| tree | 7482e977dffa7fedccbf83dd8055feafe6d2a9f1 | |
| parent | 4bf780fce987e969d0c00b9de28314c37be0ad6b (diff) | |
| parent | 5118fd10184b14e8d2e1f1e9f5a858a907a1bd78 (diff) | |
Merge pull request #15903 from y-bharath14/srib-topotests-v1
tests: catch exception during switch shutdown
| -rw-r--r-- | tests/topotests/lib/topogen.py | 11 | 
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:  | 
