]> git.proxmox.com Git - swtpm.git/commitdiff
tests: Repeat TSS command if it fails
authorStefan Berger <stefanb@linux.ibm.com>
Tue, 3 May 2022 14:48:07 +0000 (10:48 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 3 May 2022 17:27:13 +0000 (13:27 -0400)
Repeat tss command since it may fail if the test case is run alone (-29).
The reason for this is that the command may fail because of this here:

https://github.com/stefanberger/libtpms/blob/stable-0.9/src/tpm2/SessionProcess.c#L1204

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
tests/patches/0001-Deactivate-test-cases-accessing-rootcerts.txt.patch

index 9f868c69f0c0ba61da9ae117cbb7ac1a8c9153ec..4bd9d18cfbf29109efa2ca081c686505b0a10d82 100644 (file)
@@ -1,19 +1,19 @@
-From 850ce946fc5ba79f03d46e8cb7695dcadb5f397d Mon Sep 17 00:00:00 2001
+From 498b847b8c0b70c7b92142305a9fddfec9d40ad5 Mon Sep 17 00:00:00 2001
 From: Stefan Berger <stefanb@linux.vnet.ibm.com>
 Date: Fri, 26 Feb 2021 18:45:57 -0500
-Subject: [PATCH 1/9] Deactivate test cases accessing rootcerts.txt
+Subject: [PATCH 1/6] Deactivate test cases accessing rootcerts.txt
 
 rootcerts.txt contains files in a drive we don't have access to
 ---
- utils/regtests/testcredential.sh | 18 +++++++++---------
+ utils/regtests/testcredential.sh | 23 +++++++++++++----------
  utils/regtests/testunseal.sh     |  4 ++--
- 2 files changed, 11 insertions(+), 11 deletions(-)
+ 2 files changed, 15 insertions(+), 12 deletions(-)
 
 diff --git a/utils/regtests/testcredential.sh b/utils/regtests/testcredential.sh
-index cb9fec0..16fd66a 100755
+index cb9fec0..772a8ac 100755
 --- a/utils/regtests/testcredential.sh
 +++ b/utils/regtests/testcredential.sh
-@@ -300,9 +300,9 @@ NVNAME=(
+@@ -300,12 +300,15 @@ NVNAME=(
        ${PREFIX}createek -high -pwde eee -pwdk kkk ${CALG[i]} -cp -noflush > run.out
        checkSuccess $?
  
@@ -25,8 +25,15 @@ index cb9fec0..16fd66a 100755
 +      #checkSuccess $?
  
        echo "Create a signing key under the ${CALG[i]} EK using the password"
-       ${PREFIX}create -hp 80000001 -si -pwdp kkk > run.out
-@@ -402,9 +402,9 @@ NVNAME=(
+-      ${PREFIX}create -hp 80000001 -si -pwdp kkk > run.out
++      # May need to repeat command due to this here:
++      # https://github.com/stefanberger/libtpms/blob/stable-0.9/src/tpm2/SessionProcess.c#L1204
++      ${PREFIX}create -hp 80000001 -si -pwdp kkk > run.out || \
++              ${PREFIX}create -hp 80000001 -si -pwdp kkk > run.out
+       checkSuccess $?
+       echo "Start a ${HALG[i]} policy session"
+@@ -402,9 +405,9 @@ NVNAME=(
        ${PREFIX}createek -high -pwde eee -pwdk kkk ${CALG[i]} -cp -noflush > run.out
        checkSuccess $?
  
@@ -39,7 +46,7 @@ index cb9fec0..16fd66a 100755
  
        echo "Create a signing key under the ${CALG[i]} EK using the password"
        ${PREFIX}create -hp 80000001 -si -pwdp kkk > run.out
-@@ -540,9 +540,9 @@ NVNAME=(
+@@ -540,9 +543,9 @@ NVNAME=(
        ${PREFIX}createek ${ALG} -pwde eee -cp -noflush > run.out
        checkSuccess $?
  
@@ -68,5 +75,5 @@ index aae3d4e..1755740 100755
  fi
  checkSuccess $?
 -- 
-2.26.2
+2.36.0