Skip to content

Commit ae0957c

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 724fa00 commit ae0957c

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
@@ -371,10 +371,13 @@ def test_root_rotation_max(self):
371371
def test_root_rotation_missing_keys(self):
372372
repository = repo_tool.load_repository(self.repository_directory)
373373

374-
# A partially written root.json (threshold = 1, and not signed in this
375-
# case) causes an invalid root chain later.
374+
# A partially written root.json (threshold = 2, and signed with only 1 key)
375+
# causes an invalid root chain later.
376+
repository.root.threshold = 2
377+
repository.root.load_signing_key(self.role_keys['root']['private'])
376378
repository.snapshot.load_signing_key(self.role_keys['snapshot']['private'])
377379
repository.timestamp.load_signing_key(self.role_keys['timestamp']['private'])
380+
378381
repository.write('root')
379382
repository.write('snapshot')
380383
repository.write('timestamp')
@@ -385,9 +388,9 @@ def test_root_rotation_missing_keys(self):
385388
os.path.join(self.repository_directory, 'metadata'))
386389

387390
# Create a new, valid root.json.
388-
repository.root.threshold = 2
391+
# Still not valid, because it is not written with a threshold of 2
392+
# previous keys
389393
repository.root.add_verification_key(self.role_keys['role1']['public'])
390-
repository.root.load_signing_key(self.role_keys['root']['private'])
391394
repository.root.load_signing_key(self.role_keys['role1']['private'])
392395

393396
repository.writeall()

0 commit comments

Comments
 (0)