| |
@@ -337,9 +337,9 @@
|
| |
and lorem:1 modules which require base:f29 module requiring
|
| |
platform:f29 module :).
|
| |
"""
|
| |
- f290000 = make_module("platform:f29.0.0:0:c11", {}, {})
|
| |
- f290100 = make_module("platform:f29.1.0:0:c11", {}, {})
|
| |
- f290200 = make_module("platform:f29.2.0:0:c11", {}, {})
|
| |
+ f290000 = make_module("platform:f29.0.0:0:c11", {}, {}, virtual_streams=["f29"])
|
| |
+ f290100 = make_module("platform:f29.1.0:0:c11", {}, {}, virtual_streams=["f29"])
|
| |
+ f290200 = make_module("platform:f29.2.0:0:c11", {}, {}, virtual_streams=["f29"])
|
| |
make_module("gtk:1:0:c2", {"platform": ["f29"]}, {}, f290000)
|
| |
make_module("gtk:1:1:c2", {"platform": ["f29"]}, {}, f290100)
|
| |
make_module("gtk:1:2:c2", {"platform": ["f29"]}, {}, f290100)
|
| |
@@ -362,7 +362,7 @@
|
| |
os.path.join(base_dir, 'staged_data', 'testmodule_v2.yaml'), True)
|
| |
deps = mmd.get_dependencies()
|
| |
brs = deps[0].get_buildrequires()
|
| |
- brs['platform'].set(['platform:f29.1.0', 'platform:f29.2.0'])
|
| |
+ brs['platform'].set(['f29.1.0', 'f29.2.0'])
|
| |
deps[0].set_buildrequires(brs)
|
| |
mmd.set_dependencies(deps)
|
| |
|
| |
@@ -375,3 +375,31 @@
|
| |
for mmd_ in mmds:
|
| |
actual.add('{}:{}'.format(mmd_.get_name(), mmd_.get_stream()))
|
| |
assert actual == expected
|
| |
+
|
| |
+ @pytest.mark.parametrize('virtual_streams', (None, ["f29"], ["lp29"]))
|
| |
+ def test__get_base_module_mmds_virtual_streams(self, virtual_streams):
|
| |
+ """Ensure the correct results are returned without duplicates."""
|
| |
+ init_data(data_size=1, multiple_stream_versions=True)
|
| |
+ mmd = module_build_service.utils.load_mmd(
|
| |
+ os.path.join(base_dir, 'staged_data', 'testmodule_v2.yaml'), True)
|
| |
+ deps = mmd.get_dependencies()
|
| |
+ brs = deps[0].get_buildrequires()
|
| |
+ brs['platform'].set(['f29.2.0'])
|
| |
+ deps[0].set_buildrequires(brs)
|
| |
+ mmd.set_dependencies(deps)
|
| |
+
|
| |
+ make_module("platform:lp29.1.1:12:c11", {}, {}, virtual_streams=virtual_streams)
|
| |
+
|
| |
+ mmds = module_build_service.utils.mse._get_base_module_mmds(mmd)
|
| |
+ if virtual_streams == ["f29"]:
|
| |
+ expected = set(['platform:f29.0.0', 'platform:f29.1.0', 'platform:f29.2.0',
|
| |
+ 'platform:lp29.1.1'])
|
| |
+ else:
|
| |
+ expected = set(['platform:f29.0.0', 'platform:f29.1.0', 'platform:f29.2.0'])
|
| |
+ # Verify no duplicates were returned before doing set operations
|
| |
+ assert len(mmds) == len(expected)
|
| |
+ # Verify the expected ones were returned
|
| |
+ actual = set()
|
| |
+ for mmd_ in mmds:
|
| |
+ actual.add('{}:{}'.format(mmd_.get_name(), mmd_.get_stream()))
|
| |
+ assert actual == expected
|
| |
Before this commit, the compatible base modules for Module Stream Expansion
have been found without any limitation, just based on the stream version.
It was therefore possible that
platform:lp29.0.0
was found as compatiblemodule for
platform:f29.1.0
although those platform streams are notcompatible at all.
In this commit, the module can be treated as compatible only if it has
the same virtual stream as the input module. The idea behind this
is that both
platform:f29.0.0
andplatform:f29.1.0
should includethe
virtual_streams: [f29]
in their XMD section which tells MBSthat they are actually compatible. The
lp29
stream will nothave the same virtual stream (most likely it won't have any virtual
stream at all).
The
virtual_streams
is already used for this use-case inMMDResolver
,but it was not used to limit the inputs to
MMDResolver
which is whatthis commit is doing.
This commit also fixes the issue in
get_last_builds_in_stream_version_lte
which was simply broken if multiple stream_versions of single base module
existed and their builds had different version. In this case, only
builds with single (randomly chosen) version were returned.