Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
d4a28d2b
Commit
d4a28d2b
authored
4 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
tests: Assert that glibc, libdrm get deleted from scout containers
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
5b403eb2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/containers.py
+138
-5
138 additions, 5 deletions
tests/containers.py
with
138 additions
and
5 deletions
tests/containers.py
+
138
−
5
View file @
d4a28d2b
...
...
@@ -79,6 +79,7 @@ SteamOS 2 'brewmaster', Debian 8 'jessie', Ubuntu 14.04 'trusty'.
import
contextlib
import
fcntl
import
glob
import
json
import
logging
import
os
...
...
@@ -530,10 +531,26 @@ class TestContainers(BaseTest):
for
multiarch
,
arch_info
in
self
.
host_srsi_parsed
.
get
(
'
architectures
'
,
{}
).
items
():
libdir
=
os
.
path
.
join
(
tree
,
'
overrides
'
,
'
lib
'
,
multiarch
)
overrides_libdir
=
os
.
path
.
join
(
tree
,
'
overrides
'
,
'
lib
'
,
multiarch
,
)
root_libdir
=
os
.
path
.
join
(
tree
,
'
lib
'
,
multiarch
,
)
usr_libdir
=
os
.
path
.
join
(
tree
,
'
usr
'
,
'
lib
'
,
multiarch
,
)
host_root_libdir
=
os
.
path
.
join
(
'
/
'
,
'
lib
'
,
multiarch
,
)
host_usr_libdir
=
os
.
path
.
join
(
'
/
'
,
'
usr
'
,
'
lib
'
,
multiarch
,
)
with
self
.
subTest
(
arch
=
multiarch
):
self
.
assertTrue
(
os
.
path
.
isdir
(
libdir
))
self
.
assertTrue
(
os
.
path
.
isdir
(
overrides_libdir
))
self
.
assertTrue
(
os
.
path
.
isdir
(
root_libdir
))
self
.
assertTrue
(
os
.
path
.
isdir
(
usr_libdir
))
if
is_scout
:
for
soname
in
(
...
...
@@ -554,17 +571,133 @@ class TestContainers(BaseTest):
# in every supported version of the Steam Runtime.
with
self
.
subTest
(
soname
=
soname
):
target
=
os
.
readlink
(
os
.
path
.
join
(
libdir
,
soname
)
os
.
path
.
join
(
overrides_
libdir
,
soname
)
)
self
.
assertRegex
(
target
,
r
'
^/run/host/
'
)
devlib
=
soname
.
split
(
'
.so.
'
,
1
)[
0
]
+
'
.so
'
# It was deleted from /lib, if present...
with
self
.
assertRaises
(
FileNotFoundError
):
print
(
'
#
'
,
os
.
path
.
join
(
root_libdir
,
soname
),
'
->
'
,
os
.
readlink
(
os
.
path
.
join
(
root_libdir
,
soname
)
),
)
# ... and /usr/lib, if present
with
self
.
assertRaises
(
FileNotFoundError
):
print
(
'
#
'
,
os
.
path
.
join
(
usr_libdir
,
soname
),
'
->
'
,
os
.
readlink
(
os
.
path
.
join
(
usr_libdir
,
soname
)
),
)
# In most cases we expect the development
# symlink to be removed, too - but some of
# them are actually linker scripts or other
# non-ELF things
if
soname
not
in
(
'
libc.so.6
'
,
'
libpthread.so.0
'
,
):
with
self
.
assertRaises
(
FileNotFoundError
):
print
(
'
#
'
,
os
.
path
.
join
(
usr_libdir
,
devlib
),
'
->
'
,
os
.
readlink
(
os
.
path
.
join
(
usr_libdir
,
devlib
)
),
)
with
self
.
assertRaises
(
FileNotFoundError
):
print
(
'
#
'
,
os
.
path
.
join
(
root_libdir
,
devlib
),
'
->
'
,
os
.
readlink
(
os
.
path
.
join
(
root_libdir
,
devlib
)
),
)
for
soname
in
(
# These are some examples of libraries in the
# graphics stack that we don't upgrade, so we
# expect the host version to be newer (or possibly
# absent if the host graphics stack doesn't use
# them, for example static linking or something).
'
libdrm.so.2
'
,
'
libudev.so.0
'
,
):
with
self
.
subTest
(
soname
=
soname
):
if
(
not
os
.
path
.
exists
(
os
.
path
.
join
(
host_usr_libdir
,
soname
)
)
and
not
os
.
path
.
exists
(
os
.
path
.
join
(
host_root_libdir
,
soname
)
)
):
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
usr_libdir
,
soname
)
)
or
os
.
path
.
exists
(
os
.
path
.
join
(
root_libdir
,
soname
)
)
)
continue
devlib
=
soname
.
split
(
'
.so.
'
,
1
)[
0
]
+
'
.so
'
pattern
=
soname
+
'
.*
'
target
=
os
.
readlink
(
os
.
path
.
join
(
overrides_libdir
,
soname
)
)
self
.
assertRegex
(
target
,
r
'
^/run/host/
'
)
# It was deleted from /lib, if present...
with
self
.
assertRaises
(
FileNotFoundError
):
os
.
readlink
(
os
.
path
.
join
(
root_libdir
,
soname
)
)
with
self
.
assertRaises
(
FileNotFoundError
):
os
.
readlink
(
os
.
path
.
join
(
root_libdir
,
devlib
)
)
self
.
assertEqual
(
glob
.
glob
(
os
.
path
.
join
(
root_libdir
,
pattern
)),
[],
)
# ... and /usr/lib, if present
with
self
.
assertRaises
(
FileNotFoundError
):
os
.
readlink
(
os
.
path
.
join
(
usr_libdir
,
soname
)
)
with
self
.
assertRaises
(
FileNotFoundError
):
os
.
readlink
(
os
.
path
.
join
(
usr_libdir
,
devlib
)
)
self
.
assertEqual
(
glob
.
glob
(
os
.
path
.
join
(
usr_libdir
,
pattern
)),
[],
)
for
soname
in
(
'
libSDL-1.2.so.0
'
,
'
libfltk.so.1.1
'
,
):
with
self
.
subTest
(
soname
=
soname
):
with
self
.
assertRaises
(
FileNotFoundError
):
os
.
readlink
(
os
.
path
.
join
(
libdir
,
soname
))
os
.
readlink
(
os
.
path
.
join
(
overrides_libdir
,
soname
),
)
# Keys are the basename of a DRI driver.
# Values are lists of paths to DRI drivers of that name
...
...
@@ -601,7 +734,7 @@ class TestContainers(BaseTest):
for
k
,
vs
in
expect_symlinks
.
items
():
with
self
.
subTest
(
dri_symlink
=
k
):
link
=
os
.
path
.
join
(
libdir
,
'
dri
'
,
k
)
link
=
os
.
path
.
join
(
overrides_
libdir
,
'
dri
'
,
k
)
target
=
os
.
readlink
(
link
)
self
.
assertEqual
(
target
[:
10
],
'
/run/host/
'
)
target
=
target
[
9
:]
# includes the / after host/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment