diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-11-20 13:57:31 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-25 21:02:33 +0000 |
commit | ddb8b27d5056074013a89d8ab277e39fdc1f069d (patch) | |
tree | 5ecf61560608dbea1ec1895e5cff2622959556b7 /morphlib/morphloader_tests.py | |
parent | 9404317020ff0455cbfd3ca7976d546af823759b (diff) | |
download | morph-ddb8b27d5056074013a89d8ab277e39fdc1f069d.tar.gz |
WIP Add support for multiple sources per chunk
TODO:
- Add API to the cache server to retrieve a submodule commit from a
given path.
- Fix cross-bootstrap command.
Change-Id: I3475c2bcb648a272fee33bc878a521f79d4e6581
Diffstat (limited to 'morphlib/morphloader_tests.py')
-rw-r--r-- | morphlib/morphloader_tests.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/morphlib/morphloader_tests.py b/morphlib/morphloader_tests.py index db22264f..0bf69612 100644 --- a/morphlib/morphloader_tests.py +++ b/morphlib/morphloader_tests.py @@ -244,6 +244,63 @@ build-system: manual morphlib.morphloader.EmptyRefError): self.loader.validate(m) + def test_fails_to_validate_stratum_with_a_missing_path(self): + m = morphlib.morphology.Morphology({ + 'kind': 'stratum', + 'name': 'foo', + 'build-depends': [], + 'chunks': [ + { + 'name': 'chunk', + 'repo': 'test:repo', + 'ref': 'master', + 'build-system': 'manual', + 'build-depends': [], + 'extra-sources': + [ + { + 'repo': 'foo', + 'path': 'somepath', + 'extra-sources': + [ + { + 'repo': 'bar', + 'ref': 'master' + } + ] + } + ] + } + ] + }) + self.assertRaises( + morphlib.morphloader.MissingFieldError, self.loader.validate, m) + + def test_fails_to_validate_stratum_with_invalid_path(self): + m = morphlib.morphology.Morphology({ + 'kind': 'stratum', + 'name': 'foo', + 'build-depends': [], + 'chunks': [ + { + 'name': 'chunk', + 'repo': 'test:repo', + 'ref': 'master', + 'build-system': 'manual', + 'build-depends': [], + 'extra-sources': + [ + { + 'repo': 'foo', + 'path': '../foo' + } + ] + } + ] + }) + self.assertRaises( + morphlib.morphloader.InvalidPathError, self.loader.validate, m) + def test_fails_to_validate_stratum_which_build_depends_on_self(self): text = '''\ name: bad-stratum @@ -567,6 +624,7 @@ build-system: manual 'pre-strip-commands': None, 'post-strip-commands': None, + 'extra-sources': [], 'products': [], 'system-integration': [], 'devices': [], @@ -606,6 +664,7 @@ build-system: manual "morph": "bar", 'build-mode': 'bootstrap', 'build-depends': [], + 'extra-sources': [], 'prefix': '/usr', }, ], |