linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: linux-integrity@vger.kernel.org
Cc: Roberto Sassu <roberto.sassu@huawei.com>,
	Vitaly Chikunov <vt@altlinux.org>,
	Patrick Uiterwijk <puiterwi@redhat.com>,
	Lakshmi Ramasubramanian <nramas@linux.microsoft.com>,
	Mimi Zohar <zohar@linux.ibm.com>
Subject: [RFC PATCH 3/3] ima_evm_utils: tests: color boot_aggregate.test tty output
Date: Wed, 25 Mar 2020 18:26:17 -0400	[thread overview]
Message-ID: <1585175177-20739-4-git-send-email-zohar@linux.ibm.com> (raw)
In-Reply-To: <1585175177-20739-1-git-send-email-zohar@linux.ibm.com>

Use the "functions.sh" tty color scheme, which defines SKIP as CYAN.

FAILURE: RED (31)
SUCCESS: GREEN (32)
SKIP: CYAN (36)

Should VERBOSE or informational messages be color coded?

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
---
 tests/boot_aggregate.test | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/boot_aggregate.test b/tests/boot_aggregate.test
index 73af423e30a1..38084d5cbf45 100755
--- a/tests/boot_aggregate.test
+++ b/tests/boot_aggregate.test
@@ -49,7 +49,7 @@ swtpm_start() {
 	local swtpm="$(which tpm_server)"
 
 	if [ -z ${swtpm} ]; then
-		echo "SKIP: Softare TPM (tpm_server) not found"
+		echo $CYAN"SKIP: Softare TPM (tpm_server) not found"$NORM
 		return $SKIP
 	fi
 
@@ -68,7 +68,7 @@ swtpm_start() {
 # Initialize the software TPM using the sample binary_bios_measurements log.
 swtpm_init() {
 	if [ ! -f ${TSSDIR}/tssstartup ] || [ ! -f ${TSSDIR}/tsseventextend ]; then
-		echo "SKIP: tssstartup and tsseventextend needed for test"
+		echo $CYAN"SKIP: tssstartup and tsseventextend needed for test"$NORM
 		return $SKIP
 	fi
 
@@ -108,7 +108,7 @@ check() {
 	echo "INFO: Calculating the boot_aggregate (PCRs 0 - 7) for multiple banks"
 	bootaggr=$(evmctl ima_boot_aggregate)
 	if [ $? -ne 0 ]; then
-		echo "SKIP: evmctl ima_boot_aggregate: $bootaggr"
+		echo $CYAN"SKIP: evmctl ima_boot_aggregate: $bootaggr"$NORM
 		exit $SKIP
 	fi
 
@@ -120,11 +120,11 @@ check() {
 			echo "$hash"
 		fi
 		if grep -e "boot_aggregate$" -e "boot_aggregate.$" "${ASCII_RUNTIME_MEASUREMENTS}" | tail -n 1 | grep -q "${hash}"; then
-			echo "SUCCESS: boot_aggregate ${hash} found"
+			echo $GREEN"SUCCESS: boot_aggregate ${hash} found"$NORM
 			return $OK
 		fi
 	done
-	echo "FAILURE: boot_aggregate not found"
+	echo $RED"FAILURE: boot_aggregate not found"$NORM
 	return $FAIL
 }
 
-- 
2.7.5


      parent reply	other threads:[~2020-03-25 22:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 22:26 [RFC PATCH 0/3] boot aggregate test Mimi Zohar
2020-03-25 22:26 ` [RFC PATCH 1/3] ima-evm-utils: tests: verify boot_aggregate Mimi Zohar
2020-03-25 22:26 ` [RFC PATCH 2/3] ima-evm-utils: tests: verify the last "boot_aggregate" record Mimi Zohar
2020-03-25 22:26 ` Mimi Zohar [this message]

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=1585175177-20739-4-git-send-email-zohar@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=nramas@linux.microsoft.com \
    --cc=puiterwi@redhat.com \
    --cc=roberto.sassu@huawei.com \
    --cc=vt@altlinux.org \
    /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).