diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-06-14 15:14:41 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-06-14 15:14:41 +0000 |
commit | 3050d3c01db5c16622e7293f47f91e8b085da4cb (patch) | |
tree | f559548b151bd828285afe27439a5451fb499633 /morphlib/builder2_tests.py | |
parent | dfd9cae3248b36d489f638c5b1c3c3aa6c54c050 (diff) | |
download | morph-3050d3c01db5c16622e7293f47f91e8b085da4cb.tar.gz |
morphlib.builder2: write stratum metadata
Stratum metadata was getting lost because it is not part of the
chunks. Now metadata is written to the cache, then when the system
builder assembles the strata it copies the metadata in.
Diffstat (limited to 'morphlib/builder2_tests.py')
-rw-r--r-- | morphlib/builder2_tests.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/morphlib/builder2_tests.py b/morphlib/builder2_tests.py index 5a86fe75..6214891d 100644 --- a/morphlib/builder2_tests.py +++ b/morphlib/builder2_tests.py @@ -217,15 +217,31 @@ class BuilderBaseTests(unittest.TestCase): def test_downloads_depends(self): lac = FakeArtifactCache() - rac = FakeArtifactCache() - afacts = [FakeArtifact(name) for name in ('a', 'b', 'c')] - for a in afacts: + rac = FakeArtifactCache() + afacts = [FakeArtifact(name) for name in ('a', 'b', 'c')] + for a in afacts: fh = rac.put(a) fh.write(a.name) fh.close() - morphlib.builder2.download_depends(afacts, lac, rac) + morphlib.builder2.download_depends(afacts, lac, rac) self.assertTrue(all(lac.has(a) for a in afacts)) + def test_downloads_depends_metadata(self): + lac = FakeArtifactCache() + rac = FakeArtifactCache() + afacts = [FakeArtifact(name) for name in ('a', 'b', 'c')] + for a in afacts: + fh = rac.put(a) + fh.write(a.name) + fh.close() + fh = rac.put_artifact_metadata(a, 'meta') + fh.write('metadata') + fh.close() + morphlib.builder2.download_depends(afacts, lac, rac, ('meta',)) + self.assertTrue(all(lac.has(a) for a in afacts)) + self.assertTrue(all(lac.has_artifact_metadata(a, 'meta') + for a in afacts)) + class ChunkBuilderTests(unittest.TestCase): |