tests: add libcinfo command tests (#2872)

pull/2877/head
Disconnect3d 8 months ago committed by GitHub
parent d8fa9d1c93
commit df0c4a7f8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,27 @@
from __future__ import annotations
import gdb
import tests
REFERENCE_BINARY = tests.binaries.get("reference-binary.out")
def test_command_libcinfo(start_binary):
"""
Tests the libcinfo command
"""
start_binary(REFERENCE_BINARY)
result = gdb.execute("libcinfo", to_string=True)
assert result == "Could not determine libc version.\n"
# Continue until main, so the libc is actually loaded
gdb.execute("break main")
gdb.execute("continue")
result = gdb.execute("libcinfo", to_string=True).splitlines()
assert len(result) == 2
assert result[0].startswith("libc version: ")
assert result[1].startswith("libc source link: https://ftp.gnu.org/gnu/libc/glibc-")
assert result[1].endswith(".tar.gz")
Loading…
Cancel
Save