[ima-evm-utils][PATCH 2/3] travis: rename the software tpm variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The existing variable names swtpm and swtpm1 is confusing.  Rename
"swtpm" to "tpm_server" and "swtpm1" as "swtpm".

Reported-by: Ken Goldman <kgoldman@xxxxxxxxxx>
Signed-off-by: Mimi Zohar <zohar@xxxxxxxxxxxxx>
---
 tests/boot_aggregate.test | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/boot_aggregate.test b/tests/boot_aggregate.test
index edebf1d29f23..ab061d5e5845 100755
--- a/tests/boot_aggregate.test
+++ b/tests/boot_aggregate.test
@@ -54,36 +54,36 @@ cleanup() {
 
 # Try to start a software TPM if needed.
 swtpm_start() {
-	local swtpm swtpm1
+	local tpm_server swtpm
 
-	swtpm="$(which tpm_server)"
-	swtpm1="$(which swtpm)"
-	if [ -z "${swtpm}" ] && [ -z "${swtpm1}" ]; then
+	tpm_server="$(which tpm_server)"
+	swtpm="$(which swtpm)"
+	if [ -z "${tpm_server}" ] && [ -z "${swtpm}" ]; then
 		echo "${CYAN}SKIP: Software TPM (tpm_server and swtpm) not found${NORM}"
 		return "$SKIP"
 	fi
 
-	if [ -n "${swtpm1}" ]; then
-		pgrep swtpm1
+	if [ -n "${swtpm}" ]; then
+		pgrep swtpm
 		if [ $? -eq 0 ]; then
 			echo "INFO: Software TPM (swtpm) already running"
 			return 114
 		else
-			echo "INFO: Starting software TPM: ${swtpm1}"
-			mkdir ./myvtpm
-			${swtpm1} socket --tpmstate dir=./myvtpm --tpm2 --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --flags not-need-init > /dev/null 2>&1 &
+			echo -n "INFO: Starting software TPM: ${swtpm}"
+			mkdir -p ./myvtpm
+			${swtpm} socket --tpmstate dir=./myvtpm --tpm2 --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --flags not-need-init > /dev/null 2>&1 &
 			SWTPM_PPID=$!
 		fi
-	elif [ -n "${swtpm}" ]; then
+	elif [ -n "${tpm_server}" ]; then
 		# tpm_server uses the Microsoft simulator encapsulated packet format
 		export TPM_SERVER_TYPE="mssim"
-		pgrep swtpm
+		pgrep tpm_server
 		if [ $? -eq 0 ]; then
 			echo "INFO: Software TPM (tpm_server) already running"
 			return 114
 		else
-			echo "INFO: Starting software TPM: ${swtpm}"
-			${swtpm} > /dev/null 2>&1 &
+			echo "INFO: Starting software TPM: ${tpm_server}"
+			${tpm_server} > /dev/null 2>&1 &
 			SWTPM_PPID=$!
 		fi
 	fi
-- 
2.18.4




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux