linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Shuah Khan <shuah@kernel.org>
Cc: pengfei.xu@intel.com,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Nikita Sobolev <Nikita.Sobolev@synopsys.com>,
	linux-integrity@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Tadeusz Struk <tadeusz.struk@intel.com>,
	Petr Vorel <petr.vorel@gmail.com>,
	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	[thread overview]
Message-ID: <20200622212034.20624-3-jarkko.sakkinen@linux.intel.com> (raw)
In-Reply-To: <20200622212034.20624-1-jarkko.sakkinen@linux.intel.com>

'test -f' is suitable only for *regular* files. Use 'test -e' instead.

Cc: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
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 <jarkko.sakkinen@linux.intel.com>
---
 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


  parent reply	other threads:[~2020-06-22 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 21:20 [PATCH 0/3] selftests: tpm: fixes Jarkko Sakkinen
2020-06-22 21:20 ` [PATCH 1/3] Revert "tpm: selftest: cleanup after unseal with wrong auth/policy test" Jarkko Sakkinen
2020-06-22 21:20 ` Jarkko Sakkinen [this message]
2020-06-22 21:20 ` [PATCH 3/3] selftests: tpm: Use /bin/sh instead of /bin/bash Jarkko Sakkinen
2020-06-29 20:21 ` [PATCH 0/3] selftests: tpm: fixes Shuah Khan
2020-07-02 23:07   ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200622212034.20624-3-jarkko.sakkinen@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=Nikita.Sobolev@synopsys.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pengfei.xu@intel.com \
    --cc=petr.vorel@gmail.com \
    --cc=shuah@kernel.org \
    --cc=tadeusz.struk@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).