|
13 | 13 | import subprocess |
14 | 14 | import json |
15 | 15 | from infra.runner import ConcurrentRunner |
16 | | -from distutils.dir_util import copy_tree |
| 16 | +from distutils.dir_util import remove_tree, copy_tree |
17 | 17 | from infra.consortium import slurp_file |
18 | 18 | import infra.health_watcher |
19 | 19 | import time |
@@ -536,8 +536,9 @@ def test_recover_service_from_files( |
536 | 536 | os.path.dirname(os.path.realpath(__file__)), "testdata", directory |
537 | 537 | ) |
538 | 538 |
|
539 | | - old_common = os.path.join(service_dir, "common") |
540 | 539 | new_common = infra.network.get_common_folder_name(args.workspace, args.label) |
| 540 | + remove_tree(new_common) |
| 541 | + old_common = os.path.join(service_dir, "common") |
541 | 542 | copy_tree(old_common, new_common) |
542 | 543 |
|
543 | 544 | network = infra.network.Network(args.nodes, args.binary_dir) |
@@ -1078,16 +1079,26 @@ def run(args): |
1078 | 1079 | ), f"{service_status} service at seqno {seqno} did not start a new ledger chunk (started at {chunk_start_seqno})" |
1079 | 1080 |
|
1080 | 1081 | test_recover_service_from_files( |
1081 | | - args, "expired_service", expected_recovery_count=2, test_receipt=True |
| 1082 | + args, directory="expired_service", expected_recovery_count=2, test_receipt=True |
1082 | 1083 | ) |
1083 | 1084 | # sgx_service is historical ledger, from 1.x -> 2.x -> 3.x -> 5.x -> main. |
1084 | 1085 | # This is used to test recovery from SGX to SNP. |
1085 | 1086 | test_recover_service_from_files( |
1086 | | - args, "sgx_service", expected_recovery_count=4, test_receipt=False |
| 1087 | + args, directory="sgx_service", expected_recovery_count=4, test_receipt=False |
1087 | 1088 | ) |
1088 | 1089 |
|
1089 | 1090 | test_recover_service_from_files( |
1090 | | - args, "double_sealed_service", expected_recovery_count=2, test_receipt=False |
| 1091 | + args, |
| 1092 | + directory="double_sealed_service", |
| 1093 | + expected_recovery_count=2, |
| 1094 | + test_receipt=False, |
| 1095 | + ) |
| 1096 | + |
| 1097 | + test_recover_service_from_files( |
| 1098 | + args, |
| 1099 | + directory="cose_flipflop_service", |
| 1100 | + expected_recovery_count=0, |
| 1101 | + test_receipt=False, |
1091 | 1102 | ) |
1092 | 1103 |
|
1093 | 1104 |
|
|
0 commit comments