Skip to content
  • Simon McVittie's avatar
    tests: Fix expectations for merged-/usr systems · de669890
    Simon McVittie authored
    
    
    Previously, we were assuming that the symlink created by
    capsule-capture-libs would point to the `realpath()` of a library,
    possibly with a `--link-target` prefix. However, it actually only
    resolves the symlink representing the SONAME: it will resolve `libz.so.1`
    to `libz.so.1.2.13`, but unlike Perl `abs_path()` or C `realpath()`,
    it will not necessarily resolve symlinks in the directory hierarchy
    leading up to that point.
    
    For example, on a merged-/usr system like Debian >= 12, /lib is a
    symbolic link to usr/lib. The realpath() of `libz.so.1` is something like
    `/usr/lib/MULTIARCH/libz.so.1.2.13`, but because both `/lib/MULTIARCH`
    and `/usr/lib/MULTIARCH` appear in `/etc/ld.so.conf.d`, it is undefined
    whether capsule-capture-libs will output `/lib/MULTIARCH/libz.so.1.2.13`
    or `/usr/lib/MULTIARCH/libz.so.1.2.13`.
    
    Relax the expectations of this test so we only say that the symlink
    points to some reasonable `$libdir`, followed by the `basename()` of the
    `realpath()` of `libc.so.6`.
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
    de669890