From 851f8c7907a74dddf89ebf602b74c20b9e74119a Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Thu, 13 Aug 2020 20:25:31 +0200 Subject: [PATCH] tests: Require cmp cmp is not by default installed on some containers (unlike other tools e.g. cut, tr from coreutils or grep). Also cmp implementation from busybox doesn't support -b, thus detect it. Signed-off-by: Petr Vorel Reviewed-by: Bruno Meneguele (Fedora,CentOS 8(RHEL actually)) Signed-off-by: Mimi Zohar --- tests/sign_verify.test | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/sign_verify.test b/tests/sign_verify.test index 118c3f6..4f08bed 100755 --- a/tests/sign_verify.test +++ b/tests/sign_verify.test @@ -18,7 +18,14 @@ cd "$(dirname "$0")" || exit 1 PATH=../src:$PATH source ./functions.sh -_require evmctl openssl xxd getfattr + +_require cmp evmctl getfattr openssl xxd + +if cmp -b 2>&1 | grep -q "invalid option"; then + echo "cmp does not support -b (cmp from busybox?) Use cmp from diffutils" + exit "$HARDFAIL" +fi + ./gen-keys.sh >/dev/null 2>&1 trap _report_exit EXIT