1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#!/bin/bash
# Script to run autopilot tests for all apps
#
# Assumptions:-
# * Device already running some build of Ubuntu Touch and is connected via USB
# * Phablet-team tools already installed
#
# (c) 2013 Canonical - Alan Pope alan.pope@canonical.com
UBUNTU_ROOT="/data/ubuntu"
DATESTAMP=`date +%Y%m%d`-`date +%H%M%S`
function adb_root {
echo ":: Run adb root"
adb root
if [ $? -ne "0" ]; then
echo ":: adb root failed"
exit 1
fi
}
function pause {
echo ":: Wait $1"
sleep $1
}
adb_root
pause 5
phablet-network
pause 5
# setup ssh tunnel
phablet-network -i
echo ":: Build script to do autopilot run"
TMP_FILE=$(mktemp)
cat > $TMP_FILE << 'EOF'
#!/bin/bash
export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
add-apt-repository -y ppa:phablet-team/tools
add-apt-repository -y ppa:autopilot/unstable
add-apt-repository -y ppa:phablet-team/ppa
apt-get update
apt-get -y dist-upgrade
apt-get -y install autopilot-touch
apt-get -y install camera-app-autopilot indicators-client-autopilot share-app-autopilot mediaplayer-app-autopilot qml-phone-shell-autopilot notes-app-autopilot gallery-app-autopilot phone-app-autopilot webbrowser-app-autopilot ubuntu-ui-toolkit-autopilot
EOF
echo ":: Run Script"
adb push $TMP_FILE $UBUNTU_ROOT/$TMP_FILE
adb shell chmod 755 $UBUNTU_ROOT/$TMP_FILE
adb shell chroot $UBUNTU_ROOT $UBUNTU_ROOT/$TMP_FILE
# Open an ssh port to the device
adb forward tcp:22222 tcp:22
# ssh in and run the tests... (currently broken)
ssh -p 22222 -o StrictHostKeyChecking=no phablet@localhost autopilot list camera_app
#ssh -p 22222 -o StrictHostKeyChecking=no phablet@localhost autopilot list webbrowser_app
#ssh -p 22222 -o StrictHostKeyChecking=no phablet@localhost autopilot list share_app
#ssh -p 22222 -o StrictHostKeyChecking=no phablet@localhost autopilot list notes_app
|