netns: unify its use in prepare.py; try to delete existing before creation
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()
andnmci.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 tonmci.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:*