summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-11-15 14:39:40 +0100
committerValentin David <valentin.david@codethink.co.uk>2018-11-29 17:17:27 +0100
commit2259dff16fdd4257edd3bc8ba3e4b0ca7b054d77 (patch)
tree79592d0d52a8e2aaa14351b7fa63837d380941aa /tests
parent1c4b410f7e527cc7fa0efb5af909d9583511573e (diff)
downloadbuildstream-2259dff16fdd4257edd3bc8ba3e4b0ca7b054d77.tar.gz
Update mtimes of objects for requested references.
This also remove references when some objects are missing. This is in preparation for the move from reference to object garbage collection.
Diffstat (limited to 'tests')
-rw-r--r--tests/testutils/artifactshare.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/testutils/artifactshare.py b/tests/testutils/artifactshare.py
index 05e87a499..3319cb0a9 100644
--- a/tests/testutils/artifactshare.py
+++ b/tests/testutils/artifactshare.py
@@ -118,6 +118,15 @@ class ArtifactShare():
try:
tree = self.cas.resolve_ref(artifact_key)
+ reachable = set()
+ try:
+ self.cas._reachable_refs_dir(reachable, tree, update_mtime=False)
+ except FileNotFoundError:
+ return False
+ 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 False
return True
except ArtifactError:
return False