-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python] Fix {{ ldd }} and add tests
Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
- Loading branch information
Showing
4 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from graminelibos.gen_jinja_env import parse_ldd | ||
|
||
def test_parse_ldd(): | ||
output = parse_ldd( | ||
# collected with glibc 2.31-0ubuntu9.9 on a helloworld app | ||
'''\ | ||
\tlinux-vdso.so.1 (0x00007ffd56342000) | ||
\tlibc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3a87190000) | ||
\t/lib64/ld-linux-x86-64.so.2 (0x00007f3a8738c000) | ||
''') | ||
assert output == ['/lib/x86_64-linux-gnu/libc.so.6'] | ||
|
||
def test_parse_ldd_multiple_binaries(): | ||
output = parse_ldd( | ||
# collected with glibc 2.36-9+deb12u3 | ||
'''\ | ||
/usr/bin/cat: | ||
\tlinux-vdso.so.1 (0x00007ffe71bfe000) | ||
\tlibc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa5165ff000) | ||
\t/lib64/ld-linux-x86-64.so.2 (0x00007fa5167f8000) | ||
/usr/bin/echo: | ||
\tlinux-vdso.so.1 (0x00007fff8fde5000) | ||
\tlibc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7533ee1000) | ||
\t/lib64/ld-linux-x86-64.so.2 (0x00007f75340da000) | ||
''') | ||
assert output == ['/lib/x86_64-linux-gnu/libc.so.6'] |