Merge pull request #743 from theupdateframework/edit_comment_test_indefinite

Add test 3 to summary of conducted tests
This commit is contained in:
Vladimir Diaz 2018-06-12 11:16:15 -04:00 committed by GitHub
commit 677f7d3cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -241,12 +241,15 @@ def test_without_tuf(self):
def test_with_tuf(self):
# Two tests are conducted here.
# Three tests are conducted here.
#
# Test 1: If we find that the timestamp acquired from a mirror indicates
# that there is no new snapshot file, and our current snapshot
# file is expired, is it recognized as such?
# Test 2: If an expired timestamp is downloaded, is it recognized as such?
# Test 3: If an expired Snapshot is downloaded, is it (1) rejected? (2) the
# local Snapshot file deleted? (3) and is the client able to recover when
# given a new, valid Snapshot?
# Test 1 Begin:
@ -492,6 +495,7 @@ def test_with_tuf(self):
shutil.copytree(os.path.join(self.repository_directory, 'metadata.staged'),
os.path.join(self.repository_directory, 'metadata'))
# Verify that the client accepts the valid metadata file.
self.repository_updater.refresh()
self.assertTrue('snapshot' in self.repository_updater.metadata['current'])
self.assertEqual(sorted(['root', 'targets', 'timestamp', 'snapshot']),