27
27
from oslo_utils import importutils
28
28
from oslo_utils import uuidutils
29
29
from pyroute2 .iproute import linux as iproute_linux
30
- import testscenarios
31
30
import testtools
32
31
33
32
from neutron .agent .common import async_process
@@ -697,19 +696,13 @@ def test_network_namespace_exists_ns_doesnt_exists_try_is_ready(self):
697
696
try_is_ready = True ))
698
697
699
698
700
- class IpMonitorTestCase (testscenarios .WithScenarios ,
701
- functional_base .BaseLoggingTestCase ):
702
-
703
- scenarios = [
704
- ('namespace' , {'namespace' : 'ns_' + uuidutils .generate_uuid ()}),
705
- ('no_namespace' , {'namespace' : None })
706
- ]
699
+ class IpMonitorTestCase (functional_base .BaseLoggingTestCase ):
707
700
708
701
def setUp (self ):
709
702
super (IpMonitorTestCase , self ).setUp ()
710
703
self .addCleanup (self ._cleanup )
711
- if self .namespace :
712
- priv_ip_lib .create_netns (self .namespace )
704
+ self .namespace = 'ns_' + uuidutils . generate_uuid ()
705
+ priv_ip_lib .create_netns (self .namespace )
713
706
self .devices = [('int_' + uuidutils .generate_uuid ())[
714
707
:constants .DEVICE_NAME_MAX_LEN ] for _ in range (5 )]
715
708
self .ip_wrapper = ip_lib .IPWrapper (self .namespace )
@@ -719,14 +712,7 @@ def setUp(self):
719
712
720
713
def _cleanup (self ):
721
714
self .proc .stop (kill_timeout = 10 , kill_signal = signal .SIGTERM )
722
- if self .namespace :
723
- priv_ip_lib .remove_netns (self .namespace )
724
- else :
725
- for device in self .devices :
726
- try :
727
- priv_ip_lib .delete_interface (device , self .namespace )
728
- except priv_ip_lib .NetworkInterfaceNotFound :
729
- pass
715
+ priv_ip_lib .remove_netns (self .namespace )
730
716
731
717
@staticmethod
732
718
def _normalize_module_name (name ):
0 commit comments