fix: fix FTPM test expectations on OpenCI

The expectations for the FTPM tests need to run in an explicit order
because of an implicit dependency between two UART expectations. This
change reorders the port numbering to enforce that order.

Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: Idc264bcc19ea71e23622979b3750ed334a3f1004
diff --git a/expect/linux-tpm-384.exp b/expect/linux-tpm-384.exp
index 57674ff..262cf4c 100644
--- a/expect/linux-tpm-384.exp
+++ b/expect/linux-tpm-384.exp
@@ -70,19 +70,14 @@
         }
 }
 
+expect_string "#" "finished reading PCRs"
+
 # Match the previously stored digest with the one generated by the
 # fTPM service. The pass criteria is that both digests must match,
 # meaning that TF-A successfully passed the event log to the TPM service.
-expect {
-        "#" {
-                spawn diff -s $TFA_DIGEST ftpm_event_log
-        }
+if {[catch {exec diff -s $TFA_DIGEST ftpm_event_log} result options] == 0} {
+        message "tests succeeded, digests matched"
+} else {
+        message "tests failed, digests did not match"
+        exit_uart -1
 }
-
-expect {
-        -exact "are identical" {
-                exit_uart 0
-        }
-}
-
-exit_uart -1
diff --git a/expect/linux-tpm.exp b/expect/linux-tpm.exp
index 6783503..8aff8ce 100644
--- a/expect/linux-tpm.exp
+++ b/expect/linux-tpm.exp
@@ -88,19 +88,14 @@
         }
 }
 
+expect_string "#" "finished reading PCRs"
+
 # Match the previously stored digest with the one generated by the
 # fTPM service. The pass criteria is that both digests must match,
 # meaning that TF-A successfully passed the event log to the TPM service.
-expect {
-        "#" {
-                spawn diff -s $TFA_DIGEST ftpm_event_log
-        }
+if {[catch {exec diff -s $TFA_DIGEST ftpm_event_log} result options] == 0} {
+        message "tests succeeded, digests matched"
+} else {
+        message "tests failed, digests did not match"
+        exit_uart -1
 }
-
-expect {
-        -exact "are identical" {
-                exit_uart 0
-        }
-}
-
-exit_uart -1