Skip to content

Commit ba6ffde

Browse files
committed
updating the comments based on the feedbacks.
1 parent 79e0bc6 commit ba6ffde

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

client/client_test.go

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ func (s *ClientSuite) TestUpdateRoots(c *C) {
423423
expectedVersions map[string]int
424424
}{
425425
<<<<<<< HEAD
426+
<<<<<<< HEAD
426427
<<<<<<< HEAD
427428
// Succeeds when there is no root update.
428429
{"testdata/Published1Time", nil, map[string]int{"root": 1, "timestamp": 1, "snapshot": 1, "targets": 1}},
@@ -497,36 +498,34 @@ func (s *ClientSuite) TestUpdateRoots(c *C) {
497498
// (10) Fails updating root to 2.root.json when the value of the version field inside it is 3 (rollforward attack prevention).
498499

499500
// Test (1)
501+
=======
502+
// Succeeds when there is no root update.
503+
>>>>>>> 2a38d97 (updating the comments based on the feedbacks.)
500504
{"testdata/Published1Time", nil, map[string]int{"root": 1, "timestamp": 1, "snapshot": 1, "targets": 1}},
501-
// Test (2)
505+
// Succeeds updating root from version 1 to version 2.
502506
{"testdata/Published2Times_keyrotated", nil, map[string]int{"root": 2, "timestamp": 1, "snapshot": 1, "targets": 1}},
503-
// Test (3)
507+
// Succeeds updating root from version 1 to version 2 when the client's initial root version is expired.
504508
{"testdata/Published2Times_keyrotated_initialrootexpired", nil, map[string]int{"root": 2, "timestamp": 1, "snapshot": 1, "targets": 1}},
505-
// Test (4)
509+
// Succeeds updating root from version 1 to version 3 when versions 1 and 2 are expired.
506510
{"testdata/Published3Times_keyrotated_initialrootsexpired", nil, map[string]int{"root": 3, "timestamp": 1, "snapshot": 1, "targets": 1}},
507-
// Test(5)
511+
// Succeeds updating root from version 2 to version 3.
508512
{"testdata/Published3Times_keyrotated_initialrootsexpired_clientversionis2", nil, map[string]int{"root": 3, "timestamp": 1, "snapshot": 1, "targets": 1}},
509-
// Test (6)
513+
// Fails updating root from version 1 to version 3 when versions 1 and 3 are expired but version 2 is not expired.
510514
{"testdata/Published3Times_keyrotated_latestrootexpired", ErrDecodeFailed{File: "root.json", Err: verify.ErrExpired{}}, map[string]int{"root": 2, "timestamp": 1, "snapshot": 1, "targets": 1}},
511-
// Test (7)
515+
// Fails updating root from version 1 to version 2 when old root 1 did not sign off on it (nth root didn't sign off n+1).
512516
{"testdata/Published2Times_keyrotated_invalidOldRootSignature", errors.New("tuf: signature verification failed"), map[string]int{}},
513-
// Test (8)
517+
// Fails updating root from version 1 to version 2 when the new root 2 did not sign itself (n+1th root didn't sign off n+1)
514518
{"testdata/Published2Times_keyrotated_invalidNewRootSignature", errors.New("tuf: signature verification failed"), map[string]int{}},
515-
// Test (9)
519+
// Fails updating root to 2.root.json when the value of the version field inside it is 1 (rollback attack prevention).
516520
{"testdata/Published1Time_backwardRootVersion", verify.ErrWrongVersion(verify.ErrWrongVersion{Given: 1, Expected: 2}), map[string]int{}},
517-
// Test (10)
521+
// Fails updating root to 2.root.json when the value of the version field inside it is 3 (rollforward attack prevention).
518522
{"testdata/Published3Times_keyrotated_forwardRootVersion", verify.ErrWrongVersion(verify.ErrWrongVersion{Given: 3, Expected: 2}), map[string]int{}},
519523

520-
// Test cases for checking the version of non-root metadata after their key is being rotated:
521-
// (i) snapshot role key rotation increase the snapshot and timestamp.
522-
// (ii) targets role key rotation increase the snapshot, timestamp, and targets.
523-
// (iii) timestamp role key rotation increase the timestamp.
524-
525-
// Test (i)
524+
// snapshot role key rotation increase the snapshot and timestamp.
526525
{"testdata/Published2Times_snapshot_keyrotated", nil, map[string]int{"root": 2, "timestamp": 2, "snapshot": 2, "targets": 1}},
527-
// Test (ii)
526+
// targets role key rotation increase the snapshot, timestamp, and targets.
528527
{"testdata/Published2Times_targets_keyrotated", nil, map[string]int{"root": 2, "timestamp": 2, "snapshot": 2, "targets": 2}},
529-
// Test (iii)
528+
// timestamp role key rotation increase the timestamp.
530529
{"testdata/Published2Times_timestamp_keyrotated", nil, map[string]int{"root": 2, "timestamp": 2, "snapshot": 1, "targets": 1}},
531530
>>>>>>> 68a35d0 (update fixtures and clarify test comments.)
532531
}

0 commit comments

Comments
 (0)