@@ -235,18 +235,31 @@ class TestRealms(MachineCase):
235
235
# should have stopped cert tracking
236
236
self .assertNotIn ("status:" , m .execute ("ipa-getcert list" ))
237
237
238
- # Send a wrong password
239
- b .click ("#system-info-domain a" )
240
- b .wait_popup ("realms-op" )
241
- b .set_val (self .op_address , "cockpit.lan" )
242
- b .wait_attr (self .op_admin , "placeholder" , 'e.g. "admin"' )
243
- b .set_val (self .op_admin , "admin" )
244
- b .set_val (self .op_admin_password , "foo" )
245
- b .click (".realms-op-apply" )
246
- b .wait_text_not (".realms-op-message" , "" )
247
- b .wait_not_visible (".realms-op-leave-only-row" )
248
- b .click (".realms-op-cancel" )
249
- b .wait_popdown ("realms-op" )
238
+ # Sometimes with some versions of realmd the Leave operation
239
+ # from above is still active in the realmd daemon. So we loop
240
+ # here until we get the expected error instead of "Already
241
+ # running another action".
242
+
243
+ tries = 0
244
+ while tries < 3 :
245
+ # Send a wrong password
246
+ b .click ("#system-info-domain a" )
247
+ b .wait_popup ("realms-op" )
248
+ b .set_val (self .op_address , "cockpit.lan" )
249
+ b .wait_attr (self .op_admin , "placeholder" , 'e.g. "admin"' )
250
+ b .set_val (self .op_admin , "admin" )
251
+ b .set_val (self .op_admin_password , "foo" )
252
+ b .click (".realms-op-apply" )
253
+ b .wait_text_not (".realms-op-message" , "" )
254
+ error = b .text (".realms-op-message" )
255
+ b .wait_not_visible (".realms-op-leave-only-row" )
256
+ b .click (".realms-op-cancel" )
257
+ b .wait_popdown ("realms-op" )
258
+ if not "Already running another action" in error :
259
+ break
260
+ print ("Another operation running, retry" )
261
+ time .sleep (20 )
262
+ tries += 1
250
263
251
264
# Try to join a non-existing domain
252
265
b .click ("#system-info-domain a" )
0 commit comments