feat: use original Expect scripts for UART validation

To avoid having to implement custom Python post-expect scripts for every
payload that might use a non-primary UART, and to make use of as much
prior art as possible, this change replaces the OpenCI-only post-expect
scripts with the same one uses used by both the local and on-premises CI.

The original Expect scripts have been amended to identify whether they're
being run in the postprocessing step and, if so, load the UART log from a
file rather than connecting to the FVP over Telnet.

Change-Id: I61a5859de4f3f62b50deaffe84580206ec411c99
Signed-off-by: Chris Kay <chris.kay@arm.com>
diff --git a/expect/handle-arguments.inc b/expect/handle-arguments.inc
index f475302..6a730a5 100644
--- a/expect/handle-arguments.inc
+++ b/expect/handle-arguments.inc
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2019-2020 Arm Limited. All rights reserved.
+# Copyright (c) 2019-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -10,8 +10,14 @@
 source [file join [file dirname [info script]] utils.inc]
 
 # Store environment variables into local variables
-set uart_port [get_param uart_port]
-set timeout [get_param timeout]
+set timeout [get_param timeout 30]
 
-# Open a telnet connection on the required UART port
-set telnet_pid [spawn telnet localhost $uart_port]
+if { [postprocessing] != 1 } {
+    # Open a Telnet connection to the required UART port
+    set uart_port [get_param uart_port]
+    set telnet_pid [spawn telnet localhost $uart_port]
+} else {
+    # Read directly from the UART log file
+    set uart_log_file [get_param uart_log_file]
+    set telnet_pid [spawn cat $uart_log_file]
+}