Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3146143ybt; Mon, 22 Jun 2020 16:30:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD0MyDYT63ZoOkC5R27RQHIEiwtjCq67CbNxwYHyqliF/6c/7Zh+VEGXmraH7EXJ3CHvp3 X-Received: by 2002:a17:906:f257:: with SMTP id gy23mr18704402ejb.370.1592868658185; Mon, 22 Jun 2020 16:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592868658; cv=none; d=google.com; s=arc-20160816; b=abIz9puSgVbnPFnVLysoQ1Ri8VKiCzXbwcl+0++2XzdJlWYixYKqU3zshgcAhjgzMz HSp3mtwD8W/xMgYEYL8AwZT0N3KTbCBxWKEhm8uyb7iUOn9yNxhubqVzGuJStet63xzr mjXwem7RGHcBmbec/VBYrK1xc7ExkOFTD6+fblgBFr/wtySB6tp1A53eT+oHVTyn+C9Q 9MUqlnZnbm53SYSeTBWiE9nuW1BFPbOntNg0m/vpyF/0YnhBzAxz3qDJLdOsU8QnC/bb DE6ocKHGngZB+w/H6huIJzWPO/nb4zSHfDP4Ase8JndVPzBM4V9YLeiBHQCayeEuVYx7 v+PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=AeDe5zG4mTGWuJFqTvDLQqjOLCFn8HY7bLnASc+WcaY=; b=IQ+0GfvWO/MpgldLaTQcA30OneRHd2TsTFtVTGBTeH88Pl33J7YKUNyLw0gMW4wFF1 49EyH5ZRv+mRE4gYMNDyHeSAsSrY6RofStI+xuPqWgJ0UwjB2IkxP3JwBvP/h02ouOzm 6daG3KkoT3Z9INU8UBv/AO5fPZWTTfUpmjOdu2zVEBSSah9ur8m1pfCtzg8+YzkMUP2e rkOPQO3S6zvh7XFOLz/l+8Su23v2v02QbnTANYiXLnrnGB4JIg5uvb/goH42jbi22n58 7iJj0rVk5/8645jVdqZsiQA8g11GdzcZGr2Izn0m1GIE9N0taMftbeBzEqIeaqvCExv+ CqyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si10540343ejd.509.2020.06.22.16.30.35; Mon, 22 Jun 2020 16:30:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730590AbgFVVXT (ORCPT + 99 others); Mon, 22 Jun 2020 17:23:19 -0400 Received: from mga18.intel.com ([134.134.136.126]:20594 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730460AbgFVVXT (ORCPT ); Mon, 22 Jun 2020 17:23:19 -0400 IronPort-SDR: OvNfOnG76QU0OXK9nUGSUclbrYRVxvuDNmgGK/o0CXYbqUZ5rrxIy/3cVkM4UobxFiSz1h4BQr VoUlZ0ZHXjbw== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="131284806" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="131284806" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 14:23:18 -0700 IronPort-SDR: 1qe1IqEQbX6OFoTJB/64GhFCnOlcqBqDRIHdYkPjPGp0lpD2vselbJo1xK1b/kyWyMRONNW+yI jLIFlQwcNFkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="278894253" Received: from scheller-mobl.ger.corp.intel.com (HELO localhost) ([10.252.33.117]) by orsmga006.jf.intel.com with ESMTP; 22 Jun 2020 14:23:14 -0700 From: Jarkko Sakkinen To: Shuah Khan Cc: pengfei.xu@intel.com, Jarkko Sakkinen , Nikita Sobolev , linux-integrity@vger.kernel.org, linux-kselftest@vger.kernel.org, Tadeusz Struk , Petr Vorel , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/3] selftests: tpm: Use 'test -e' instead of 'test -f' Date: Tue, 23 Jun 2020 00:20:21 +0300 Message-Id: <20200622212034.20624-3-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200622212034.20624-1-jarkko.sakkinen@linux.intel.com> References: <20200622212034.20624-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'test -f' is suitable only for *regular* files. Use 'test -e' instead. Cc: Nikita Sobolev Cc: linux-integrity@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Fixes: 5627f9cffee7 ("Kernel selftests: Add check if TPM devices are supported") Signed-off-by: Jarkko Sakkinen --- tools/testing/selftests/tpm2/test_smoke.sh | 2 +- tools/testing/selftests/tpm2/test_space.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh index 79f8e9da5d21..338d6b0272dc 100755 --- a/tools/testing/selftests/tpm2/test_smoke.sh +++ b/tools/testing/selftests/tpm2/test_smoke.sh @@ -4,7 +4,7 @@ # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 -[ -f /dev/tpm0 ] || exit $ksft_skip +[ -e /dev/tpm0 ] || exit $ksft_skip python -m unittest -v tpm2_tests.SmokeTest python -m unittest -v tpm2_tests.AsyncTest diff --git a/tools/testing/selftests/tpm2/test_space.sh b/tools/testing/selftests/tpm2/test_space.sh index 36c9d030a1c6..847cabb20a5f 100755 --- a/tools/testing/selftests/tpm2/test_space.sh +++ b/tools/testing/selftests/tpm2/test_space.sh @@ -4,6 +4,6 @@ # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 -[ -f /dev/tpmrm0 ] || exit $ksft_skip +[ -e /dev/tpmrm0 ] || exit $ksft_skip python -m unittest -v tpm2_tests.SpaceTest -- 2.25.1