summaryrefslogtreecommitdiff
path: root/morphlib/morphloader_tests.py
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-11-20 13:57:31 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-11-20 14:09:18 +0000
commitd5b0d37ad9343b8d66fe99648d305a41199d3920 (patch)
treedb3966aca61264e2ef2635bace6c4667bbd21abb /morphlib/morphloader_tests.py
parenta75e5121478e2a645c65d276cc20f3eb659222f4 (diff)
downloadmorph-d5b0d37ad9343b8d66fe99648d305a41199d3920.tar.gz
WIP Add support for multiple sources per chunkbaserock/tiagogomes/multiple-sources
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.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/morphlib/morphloader_tests.py b/morphlib/morphloader_tests.py
index 8039dfc9..3f1f7cbe 100644
--- a/morphlib/morphloader_tests.py
+++ b/morphlib/morphloader_tests.py
@@ -278,6 +278,63 @@ build-system: manual
morphlib.morphloader.InvalidStringError):
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
@@ -601,6 +658,7 @@ build-system: manual
'pre-strip-commands': None,
'post-strip-commands': None,
+ 'extra-sources': [],
'products': [],
'system-integration': [],
'devices': [],
@@ -654,6 +712,7 @@ build-system: manual
"morph": "bar",
'build-mode': 'bootstrap',
'build-depends': [],
+ 'extra-sources': [],
'prefix': '/usr',
},
],
@@ -670,6 +729,7 @@ build-system: manual
"ref": "bar",
'build-mode': 'staging',
'build-depends': [],
+ 'extra-sources': [],
'prefix': '/usr',
},
],