12
12
# License for the specific language governing permissions and limitations
13
13
# under the License.
14
14
15
- from unittest import mock
16
-
17
- from oslo_utils import uuidutils
18
-
19
15
from neutron .common .ovn import constants as ovn_const
20
16
from neutron .common .ovn import utils
21
17
from neutron .tests .functional import base
@@ -67,18 +63,16 @@ def test_non_existing(self):
67
63
class TestSyncHaChassisGroup (base .TestOVNFunctionalBase ):
68
64
69
65
def test_sync_ha_chassis_group (self ):
70
- plugin = mock .Mock ()
71
- plugin .get_network .return_value = {}
72
- network_id = uuidutils .generate_uuid ()
73
- hcg_name = utils .ovn_name (network_id )
66
+ net = self ._make_network (self .fmt , 'n1' , True )['network' ]
67
+ hcg_name = utils .ovn_name (net ['id' ])
74
68
chassis1 = self .add_fake_chassis ('host1' , azs = [],
75
69
enable_chassis_as_gw = True )
76
70
chassis2 = self .add_fake_chassis ('host2' , azs = [],
77
71
enable_chassis_as_gw = True )
78
72
self .add_fake_chassis ('host3' )
79
73
80
74
with self .nb_api .transaction (check_error = True ) as txn :
81
- utils .sync_ha_chassis_group (self .context , network_id , self .nb_api ,
75
+ utils .sync_ha_chassis_group (self .context , net [ 'id' ] , self .nb_api ,
82
76
self .sb_api , txn )
83
77
84
78
ha_chassis = self .nb_api .db_find ('HA_Chassis' ).execute (
@@ -100,7 +94,7 @@ def test_sync_ha_chassis_group(self):
100
94
# HA Chassis Group register but will update the "ha_chassis" list.
101
95
self .del_fake_chassis (chassis2 )
102
96
with self .nb_api .transaction (check_error = True ) as txn :
103
- utils .sync_ha_chassis_group (self .context , network_id , self .nb_api ,
97
+ utils .sync_ha_chassis_group (self .context , net [ 'id' ] , self .nb_api ,
104
98
self .sb_api , txn )
105
99
106
100
ha_chassis = self .nb_api .db_find ('HA_Chassis' ).execute (
0 commit comments