Skip to content
Snippets Groups Projects
Commit 9d580f07 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

inside-runtime: Test duplicated ICDs/Layers inside a container


If we don't have duplicated ICDs/Layers in the host system, we want to
be sure that this holds true also inside a container.

Signed-off-by: default avatarLudovico de Nittis <ludovico.denittis@collabora.com>
parent 1a6eadd8
No related branches found
No related tags found
1 merge request!241Add an "issues" entry for ICDs and Vulkan layers
Pipeline #9223 passed
......@@ -370,6 +370,7 @@ class TestContainers(BaseTest):
cls.host_srsi = host_srsi
if host_srsi is not None:
logger.info("We have the host srsi %s", host_srsi)
with open(
os.path.join(cls.artifacts, 'host-srsi.json'),
'w',
......@@ -397,6 +398,7 @@ class TestContainers(BaseTest):
) as reader:
cls.host_srsi_parsed = json.load(reader)
else:
logger.info("The host srsi is missing")
os.environ.pop('HOST_STEAM_RUNTIME_SYSTEM_INFO_JSON', None)
cls.host_srsi_parsed = {}
......
......@@ -251,6 +251,17 @@ class TestInsideRuntime(BaseTest):
cache, Path('/etc/ld-i686-pc-linux-gnu.cache').resolve()
)
def is_loadable_duplicated(self, srsi_parsed, key, sub_key) -> bool:
if srsi_parsed is None:
return False
if key in srsi_parsed and sub_key in srsi_parsed[key]:
for loadable in srsi_parsed[key][sub_key]:
if "duplicated" in loadable.get('issues', ''):
return True
return False
def test_srsi(self) -> None:
overrides = Path('/overrides').resolve()
......@@ -401,6 +412,30 @@ class TestInsideRuntime(BaseTest):
self.assertIn('architectures', parsed)
if host_parsed:
# If we have an ICD or Layer flagged as duplicated in the
# container, we expect that the same thing to happen in the
# host too.
self.assertEqual(
self.is_loadable_duplicated(parsed, 'egl', 'icds'),
self.is_loadable_duplicated(host_parsed, 'egl', 'icds'),
)
self.assertEqual(
self.is_loadable_duplicated(parsed, 'vulkan', 'icds'),
self.is_loadable_duplicated(host_parsed, 'vulkan', 'icds'),
)
self.assertEqual(
self.is_loadable_duplicated(parsed, 'vulkan', 'explicit_layers'),
self.is_loadable_duplicated(host_parsed, 'vulkan', 'explicit_layers'),
)
self.assertEqual(
self.is_loadable_duplicated(parsed, 'vulkan', 'implicit_layers'),
self.is_loadable_duplicated(host_parsed, 'vulkan', 'implicit_layers'),
)
for multiarch in parsed['architectures']:
if not (Path('/usr/lib') / multiarch).is_dir():
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment