summaryrefslogtreecommitdiff
path: root/tcwg-benchmark.sh
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2020-04-17 10:11:05 +0100
committerDavid Spickett <david.spickett@linaro.org>2020-04-17 13:14:27 +0000
commita0e4a3728526c912c94729b874fcdd4ae9753c84 (patch)
treecd5861b6e0fda0b4d2585e6bcd8bf9e7c25acb5a /tcwg-benchmark.sh
parent9870685df5ce0e2690f0632d50acb05393e13b7c (diff)
tcwg-benchmark.sh: Minor fixes
* Dedupe getting hostname for ssh toolchain URLs * Check toolchain type earlier * Error if SSH doesn't respond after reboot (and change the other uses of wait_for_ssh_server to follow the same format) Change-Id: Ib7823e5a83500e0d95912ef0d3ba993051a67533
Diffstat (limited to 'tcwg-benchmark.sh')
-rwxr-xr-xtcwg-benchmark.sh32
1 files changed, 15 insertions, 17 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh
index 9166dae5..9a74eadd 100755
--- a/tcwg-benchmark.sh
+++ b/tcwg-benchmark.sh
@@ -53,16 +53,14 @@ case "$toolchain_url" in
# Extract host:port: specification from ccprefix, we don't
# need to care about :parallelize here, just pass it to run.sh
# if present.
+ build=${ccprefix%:*}
+ build_container_host="$(echo $build | cut -d: -f 1)"
case ${ccprefix} in
*:*:*)
- build=${ccprefix%:*}
- build_container_host="$(echo $build | cut -d: -f 1)"
build_container_port="$(echo $build | cut -s -d: -f 2)"
;;
*:*)
# If no port is specified, use 22 (ssh default port)
- build=${ccprefix%:*}
- build_container_host="$(echo $build | cut -d: -f 1)"
build_container_port=22
;;
esac
@@ -116,6 +114,15 @@ case "$toolchain_url" in
;;
esac
+# Sanity check that toolchain_type is supported
+case "$toolchain_type" in
+ gnu|llvm) ;;
+ *)
+ echo "ERROR: Unsupported toolchain type: $toolchain_type"
+ exit 1
+ ;;
+esac
+
case "$toolchain_url" in
"http://"*|"https://"*|"rsync://"*|"ssh://"*)
@@ -142,10 +149,6 @@ case "$toolchain_url" in
exit 1
fi
;;
- *)
- echo "ERROR: wrong toolchain_type: $toolchain_type"
- exit 1
- ;;
esac
case "$toolchain_type" in
@@ -173,15 +176,6 @@ case "$toolchain_url" in
;;
esac
-# Sanity check that toolchain_type is supported
-case "$toolchain_type" in
- gnu|llvm) ;;
- *)
- echo "ERROR: Could not determine toolchain type: $toolchain_type"
- exit 1
- ;;
-esac
-
case "$sysroot" in
"tarball")
sysroot="$build_container_host:$build_container_port:$(find "$toolchaindir" -name "libc")"
@@ -238,6 +232,10 @@ if $reboot; then
sleep 30 # Give time to the board to shutdown
ret=0
wait_for_ssh_server $boardname 22 100 || ret=$?
+ if [ $ret != 0 ]; then
+ echo "SSH server did not respond after reboot, exiting."
+ exit $ret
+ fi
fi
case "$testmode" in