]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: make ts_skip_capability accepts the output of older version of getpcaps
authorMasatake YAMATO <yamato@redhat.com>
Sat, 2 Sep 2023 19:27:44 +0000 (04:27 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Sun, 3 Sep 2023 21:16:25 +0000 (06:16 +0900)
In https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=8a2ac848a2065641e20a8b50384b68e8781cc6fc,
the default output format of getpcaps command was changed.

ts_skip_capability() assumes only the newer format, a format
introduced in the commit.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/functions.sh

index c957e55c19d303217ed250a2a25477497691383d..8a5dcb12acb71da0b219d8774ec98ae21b459fdd 100644 (file)
@@ -174,8 +174,8 @@ function ts_skip_capability {
        # On Fedora, libcap package provides getpcaps command.
        ts_check_prog "getpcaps"
 
-       local caps=$(getpcaps "$self")
-       if [[ "$caps" == "${self}: =ep" ]]; then
+       local caps=$(getpcaps "$self" 2>&1)
+       if [[ "$caps" == "${self}: =ep" || "$caps" == 'Capabilities for `'"${self}': =ep" ]]; then
                return 0
        fi