From: Masatake YAMATO Date: Sat, 2 Sep 2023 19:27:44 +0000 (+0900) Subject: tests: make ts_skip_capability accepts the output of older version of getpcaps X-Git-Tag: v2.40-rc1~253^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bb1e4fbb10444d5ec8a207d1b930383fb1b9c86;p=thirdparty%2Futil-linux.git tests: make ts_skip_capability accepts the output of older version of getpcaps 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 --- diff --git a/tests/functions.sh b/tests/functions.sh index c957e55c19..8a5dcb12ac 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -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