@@ -229,34 +229,23 @@ def _refresh_opcerts():
229
229
time .sleep (120 )
230
230
231
231
# check kes-period-info with an operational certificate with KES expired
232
- # TODO: the query is currently broken
233
- kes_query_currently_broken = False
234
- try :
235
- kes_info_expired = cluster .get_kes_period_info (
236
- opcert_file = expire_pool_rec ["pool_operational_cert" ]
232
+ kes_info_expired = cluster .get_kes_period_info (
233
+ opcert_file = expire_pool_rec ["pool_operational_cert" ]
234
+ )
235
+ kes .check_kes_period_info_result (
236
+ kes_output = kes_info_expired , expected_scenario = kes .KesScenarios .INVALID_KES_PERIOD
237
+ )
238
+
239
+ # check kes-period-info with valid operational certificates
240
+ for n in refreshed_nodes :
241
+ refreshed_pool_rec = cluster_manager .cache .addrs_data [f"node-{ n } " ]
242
+ kes_info_valid = cluster .get_kes_period_info (
243
+ opcert_file = refreshed_pool_rec ["pool_operational_cert" ]
237
244
)
238
- except clusterlib .CLIError as err :
239
- if "currentlyBroken" not in str (err ):
240
- raise
241
- kes_query_currently_broken = True
242
-
243
- if kes_query_currently_broken :
244
- pytest .xfail ("`query kes-period-info` is currently broken" )
245
- else :
246
245
kes .check_kes_period_info_result (
247
- kes_output = kes_info_expired , expected_scenario = kes .KesScenarios .INVALID_KES_PERIOD
246
+ kes_output = kes_info_valid , expected_scenario = kes .KesScenarios .ALL_VALID
248
247
)
249
248
250
- # check kes-period-info with valid operational certificates
251
- for n in refreshed_nodes :
252
- refreshed_pool_rec = cluster_manager .cache .addrs_data [f"node-{ n } " ]
253
- kes_info_valid = cluster .get_kes_period_info (
254
- opcert_file = refreshed_pool_rec ["pool_operational_cert" ]
255
- )
256
- kes .check_kes_period_info_result (
257
- kes_output = kes_info_valid , expected_scenario = kes .KesScenarios .ALL_VALID
258
- )
259
-
260
249
@allure .link (helpers .get_vcs_link ())
261
250
@pytest .mark .order (6 )
262
251
@pytest .mark .long
@@ -325,8 +314,6 @@ def test_opcert_future_kes_period( # noqa: C901
325
314
kes_period = cluster .get_kes_period () + 100 ,
326
315
)
327
316
328
- kes_query_currently_broken = False
329
-
330
317
with cluster_manager .restart_on_failure ():
331
318
with logfiles .expect_errors (expected_errors , ignore_file_id = cluster_manager .worker_id ):
332
319
# restart the node with the new operational certificate
@@ -351,19 +338,11 @@ def test_opcert_future_kes_period( # noqa: C901
351
338
if invalid_opcert_epoch == 1 :
352
339
# check kes-period-info with operational certificate with
353
340
# invalid `--kes-period`
354
- # TODO: the query is currently broken
355
- try :
356
- kes_period_info = cluster .get_kes_period_info (invalid_opcert_file )
357
- except clusterlib .CLIError as err :
358
- if "currentlyBroken" not in str (err ):
359
- raise
360
- kes_query_currently_broken = True
361
-
362
- if not kes_query_currently_broken :
363
- kes .check_kes_period_info_result (
364
- kes_output = kes_period_info ,
365
- expected_scenario = kes .KesScenarios .INVALID_KES_PERIOD ,
366
- )
341
+ kes_period_info = cluster .get_kes_period_info (invalid_opcert_file )
342
+ kes .check_kes_period_info_result (
343
+ kes_output = kes_period_info ,
344
+ expected_scenario = kes .KesScenarios .INVALID_KES_PERIOD ,
345
+ )
367
346
368
347
# test the `CounterOverIncrementedOCERT` error - the counter will now be +2 from
369
348
# last used opcert counter value
@@ -421,23 +400,20 @@ def test_opcert_future_kes_period( # noqa: C901
421
400
f"The pool '{ pool_name } ' has not minted any blocks since epoch { updated_epoch } ."
422
401
)
423
402
424
- if kes_query_currently_broken :
425
- pytest .xfail ("`query kes-period-info` is currently broken" )
426
- else :
427
- # check kes-period-info with valid operational certificate
428
- kes_period_info = cluster .get_kes_period_info (valid_opcert_file )
429
- kes .check_kes_period_info_result (
430
- kes_output = kes_period_info , expected_scenario = kes .KesScenarios .ALL_VALID
431
- )
403
+ # check kes-period-info with valid operational certificate
404
+ kes_period_info = cluster .get_kes_period_info (valid_opcert_file )
405
+ kes .check_kes_period_info_result (
406
+ kes_output = kes_period_info , expected_scenario = kes .KesScenarios .ALL_VALID
407
+ )
432
408
433
- # check kes-period-info with invalid operational certificate, wrong counter and period
434
- kes_period_info = cluster .get_kes_period_info (invalid_opcert_file )
435
- kes .check_kes_period_info_result (
436
- kes_output = kes_period_info ,
437
- expected_scenario = kes .KesScenarios .INVALID_KES_PERIOD
438
- if VERSIONS .cluster_era > VERSIONS .ALONZO
439
- else kes .KesScenarios .ALL_INVALID ,
440
- )
409
+ # check kes-period-info with invalid operational certificate, wrong counter and period
410
+ kes_period_info = cluster .get_kes_period_info (invalid_opcert_file )
411
+ kes .check_kes_period_info_result (
412
+ kes_output = kes_period_info ,
413
+ expected_scenario = kes .KesScenarios .INVALID_KES_PERIOD
414
+ if VERSIONS .cluster_era > VERSIONS .ALONZO
415
+ else kes .KesScenarios .ALL_INVALID ,
416
+ )
441
417
442
418
@allure .link (helpers .get_vcs_link ())
443
419
@pytest .mark .order (7 )
@@ -499,27 +475,18 @@ def test_update_valid_opcert(
499
475
time .sleep (10 )
500
476
501
477
# check kes-period-info while the pool is not minting blocks
502
- # TODO: the query is currently broken
503
- kes_query_currently_broken = False
504
- try :
505
- kes_period_info_new = cluster .get_kes_period_info (opcert_file )
506
- except clusterlib .CLIError as err :
507
- if "currentlyBroken" not in str (err ):
508
- raise
509
- kes_query_currently_broken = True
510
-
511
- if not kes_query_currently_broken :
512
- kes .check_kes_period_info_result (
513
- kes_output = kes_period_info_new , expected_scenario = kes .KesScenarios .ALL_VALID
514
- )
515
- kes_period_info_old = cluster .get_kes_period_info (opcert_file_old )
516
- kes .check_kes_period_info_result (
517
- kes_output = kes_period_info_old , expected_scenario = kes .KesScenarios .ALL_VALID
518
- )
519
- assert (
520
- kes_period_info_new ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
521
- == kes_period_info_old ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
522
- )
478
+ kes_period_info_new = cluster .get_kes_period_info (opcert_file )
479
+ kes .check_kes_period_info_result (
480
+ kes_output = kes_period_info_new , expected_scenario = kes .KesScenarios .ALL_VALID
481
+ )
482
+ kes_period_info_old = cluster .get_kes_period_info (opcert_file_old )
483
+ kes .check_kes_period_info_result (
484
+ kes_output = kes_period_info_old , expected_scenario = kes .KesScenarios .ALL_VALID
485
+ )
486
+ assert (
487
+ kes_period_info_new ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
488
+ == kes_period_info_old ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
489
+ )
523
490
524
491
# start the node with the new operational certificate
525
492
cluster_nodes .start_nodes ([node_name ])
@@ -543,26 +510,23 @@ def test_update_valid_opcert(
543
510
f"The pool '{ pool_name } ' has not minted any blocks since epoch { updated_epoch } ."
544
511
)
545
512
546
- if kes_query_currently_broken :
547
- pytest .xfail ("`query kes-period-info` is currently broken" )
548
- else :
549
- # check that metrics reported by kes-period-info got updated once the pool started
550
- # minting blocks again
551
- kes_period_info_updated = cluster .get_kes_period_info (opcert_file )
552
- kes .check_kes_period_info_result (
553
- kes_output = kes_period_info_updated , expected_scenario = kes .KesScenarios .ALL_VALID
554
- )
555
- assert (
556
- kes_period_info_updated ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
557
- != kes_period_info_old ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
558
- )
513
+ # check that metrics reported by kes-period-info got updated once the pool started
514
+ # minting blocks again
515
+ kes_period_info_updated = cluster .get_kes_period_info (opcert_file )
516
+ kes .check_kes_period_info_result (
517
+ kes_output = kes_period_info_updated , expected_scenario = kes .KesScenarios .ALL_VALID
518
+ )
519
+ assert (
520
+ kes_period_info_updated ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
521
+ != kes_period_info_old ["metrics" ]["qKesNodeStateOperationalCertificateNumber" ]
522
+ )
559
523
560
- # check kes-period-info with operational certificate with a wrong counter
561
- kes_period_info_invalid = cluster .get_kes_period_info (opcert_file_old )
562
- kes .check_kes_period_info_result (
563
- kes_output = kes_period_info_invalid ,
564
- expected_scenario = kes .KesScenarios .INVALID_COUNTERS ,
565
- )
524
+ # check kes-period-info with operational certificate with a wrong counter
525
+ kes_period_info_invalid = cluster .get_kes_period_info (opcert_file_old )
526
+ kes .check_kes_period_info_result (
527
+ kes_output = kes_period_info_invalid ,
528
+ expected_scenario = kes .KesScenarios .INVALID_COUNTERS ,
529
+ )
566
530
567
531
@allure .link (helpers .get_vcs_link ())
568
532
def test_no_kes_period_arg (
0 commit comments