From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18288C433DF for ; Mon, 17 Aug 2020 09:11:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8FD6206C0 for ; Mon, 17 Aug 2020 09:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726297AbgHQJLk (ORCPT ); Mon, 17 Aug 2020 05:11:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:50312 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbgHQJLk (ORCPT ); Mon, 17 Aug 2020 05:11:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3D27EB692; Mon, 17 Aug 2020 09:12:04 +0000 (UTC) Date: Mon, 17 Aug 2020 11:11:37 +0200 From: Petr Vorel To: Mimi Zohar Cc: linux-integrity@vger.kernel.org, Vitaly Chikunov , Bruno Meneguele Subject: Re: [ima-evm-utils][PATCH] Install the swtpm package, if available Message-ID: <20200817091137.GA26170@dell5510> Reply-To: Petr Vorel References: <20200816193627.73935-1-zohar@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Hi Mimi, > Note: Some travis/.sh scripts are links to other scripts. > Don't fail the build of the linked script if the swtpm package doesn't > exist. ... > --- a/travis/fedora.sh > +++ b/travis/fedora.sh > @@ -41,6 +41,7 @@ yum -y install \ > which > > yum -y install docbook5-style-xsl || true > +yum -y install swtpm || true Yes, that's probably the best way how to solve. Sometimes I also passed $INSTALL to the script and had if clause. > On Sun, 2020-08-16 at 15:36 -0400, Mimi Zohar wrote: > > # Only stop this test's software TPM. Preferred method: "tsstpmcmd -stop" > > @@ -48,22 +52,36 @@ cleanup() { > > # Try to start a software TPM if needed. > > swtpm_start() { > > - local swtpm > > + local swtpm swtpm1 > > swtpm="$(which tpm_server)" > > - if [ -z "${swtpm}" ]; then > > - echo "${CYAN}SKIP: Softare TPM (tpm_server) not found${NORM}" > > + swtpm1="$(which swtpm)" > > + if [ -z "${swtpm}" ] && [ -z "${swptm1}" ]; then > Need to fix "swptm1" typo. +1 Reviewed-by: Petr Vorel Also, not related to this commit: * add pgrep and pkill to _require (fix of a different commit) * add magic constant 114 to exit codes (in tests/functions.sh) * I'd like reuse exit codes in build.sh. I could source tests/functions.sh (they look to be general enough, just I didn't like script in root directory depending on it, as it's general enough for build without testing) have these constants in separate file. Kind regards, Petr