~cjohnston/+junk/settle

« back to all changes in this revision

Viewing changes to jenkins/run-touch-security-smoke.sh

  • Committer: Chris Johnston
  • Date: 2013-08-12 18:09:58 UTC
  • mfrom: (43.1.1 remove)
  • Revision ID: chrisjohnston@ubuntu.com-20130812180958-ws87g4u8e88sjr5z
Remove un-needed runlist files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
# Run tests on ubuntu-touch devices and gather the results
3
 
# This script depends on having ~/magners-wifi for setting up the
4
 
# network
5
 
set -x
6
 
 
7
 
BRANCH=lp:~canonical-platform-qa/ubuntu-test-runlists/touch-runlists
8
 
WORKSPACE=/home/phablet/workspace
9
 
 
10
 
function show_usage() {
11
 
    echo "USAGE: $0 -s ADB_SERIAL"
12
 
    exit 0
13
 
}
14
 
 
15
 
while getopts "h?s:" opt; do
16
 
    case "$opt" in
17
 
    h|\?)
18
 
        show_usage
19
 
        ;;
20
 
    s)  ADB_SERIAL=$OPTARG
21
 
        ;;
22
 
    esac
23
 
done
24
 
if [ -z $ADB_SERIAL ]; then show_usage; fi
25
 
 
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"
29
 
 
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
33
 
sleep 30
34
 
phablet-network-setup -s $ADB_SERIAL -i -n ~/magners-wifi
35
 
 
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"
46
 
RC=$?
47
 
${SCPCMD} -r phablet@localhost:${WORKSPACE}/results/*.yaml .
48
 
exit $RC