Skip to content

Commit

Permalink
[tdx-guest] Bug Fix: remove potential whitespace in server ID
Browse files Browse the repository at this point in the history
in corner case, server ID return trimed value still has leading
whitespace, remove such potential leading and trailing whitespace for
correct server target operation

[Test Components] tdx-guest
[Test Types] func
[Supported Devices] spr,emr,gnr,srf

Signed-off-by: Hongyu Ning <[email protected]>
  • Loading branch information
hongyuni committed Sep 5, 2024
1 parent 5564bb4 commit 03712a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BM/tdx-guest/tdx_speed_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ fi
# get nearest server ID for test
while [[ "$RETRY_ID" -gt 0 ]]; do
ID=$(speedtest-cli --list | awk -F')' 'NR==2 {print $1; exit}')
# remove potential whitespace before or after server ID
ID=$(echo "$ID" | awk '{$1=$1; print}')
if [[ "$ID" =~ ^[0-9]+$ ]]; then
if [ "$ID" -gt 0 ]; then
test_print_trc "BW test server ID: $ID @RETRY: $RETRY_ID"
Expand Down

0 comments on commit 03712a8

Please sign in to comment.