34
echo "killing child pids: $PIDS"
34
echo "killing child pids: $PIDS"
41
export PATH=${BASEDIR}/utils/host:${PATH}
43
# allow for certain commands to run from host/target
44
# see unity8-autopilot/ts_control for example
45
export TARGET_PREFIX=adb-shell
47
[ -z $ANDROID_SERIAL ] || ADBOPTS="-s $ANDROID_SERIAL"
49
# If we are not in the utah group, then we don't have permissions
50
# for /var/lib/utah, so run under sudo
51
if ! groups |grep -q utah ; then
53
sudo TARGET_PREFIX="${TARGET_PREFIX}" PATH="${PATH}" \
58
--results-dir "${RESDIR}" \
59
--skip-install --skip-network --skip-utah \
61
--pull /home/phablet/.cache/upstart \
62
--pull /tmp/xmlresults \
63
--pull /var/log/syslog \
64
--pull /var/log/kern.log \
65
--pull /var/log/upstart/whoopsie.log \
67
-l "${TESTSUITE_HOST}/master.run"
69
TARGET_PREFIX="${TARGET_PREFIX}" PATH="${PATH}" \
74
--results-dir "${RESDIR}" \
75
--skip-install --skip-network --skip-utah \
77
--pull /home/phablet/.cache/upstart \
78
--pull /tmp/xmlresults \
79
--pull /var/log/syslog \
80
--pull /var/log/kern.log \
81
--pull /var/log/upstart/whoopsie.log \
83
-l "${TESTSUITE_HOST}/master.run"
86
# make sure the user running this script can remove its artifacts.
87
# only run this if we had to run under sudo
88
if [ "${SUDO}" = "sudo" ] ; then
89
sudo chown -R "${USER}" ${RESDIR}
41
export PATH=${BASEDIR}/utils/host:${PATH}
43
# allow for certain commands to run from host/target
44
# see unity8-autopilot/ts_control for example
45
export TARGET_PREFIX=adb-shell
47
[ -z $ANDROID_SERIAL ] || ADBOPTS="-s $ANDROID_SERIAL"
49
# If we are not in the utah group, then we don't have permissions
50
# for /var/lib/utah, so run under sudo
51
if ! groups |grep -q utah ; then
53
sudo TARGET_PREFIX="${TARGET_PREFIX}" PATH="${PATH}" \
58
--results-dir "${RESDIR}" \
59
--skip-install --skip-network --skip-utah \
61
--pull /home/phablet/.cache/upstart \
62
--pull /tmp/xmlresults \
63
--pull /var/log/syslog \
64
--pull /var/log/kern.log \
65
--pull /var/log/upstart/whoopsie.log \
67
-l "${TESTSUITE_HOST}/master.run"
69
TARGET_PREFIX="${TARGET_PREFIX}" PATH="${PATH}" \
74
--results-dir "${RESDIR}" \
75
--skip-install --skip-network --skip-utah \
77
--pull /home/phablet/.cache/upstart \
78
--pull /tmp/xmlresults \
79
--pull /var/log/syslog \
80
--pull /var/log/kern.log \
81
--pull /var/log/upstart/whoopsie.log \
83
-l "${TESTSUITE_HOST}/master.run"
86
# make sure the user running this script can remove its artifacts.
87
# only run this if we had to run under sudo
88
if [ "${SUDO}" = "sudo" ] ; then
89
sudo chown -R "${USER}" ${RESDIR}
94
[ -z $INSTALL_URL ] && return
95
echo "Ensuring target has proper image..."
96
REQUIRED_UUID=$(curl ${INSTALL_URL}/artifact/clientlogs/.ci-uuid)
97
ACTUAL_UUID=$(adb shell "cat /home/phablet/.ci-uuid | tr -d '\r\n'")
98
if [ "$REQUIRED_UUID" != "$ACTUAL_UUID" ] ; then
99
echo "UUIDs $REQUIRED_UUID != $ACTUAL_UUID, reprovisioning device..."
100
ARGS=$(curl ${INSTALL_URL}/artifact/clientlogs/.ci-utah-args | tr -d '\r\n')
101
SERVER=$(curl ${INSTALL_URL}/artifact/clientlogs/.ci-flash-server | tr -d '\r\n')
102
UUID=$REQUIRED_UUID IMAGE_SERVER=$SERVER IMAGE_OPT=$ARGS \
103
${BASEDIR}/scripts/provision.sh
94
[ -z $INSTALL_URL ] && return
95
echo "Ensuring target has proper image..."
96
REQUIRED_UUID=$(curl ${INSTALL_URL}/artifact/clientlogs/.ci-uuid)
97
ACTUAL_UUID=$(adb shell "cat /home/phablet/.ci-uuid | tr -d '\r\n'")
98
if [ "$REQUIRED_UUID" != "$ACTUAL_UUID" ] ; then
99
echo "UUIDs $REQUIRED_UUID != $ACTUAL_UUID, reprovisioning device..."
100
ARGS=$(curl ${INSTALL_URL}/artifact/clientlogs/.ci-utah-args | tr -d '\r\n')
101
SERVER=$(curl ${INSTALL_URL}/artifact/clientlogs/.ci-flash-server | tr -d '\r\n')
102
UUID=$REQUIRED_UUID IMAGE_SERVER=$SERVER IMAGE_OPT=$ARGS \
103
${BASEDIR}/scripts/provision.sh
115
# print the build date so the jenkins job can use it as the
117
adb pull /var/log/installer/media-info ${RESDIR}
118
BUILDID=$(adb shell cat /home/phablet/.ci-version)
119
echo "= TOUCH IMAGE VERSION:$BUILDID"
121
adb shell "top -n1 -b" > ${RESDIR}/top.log
124
adb shell 'sudo rm -f /var/crash/*'
125
if [ -z $QUICK ] ; then
126
# get the phone in sane place
128
# sometimes reboot doesn't happen fast enough, so add a little
129
# delay to help ensure its actually rebooted and we didn't just
130
# connect back to the device before it rebooted
134
phablet-network --skip-setup -t 90s
135
adb shell sudo powerd-cli active &
137
adb shell sudo powerd-cli display on &
140
echo "SKIPPING phone reboot..."
143
${BASEDIR}/utils/host/adb-shell "sudo aa-clickhook -f --include=/usr/share/autopilot-touch/apparmor/click.rules"
145
echo "launching test from the host...."
147
adb shell 'sudo rm -f /var/crash/*'
149
if ! `grep "^errors: [!0]" < $UTAHFILE >/dev/null` ; then
153
if ! `grep "^failures: [!0]" < $UTAHFILE >/dev/null` ; then
154
echo "failures found"
157
echo "Results Summary"
158
echo "---------------"
159
egrep '^(errors|failures|passes|fetch_errors):' $UTAHFILE
115
# print the build date so the jenkins job can use it as the
117
adb pull /var/log/installer/media-info ${RESDIR}
118
BUILDID=$(adb shell cat /home/phablet/.ci-version)
119
echo "= TOUCH IMAGE VERSION:$BUILDID"
121
adb shell "top -n1 -b" > ${RESDIR}/top.log
124
adb shell 'sudo rm -f /var/crash/*'
125
if [ -z $QUICK ] ; then
126
# get the phone in sane place
128
# sometimes reboot doesn't happen fast enough, so add a little
129
# delay to help ensure its actually rebooted and we didn't just
130
# connect back to the device before it rebooted
134
phablet-network --skip-setup -t 90s
135
adb shell sudo powerd-cli active &
137
adb shell sudo powerd-cli display on &
140
echo "SKIPPING phone reboot..."
143
${BASEDIR}/utils/host/adb-shell "sudo aa-clickhook -f --include=/usr/share/autopilot-touch/apparmor/click.rules"
145
echo "launching test from the host...."
147
adb shell 'sudo rm -f /var/crash/*'
149
if ! `grep "^errors: [!0]" < $UTAHFILE >/dev/null` ; then
153
if ! `grep "^failures: [!0]" < $UTAHFILE >/dev/null` ; then
154
echo "failures found"
157
echo "Results Summary"
158
echo "---------------"
159
egrep '^(errors|failures|passes|fetch_errors):' $UTAHFILE
163
163
while getopts p:s:a:Qh opt; do