All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.ibm.com>
To: linux-integrity@vger.kernel.org
Cc: zohar@linux.ibm.com, Stefan Berger <stefanb@linux.ibm.com>
Subject: [ima-evm-utils PATCH v3 07/14] tests: Address issues raised by shellcheck SC2164
Date: Fri,  1 Dec 2023 08:31:29 -0500	[thread overview]
Message-ID: <20231201133136.2124147-8-stefanb@linux.ibm.com> (raw)
In-Reply-To: <20231201133136.2124147-1-stefanb@linux.ibm.com>

Address issues raised by shellcheck SC2164:
  "Use cd ... || exit in case cd fails."

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 tests/Makefile.am               | 2 +-
 tests/boot_aggregate.test       | 2 +-
 tests/install-fsverity.sh       | 2 +-
 tests/install-mount-idmapped.sh | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 79e2775..c5b2a2f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,7 +26,7 @@ clean-local:
 distclean: distclean-keys
 
 shellcheck:
-	shellcheck -i SC2086,SC2181,SC2046,SC2320,SC2317,SC2034 \
+	shellcheck -i SC2086,SC2181,SC2046,SC2320,SC2317,SC2034,SC2164 \
 		functions.sh gen-keys.sh install-fsverity.sh \
 		install-mount-idmapped.sh install-openssl3.sh \
 		install-swtpm.sh install-tss.sh softhsm_setup \
diff --git a/tests/boot_aggregate.test b/tests/boot_aggregate.test
index 04aef9b..c7c2b21 100755
--- a/tests/boot_aggregate.test
+++ b/tests/boot_aggregate.test
@@ -17,7 +17,7 @@ trap '_report_exit_and_cleanup cleanup' SIGINT SIGTERM EXIT
 # Base VERBOSE on the environment variable, if set.
 VERBOSE="${VERBOSE:-0}"
 
-cd "$(dirname "$0")"
+cd "$(dirname "$0")" || exit 1
 export PATH=../src:$PATH
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
 . ./functions.sh
diff --git a/tests/install-fsverity.sh b/tests/install-fsverity.sh
index fa31b2b..e2b0286 100755
--- a/tests/install-fsverity.sh
+++ b/tests/install-fsverity.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 git clone https://git.kernel.org/pub/scm/fs/fsverity/fsverity-utils.git
-cd fsverity-utils
+cd fsverity-utils || exit 1
 CC=gcc make -j"$(nproc)"
 cd ..
diff --git a/tests/install-mount-idmapped.sh b/tests/install-mount-idmapped.sh
index c954006..d8a673c 100755
--- a/tests/install-mount-idmapped.sh
+++ b/tests/install-mount-idmapped.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 git clone https://github.com/brauner/mount-idmapped.git
-cd mount-idmapped
+cd mount-idmapped || exit 1
 gcc -o mount-idmapped mount-idmapped.c
 cd ..
-- 
2.43.0


  parent reply	other threads:[~2023-12-01 13:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 13:31 [ima-evm-utils PATCH v3 00/14] Enable shellcheck and fix some issues Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 01/14] tests: Address issues raised by shellcheck SC2086 & enable shellcheck Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 02/14] tests: Address issues raised by shellcheck SC2181 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 03/14] tests: Address issues raised by shellcheck SC2046 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 04/14] tests: Address issues raised by shellcheck SC2320 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 05/14] tests: Address issues raised by shellcheck SC2317 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 06/14] tests: Address issues raised by shellcheck SC2034 Stefan Berger
2023-12-01 13:31 ` Stefan Berger [this message]
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 08/14] tests: Address issues raised by shellcheck SC2166 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 09/14] tests: Address issues raised by shellcheck SC2294 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 10/14] tests: Address issues raised by shellcheck SC2206 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 11/14] tests: Address issues raised by shellcheck SC2196 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 12/14] tests: Address issues raised by shellcheck SC2043 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 13/14] tests: Address issues raised by shellcheck SC2295 Stefan Berger
2023-12-01 13:31 ` [ima-evm-utils PATCH v3 14/14] tests: Address issues raised by shellcheck SC2003 Stefan Berger
2023-12-06 19:33 ` [ima-evm-utils PATCH v3 00/14] Enable shellcheck and fix some issues Mimi Zohar

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=20231201133136.2124147-8-stefanb@linux.ibm.com \
    --to=stefanb@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=zohar@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.