@@ -117,16 +117,12 @@ def test_queued_live_migration_abort_vm_status(self):
117
117
'/servers/%s/migrations/%s' % (self .server_b ['id' ],
118
118
serverb_migration ['id' ]))
119
119
self ._wait_for_migration_status (self .server_b , ['cancelled' ])
120
- # Unlock live migrations and confirm that server_a becomes
121
- # active again after successful live migration
120
+ # Unlock live migrations and confirm that both servers become
121
+ # active again after successful (server_a) and aborted
122
+ # (server_b) live migrations
122
123
self .lock_live_migration .release ()
123
124
self ._wait_for_state_change (self .server_a , 'ACTIVE' )
124
-
125
- # FIXME(artom) Assert the server_b never comes out of 'MIGRATING'
126
- self .assertRaises (
127
- AssertionError ,
128
- self ._wait_for_state_change , self .server_b , 'ACTIVE' )
129
- self ._wait_for_state_change (self .server_b , 'MIGRATING' )
125
+ self ._wait_for_state_change (self .server_b , 'ACTIVE' )
130
126
131
127
132
128
class LiveMigrationQueuedAbortTestLeftoversRemoved (LiveMigrationWithLockBase ):
@@ -182,36 +178,28 @@ def test_queued_live_migration_abort_leftovers_removed(self):
182
178
'/servers/%s/migrations/%s' % (self .server_b ['id' ],
183
179
migration_server_b ['id' ]))
184
180
self ._wait_for_migration_status (self .server_b , ['cancelled' ])
185
- # Unlock live migrations and confirm that server_a becomes
186
- # active again after successful live migration
181
+ # Unlock live migrations and confirm that both servers become
182
+ # active again after successful (server_a) and aborted
183
+ # (server_b) live migrations
187
184
self .lock_live_migration .release ()
188
185
self ._wait_for_state_change (self .server_a , 'ACTIVE' )
189
186
self ._wait_for_migration_status (self .server_a , ['completed' ])
190
- # FIXME(astupnikov) Assert the server_b never comes out of 'MIGRATING'
191
- # This should be fixed after bug #1949808 is addressed
192
- self ._wait_for_state_change (self .server_b , 'MIGRATING' )
187
+ self ._wait_for_state_change (self .server_b , 'ACTIVE' )
193
188
194
- # FIXME(astupnikov) Because of bug #1960412 allocations for aborted
195
- # queued live migration (server_b) would not be removed. Allocations
196
- # for completed live migration (server_a) should be empty.
189
+ # Allocations for both successful (server_a) and aborted queued live
190
+ # migration (server_b) should be removed.
197
191
allocations_server_a_migration = self .placement .get (
198
192
'/allocations/%s' % migration_server_a ['uuid' ]
199
193
).body ['allocations' ]
200
194
self .assertEqual ({}, allocations_server_a_migration )
201
195
allocations_server_b_migration = self .placement .get (
202
196
'/allocations/%s' % migration_server_b ['uuid' ]
203
197
).body ['allocations' ]
204
- src_uuid = self .api .api_get (
205
- 'os-hypervisors?hypervisor_hostname_pattern=%s' %
206
- self .src_hostname ).body ['hypervisors' ][0 ]['id' ]
207
- self .assertIn (src_uuid , allocations_server_b_migration )
208
-
209
- # FIXME(astupnikov) Because of bug #1960412 INACTIVE port binding
210
- # on destination host would not be removed when queued live migration
211
- # is aborted, so 2 port bindings would exist for server_b port from
212
- # Neutron's perspective.
213
- # server_a should be migrated to dest compute, server_b should still
214
- # be hosted by src compute.
198
+ self .assertEqual ({}, allocations_server_b_migration )
199
+
200
+ # INACTIVE port binding on destination host should be removed when
201
+ # queued live migration is aborted, so only 1 port binding would
202
+ # exist for ports attached to both servers.
215
203
port_binding_server_a = copy .deepcopy (
216
204
self .neutron ._port_bindings [self .neutron .port_1 ['id' ]]
217
205
)
@@ -220,4 +208,5 @@ def test_queued_live_migration_abort_leftovers_removed(self):
220
208
port_binding_server_b = copy .deepcopy (
221
209
self .neutron ._port_bindings [self .neutron .port_2 ['id' ]]
222
210
)
223
- self .assertEqual (2 , len (port_binding_server_b ))
211
+ self .assertEqual (1 , len (port_binding_server_b ))
212
+ self .assertNotIn ('dest' , port_binding_server_b )
0 commit comments