diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-03-21 12:45:38 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-29 10:38:53 +0000 |
commit | 35616512815cc3edc22b7aab128744a81b21c32f (patch) | |
tree | 7f6af21e9100e71690a1b7b016aa6b62fcdbcf25 /tests | |
parent | d20165a62536e526deb0fc32819e1d3776e75590 (diff) | |
download | buildstream-35616512815cc3edc22b7aab128744a81b21c32f.tar.gz |
_cas/cascache.py: Add opt check_exists arg to _reachable_refs_dir()
By default the reachable set() includes all file digests from a
given reachable directory/tree digest, however this does not
guarantee the file objects are actually reachable.
testutils/artifactshare.py has_artifact() ascertained if a given
artifact is available by ensuring any 'reachable' digests are
actually on the filesystem, this is made redudant with the optional
check_exists objpath check during the reachable set creation.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testutils/artifactshare.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/testutils/artifactshare.py b/tests/testutils/artifactshare.py index 0fca42a6c..6c484ceb7 100644 --- a/tests/testutils/artifactshare.py +++ b/tests/testutils/artifactshare.py @@ -149,13 +149,9 @@ class ArtifactShare(): tree = self.cas.resolve_ref(artifact_key) reachable = set() try: - self.cas._reachable_refs_dir(reachable, tree, update_mtime=False) + self.cas._reachable_refs_dir(reachable, tree, update_mtime=False, check_exists=True) except FileNotFoundError: return None - for digest in reachable: - object_name = os.path.join(self.cas.casdir, 'objects', digest[:2], digest[2:]) - if not os.path.exists(object_name): - return None return tree except CASError: return None |