1414
1515import contextlib
1616
17- from neutron_lib .api .definitions import portbindings
18- from neutron_lib .callbacks import exceptions as n_exc
1917from neutron_lib import constants as n_consts
2018from neutron_lib .objects import registry as obj_reg
2119from neutron_lib .plugins import utils
2220from neutron_lib .services .trunk import constants as trunk_consts
2321from oslo_utils import uuidutils
2422
2523from neutron .common .ovn import constants as ovn_const
26- from neutron .objects import ports as port_obj
2724from neutron .services .trunk import plugin as trunk_plugin
2825from neutron .tests .functional import base
2926
@@ -108,25 +105,6 @@ def test_trunk_create_with_subports(self):
108105 with self .trunk ([subport ]) as trunk :
109106 self ._verify_trunk_info (trunk , has_items = True )
110107
111- def test_trunk_create_parent_port_bound (self ):
112- with self .network () as network :
113- with self .subnet (network = network ) as subnet :
114- with self .port (subnet = subnet ) as parent_port :
115- pb = port_obj .PortBinding .get_objects (
116- self .context , port_id = parent_port ['port' ]['id' ])
117- port_obj .PortBinding .update_object (
118- self .context , {'vif_type' : portbindings .VIF_TYPE_OVS },
119- port_id = pb [0 ].port_id , host = pb [0 ].host )
120- tenant_id = uuidutils .generate_uuid ()
121- trunk = {'trunk' : {
122- 'port_id' : parent_port ['port' ]['id' ],
123- 'tenant_id' : tenant_id , 'project_id' : tenant_id ,
124- 'admin_state_up' : True ,
125- 'name' : 'trunk' , 'sub_ports' : []}}
126- self .assertRaises (n_exc .CallbackFailure ,
127- self .trunk_plugin .create_trunk ,
128- self .context , trunk )
129-
130108 def test_subport_add (self ):
131109 with self .subport () as subport :
132110 with self .trunk () as trunk :
@@ -149,14 +127,3 @@ def test_trunk_delete(self):
149127 with self .trunk () as trunk :
150128 self .trunk_plugin .delete_trunk (self .context , trunk ['id' ])
151129 self ._verify_trunk_info ({}, has_items = False )
152-
153- def test_trunk_delete_parent_port_bound (self ):
154- with self .trunk () as trunk :
155- bp = port_obj .PortBinding .get_objects (
156- self .context , port_id = trunk ['port_id' ])
157- port_obj .PortBinding .update_object (
158- self .context , {'vif_type' : portbindings .VIF_TYPE_OVS },
159- port_id = bp [0 ].port_id , host = bp [0 ].host )
160- self .assertRaises (n_exc .CallbackFailure ,
161- self .trunk_plugin .delete_trunk ,
162- self .context , trunk ['id' ])
0 commit comments