Skip to content

netns: unify its use in prepare.py; try to delete existing before creation

David Jaša requested to merge dj/prepare-fix-ns-cleanups into main

Mainly handling netns's in prepare.py:

  • always set cleanups before creation. This way, if one scenario fails on duplicate NS, it will get cleaned in After Scenario and others won't get affected anymore
  • fixed typo in NS name in cleanup which could leave NS uncleaned
  • unified NS creation to combo of nmci.cleanup.add_namespace() and nmci.ip.netns_add()

To the discussion: should nmci.ip.netns_add() check for presence of a NS with conflicting name?

Further ideas:

  • does it fit into current NMCI structure to add cleanup=True parameter to nmci.ip.netns_add() so it is not prone to flipping the order of cleanup and addition itself?
  • given that this causes repeated red CI, shouldn't we do an extra check after cleanups that all the custom NSs are indeed cleaned up before going on?

@RunTests:*

Merge request reports

Loading