Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon McVittie
libcapsule
Commits
25915159
Commit
25915159
authored
Jul 06, 2020
by
Simon McVittie
Browse files
tests: Assert that capsule-capture-libs --library-knowledge works
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
c0cd5a2f
Pipeline
#11801
failed with stage
in 5 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/capture-libs.pl
View file @
25915159
...
...
@@ -61,6 +61,14 @@ my $libdir = "${test_tempdir}/libdir";
print
$fh
"
soname:libc.so.6
";
# deliberately no trailing newline
close
$fh
;
}
{
open
(
my
$fh
,
'
>
',
"
${test_tempdir}
/capture-libs.ini
");
print
$fh
"
[Library /opt/libversionedsymbols.so.1]
\n
";
print
$fh
"
compare=versions;name;symbols;
\n
";
print
$fh
"
[Library /opt/libversionedlikedbus.so.1]
\n
";
print
$fh
"
compare=container;
\n
";
close
$fh
;
}
run_ok
(['
rm
',
'
-fr
',
$libdir
]);
mkdir
(
$libdir
);
...
...
@@ -570,6 +578,33 @@ SKIP: {
"
should not take provider's version when container's numeric tail is newer
");
ok
(
!
-
l
"
$libdir
/libversionednumber.so.1
",
"
should not take provider's version when container's numeric tail is newer
");
run_ok
(['
rm
',
'
-fr
',
$libdir
]);
mkdir
(
$libdir
);
$result
=
run_verbose
([
qw(bwrap --ro-bind / /)
,
'
--tmpfs
',
$host
,
bind_usr
('
/
',
$host
),
'
--tmpfs
',
$container
,
bind_usr
('
/
',
$container
),
'
--ro-bind
',
$version1
,
"
$host
/opt
",
'
--ro-bind
',
$version2
,
"
$container
/opt
",
'
--ro-bind
',
"
$test_tempdir
/capture-libs.ini
",
"
$test_tempdir
/capture-libs.ini
",
'
--bind
',
$libdir
,
$libdir
,
qw(--dev-bind /dev /dev)
,
'
env
',
'
CAPSULE_DEBUG=all
',
$CAPSULE_CAPTURE_LIBS_TOOL
,
'
--link-target=/run/host
',
"
--dest=
$libdir
",
"
--provider=
$host
",
"
--container=
$container
",
"
--library-knowledge=
$test_tempdir
/capture-libs.ini
",
'
path-match:/opt/lib*.so.1
'],
'
2>
',
\
$stderr
,
'
>&2
');
diag
$stderr
;
ok
(
$result
);
ok
(
!
-
l
"
$libdir
/libversionedsymbols.so.1
",
"
should not take provider's version when told to look at container's symbols
");
ok
(
!
-
l
"
$libdir
/libversionedlikedbus.so.1
",
"
should not take provider's version when forced to use container's
");
}
done_testing
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment