Skip to content

Commit bebf19a

Browse files
committed
Update test_updater_root_rotation_integration
Modify test_root_rotation_missing_keys to not use an empty signing keys list. Signed-off-by: Teodora Sechkova <[email protected]>
1 parent 2738883 commit bebf19a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_updater_root_rotation_integration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,13 @@ def test_root_rotation_max(self):
357357
def test_root_rotation_missing_keys(self):
358358
repository = repo_tool.load_repository(self.repository_directory)
359359

360-
# A partially written root.json (threshold = 1, and not signed in this
361-
# case) causes an invalid root chain later.
360+
# A partially written root.json (threshold = 2, and signed with only 1 key)
361+
# causes an invalid root chain later.
362+
repository.root.threshold = 2
363+
repository.root.load_signing_key(self.role_keys['root']['private'])
362364
repository.snapshot.load_signing_key(self.role_keys['snapshot']['private'])
363365
repository.timestamp.load_signing_key(self.role_keys['timestamp']['private'])
366+
364367
repository.write('root')
365368
repository.write('snapshot')
366369
repository.write('timestamp')
@@ -371,9 +374,9 @@ def test_root_rotation_missing_keys(self):
371374
os.path.join(self.repository_directory, 'metadata'))
372375

373376
# Create a new, valid root.json.
374-
repository.root.threshold = 2
377+
# Still not valid, because it is not written with a threshold of 2
378+
# previous keys
375379
repository.root.add_verification_key(self.role_keys['role1']['public'])
376-
repository.root.load_signing_key(self.role_keys['root']['private'])
377380
repository.root.load_signing_key(self.role_keys['role1']['private'])
378381

379382
repository.writeall()

0 commit comments

Comments
 (0)