summaryrefslogtreecommitdiff
path: root/util/uart_stress_tester.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/uart_stress_tester.py')
-rwxr-xr-xutil/uart_stress_tester.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/util/uart_stress_tester.py b/util/uart_stress_tester.py
index 05976889d6..3b29a50a2b 100755
--- a/util/uart_stress_tester.py
+++ b/util/uart_stress_tester.py
@@ -90,7 +90,6 @@ class UartSerial:
"touch " + FLAG_FILENAME, # Create a temp file
],
"cleanup_cmd": [
- "\x03",
"rm -f " + FLAG_FILENAME, # Remove the temp file
"dmesg -E", # Enable console message
"logout", # Logout
@@ -110,7 +109,7 @@ class UartSerial:
"prompt": "ec:~$",
"device_type": "EC(Zephyr)",
"prepare_cmd": ["chan save", "chan 0"], # Disable console message
- "cleanup_cmd": ["x", "", "chan restore"],
+ "cleanup_cmd": ["", "chan restore"],
"end_of_input": CRLF,
},
)
@@ -214,6 +213,8 @@ class UartSerial:
self.serial.flushInput()
self.serial.flushOutput()
+ # Send 'x' to cancel any previous chargen command still running.
+ self.run_command(["x"], delay=1)
self.get_output() # drain data
# Send a couple of line feeds, and capture the prompt text.
@@ -329,9 +330,9 @@ class UartSerial:
if captured:
if self.num_ch_cap == 0:
# Strip prompt on first read (if it's there)
- start = captured.find("0123")
- if start > 0:
- captured = captured[start:]
+ prefixstr = self.dev_prof["prompt"] + " "
+ if captured.startswith(prefixstr):
+ captured = captured[len(prefixstr) :]
# There is some output data. Reset the data starvation count.
data_starve_count = 0
else: