summaryrefslogtreecommitdiff
path: root/tools/buildbot-setup-device.sh
diff options
context:
space:
mode:
author Ulya Trafimovich <skvadrik@google.com> 2021-11-09 14:46:22 +0000
committer Ulyana Trafimovich <skvadrik@google.com> 2021-11-10 17:40:37 +0000
commit5298bcd20622df02bf207181ec6d758e0d2bf671 (patch)
tree0f2894b21159104f2a2aaf093e1d265378b2b6ca /tools/buildbot-setup-device.sh
parentcbf71ec69f0ce1bc20418e3ba68430d17f97fed0 (diff)
buildbot-*.sh scripts: clean up colorful messages.
Add helper functions `msginfo`, `msgwarning`, `msgerror`, `msgnote` and use them in the buildbot scripts. Bug: none Test: ran tests in chroot as described in art/test/README.chroot.md, observed no changes in the colored output Change-Id: Ibd577c80ddabef2c04d4f814c46a0d70829f8946
Diffstat (limited to 'tools/buildbot-setup-device.sh')
-rwxr-xr-xtools/buildbot-setup-device.sh32
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/buildbot-setup-device.sh b/tools/buildbot-setup-device.sh
index d9bada079a..fc306279ea 100755
--- a/tools/buildbot-setup-device.sh
+++ b/tools/buildbot-setup-device.sh
@@ -29,10 +29,10 @@ fi
adb root
adb wait-for-device
-echo -e "${green}Date on host${nc}"
+msginfo "Date on host"
date
-echo -e "${green}Date on device${nc}"
+msginfo "Date on device"
adb shell date
host_seconds_since_epoch=$(date -u +%s)
@@ -48,37 +48,37 @@ seconds_per_hour=3600
# b/187295147 : Disable live-lock kill daemon.
# It can confuse long running processes for issues and kill them.
# This usually manifests as temporarily lost adb connection.
-echo -e "${green}Killing llkd, seen killing adb${nc}"
+msginfo "Killing llkd, seen killing adb"
adb shell setprop ctl.stop llkd-0
adb shell setprop ctl.stop llkd-1
# Kill logd first, so that when we set the adb buffer size later in this file,
# it is brought up again.
-echo -e "${green}Killing logd, seen leaking on fugu/N${nc}"
-adb shell pkill -9 -U logd logd && echo -e "${green}...logd killed${nc}"
+msginfo "Killing logd, seen leaking on fugu/N"
+adb shell pkill -9 -U logd logd && msginfo "...logd killed"
# Update date on device if the difference with host is more than one hour.
if [ $abs_time_difference_in_seconds -gt $seconds_per_hour ]; then
- echo -e "${green}Update date on device${nc}"
+ msginfo "Update date on device"
adb shell date -u @$host_seconds_since_epoch
fi
-echo -e "${green}Turn off selinux${nc}"
+msginfo "Turn off selinux"
adb shell setenforce 0
$verbose && adb shell getenforce
-echo -e "${green}Setting local loopback${nc}"
+msginfo "Setting local loopback"
adb shell ifconfig lo up
$verbose && adb shell ifconfig
if $verbose; then
- echo -e "${green}List properties${nc}"
+ msginfo "List properties"
adb shell getprop
- echo -e "${green}Uptime${nc}"
+ msginfo "Uptime"
adb shell uptime
- echo -e "${green}Battery info${nc}"
+ msginfo "Battery info"
adb shell dumpsys battery
fi
@@ -91,19 +91,19 @@ else
buffer_size=32MB
fi
-echo -e "${green}Setting adb buffer size to ${buffer_size}${nc}"
+msginfo "Setting adb buffer size to ${buffer_size}"
adb logcat -G ${buffer_size}
$verbose && adb logcat -g
-echo -e "${green}Removing adb spam filter${nc}"
+msginfo "Removing adb spam filter"
adb logcat -P ""
$verbose && adb logcat -p
-echo -e "${green}Kill stalled dalvikvm processes${nc}"
+msginfo "Kill stalled dalvikvm processes"
# 'ps' on M can sometimes hang.
timeout 2s adb shell "ps" >/dev/null
if [[ $? == 124 ]] && [[ "$ART_TEST_RUN_ON_ARM_FVP" != true ]]; then
- echo -e "${green}Rebooting device to fix 'ps'${nc}"
+ msginfo "Rebooting device to fix 'ps'"
adb reboot
adb wait-for-device root
else
@@ -116,7 +116,7 @@ fi
if [[ -n "$ART_TEST_CHROOT" ]]; then
# Prepare the chroot dir.
- echo -e "${green}Prepare the chroot dir in $ART_TEST_CHROOT${nc}"
+ msginfo "Prepare the chroot dir in $ART_TEST_CHROOT"
# Check that ART_TEST_CHROOT is correctly defined.
[[ "x$ART_TEST_CHROOT" = x/* ]] || { echo "$ART_TEST_CHROOT is not an absolute path"; exit 1; }