2
# Run tests on ubuntu-touch devices and gather the results
3
# This script depends on having ~/magners-wifi for setting up the
7
BRANCH=lp:~canonical-platform-qa/ubuntu-test-runlists/touch-runlists
8
WORKSPACE=/home/phablet/workspace
10
function show_usage() {
11
echo "USAGE: $0 -s ADB_SERIAL"
15
while getopts "h?s:" opt; do
24
if [ -z $ADB_SERIAL ]; then show_usage; fi
26
PORT=`shuf -i 8000-65000 -n1`
27
SSHCMD="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p$PORT phablet@localhost"
28
SCPCMD="scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P$PORT"
30
flock /tmp/phablet-flash-lock phablet-flash -s $ADB_SERIAL --pending
31
adb -s $ADB_SERIAL wait-for-device
32
phablet-network-setup -s $ADB_SERIAL -n ~/magners-wifi
34
phablet-network-setup -s $ADB_SERIAL -i -n ~/magners-wifi
36
adb -s $ADB_SERIAL shell getprop ro.build.display.id
37
adb -s $ADB_SERIAL shell "uname -a" > uname.txt
38
adb -s $ADB_SERIAL forward tcp:$PORT tcp:22
39
adb -s $ADB_SERIAL shell "echo phablet ALL=NOPASSWD: ALL >> /etc/sudoers.d/phablet"
40
adb -s $ADB_SERIAL shell "chmod 440 /etc/sudoers.d/phablet"
41
${SSHCMD} rm -rf ${WORKSPACE}
42
${SSHCMD} mkdir -p ${WORKSPACE}/results
43
${SSHCMD} "sudo add-apt-repository ppa:utah/stable < /dev/null"
44
${SSHCMD} "sudo apt-get update && sudo apt-get install -y utah-client"
45
${SSHCMD} "sudo utah -r ${BRANCH}/runlists/touch-smoke-security.run > ${WORKSPACE}/results/utah.touch-smoke-security.yaml"
47
${SCPCMD} -r phablet@localhost:${WORKSPACE}/results/*.yaml .