diff options
| author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-11-14 17:07:06 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-21 11:49:23 +0000 |
| commit | 0b6859cdf3a4b66bb8b94361681a5b6b362f93ae (patch) | |
| tree | 37bf5c650e99b023bd0e0605b63a53cc0ebd0b72 /bitbake/lib/toaster/orm/tests.py | |
| parent | 5b0616ad7d7c3734f1818a56b631a2d254271678 (diff) | |
| download | poky-0b6859cdf3a4b66bb8b94361681a5b6b362f93ae.tar.gz | |
bitbake: toastergui: layer name correlation
This patch modifies how layers are identified and matched.
Layers were primarely organized by the source of layer information,
and Releases were separated by both layer git branches and originating
source of layer information. This setup prevented mixing layers from
different sources for a certain release, which didn't match the way
people use Yocto Project / bitbake.
This patch brings name-based indentification, where layers with the
same name are assumed to be equivalent, in the sense of being able
to substitute one another. To facilitate this identification to
humans, layers are differentiated by GIT URI instead of layer sources,
which was a rather arbitrary abstraction.
Additional changes include modification to models in order accomodate
for the new data structure, and to config file loading to match
the new toasterconf.json layout.
(Bitbake rev: 4357200aed522ad56cfd84917f877645b83b6a70)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/tests.py')
| -rw-r--r-- | bitbake/lib/toaster/orm/tests.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/orm/tests.py b/bitbake/lib/toaster/orm/tests.py index f2f561bff9..b965d8e50e 100644 --- a/bitbake/lib/toaster/orm/tests.py +++ b/bitbake/lib/toaster/orm/tests.py | |||
| @@ -1,16 +1,19 @@ | |||
| 1 | from django.test import TestCase | 1 | from django.test import TestCase |
| 2 | from orm.models import LocalLayerSource, LayerIndexLayerSource, LayerSource | 2 | from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource |
| 3 | from orm.models import Branch | 3 | from orm.models import Branch |
| 4 | 4 | ||
| 5 | class LayerSourceVerifyInheritanceSaveLoad(TestCase): | 5 | class LayerSourceVerifyInheritanceSaveLoad(TestCase): |
| 6 | def test_object_creation(self): | 6 | def test_object_creation(self): |
| 7 | lls = LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "") | 7 | lls = LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "") |
| 8 | lils = LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LAYERINDEX, apiurl = "") | 8 | lils = LayerSource.objects.create(name = "a2", sourcetype = LayerSource.TYPE_LAYERINDEX, apiurl = "") |
| 9 | imls = LayerSource.objects.create(name = "a3", sourcetype = LayerSource.TYPE_IMPORTED, apiurl = "") | ||
| 9 | 10 | ||
| 10 | print LayerSource.objects.all() | 11 | import pprint |
| 12 | pprint.pprint([(x.__class__,vars(x)) for x in LayerSource.objects.all()]) | ||
| 11 | 13 | ||
| 12 | self.assertTrue(True in map(lambda x: isinstance(x, LocalLayerSource), LayerSource.objects.all())) | 14 | self.assertTrue(True in map(lambda x: isinstance(x, LocalLayerSource), LayerSource.objects.all())) |
| 13 | self.assertTrue(True in map(lambda x: isinstance(x, LayerIndexLayerSource), LayerSource.objects.all())) | 15 | self.assertTrue(True in map(lambda x: isinstance(x, LayerIndexLayerSource), LayerSource.objects.all())) |
| 16 | self.assertTrue(True in map(lambda x: isinstance(x, ImportedLayerSource), LayerSource.objects.all())) | ||
| 14 | 17 | ||
| 15 | def test_duplicate_error(self): | 18 | def test_duplicate_error(self): |
| 16 | def duplicate(): | 19 | def duplicate(): |
| @@ -18,7 +21,7 @@ class LayerSourceVerifyInheritanceSaveLoad(TestCase): | |||
| 18 | LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "") | 21 | LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "") |
| 19 | 22 | ||
| 20 | self.assertRaises(Exception, duplicate) | 23 | self.assertRaises(Exception, duplicate) |
| 21 | 24 | ||
| 22 | 25 | ||
| 23 | 26 | ||
| 24 | class LILSUpdateTestCase(TestCase): | 27 | class LILSUpdateTestCase(TestCase): |
