Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp37801imb; Thu, 28 Feb 2019 15:14:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IYzs9Xu78dVZBjvfHDIttLuXNATuklAsRE/TYWOyZAE+4A6PDCkrlbN4KqvL+3wknlEAkJ3 X-Received: by 2002:aa7:83ca:: with SMTP id j10mr2253815pfn.50.1551395670479; Thu, 28 Feb 2019 15:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551395670; cv=none; d=google.com; s=arc-20160816; b=pfpqeLC/tQK7OCVmL2so++WnwMoUc5y1JOK9szIt5yRqOscSs1+B1U5cZf1IP8jtkA zrwsuWultrtrXtNGipM+F3MoMqv3miPsw6PhSVHXhql5FFrsDPkaDElqY/zBS2NBx2hZ 99LnAuZ3/d6UFkNljX8Fm6p0QaNsDGznQYiGEU33UCeZyTJmpSfazK2N7/3NV10+N0oh XnKVVmAqbpvoTYDjG2uPNy4qjUzp8bi5GBjTe7VAgFrpx/pIuMF0dxVu5R1aldN0gPRC uOc523Tn7LR2QdgZBz0ivFbU/c3yfrrehd0wmR8vUmJOIOBmNmazMpQaOPKW+VguT4vF xDrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=rhgefRyLxqgjMrJGZWicy3T0pK2Omua5Xm6GORNMqJw=; b=iDujrnk9xUP3rdxDlJj4gr9Fpa/O53xO290k0uRlM8L5hcAw9BAf0aIYnPTDWl49yb tsdMSOfAUHo6aFJUbCz6HWpI3gGi6fpaOxnH/BvuPYxXQoq6W0snTLf6o4AS+MMWmK6A FrR/z4OK5QAn5cx02yY1Vaxu6+XmhjDenUt0YWLMjd9jyuPidrZ4gbJM0R8DuR0FqjFA /B6VdRtQVuthzfMG+9uiD2v41BZCzDcxR0eRbRtr7DgDb1wL/Ipkbblgf5HzavN6JPEp VFTqi4NnakEbPSVLpydKRBudFs/MwDVC0MqSxAVAU6Vm556F00yInJFKkJNkF1NW9MNG Qbkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u63si17764062pgd.385.2019.02.28.15.14.15; Thu, 28 Feb 2019 15:14:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388086AbfB1VB6 (ORCPT + 99 others); Thu, 28 Feb 2019 16:01:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:39166 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727222AbfB1VB5 (ORCPT ); Thu, 28 Feb 2019 16:01:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 44579B152; Thu, 28 Feb 2019 21:01:56 +0000 (UTC) Date: Thu, 28 Feb 2019 22:01:54 +0100 From: Petr Vorel To: Mimi Zohar Cc: linux-kselftest@vger.kernel.org, Shuah Khan , linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/5] selftests/ima: define common logging functions Message-ID: <20190228210154.GA28402@dell5510> Reply-To: Petr Vorel References: <1551223620-11586-1-git-send-email-zohar@linux.ibm.com> <1551223620-11586-4-git-send-email-zohar@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551223620-11586-4-git-send-email-zohar@linux.ibm.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mimi, > Define log_info, log_pass, log_fail, and log_skip functions. > Suggested-by: Petr Vorel > Signed-off-by: Mimi Zohar Reviewed-by: Petr Vorel > --- > tools/testing/selftests/ima/common_lib.sh | 43 +++++++++++++++++++++++--- > tools/testing/selftests/ima/test_kexec_load.sh | 19 +++--------- > 2 files changed, 43 insertions(+), 19 deletions(-) ... > diff --git a/tools/testing/selftests/ima/common_lib.sh b/tools/testing/selftests/ima/common_lib.sh > index 5583ea74c14e..c6d04006281d 100755 > --- a/tools/testing/selftests/ima/common_lib.sh ... > # Get secureboot mode > local file="$efivarfs/../vars/SecureBoot-*/data" > if [ ! -e $file ]; then > - echo "$TEST: unknown secureboot mode" >&2 > - exit $ksft_skip > + log_skip "unknown secureboot mode" > fi > - return `od -An -t u1 /sys/firmware/efi/vars/SecureBoot-*/data` > + ret=`od -An -t u1 /sys/firmware/efi/vars/SecureBoot-*/data` Missing local. Usually it's good to put all locals at the top. > + [ $ret -eq 1 ] && log_info "secure boot mode enabled" > + > + return $ret > } ... Kind regards, Petr