Merge lp:~vila/ubuntu-test-cases/boottest into lp:~canonical-ci-engineering/ubuntu-test-cases/boottest

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: 405
Proposed branch: lp:~vila/ubuntu-test-cases/boottest
Merge into: lp:~canonical-ci-engineering/ubuntu-test-cases/boottest
Diff against target: 157 lines (+71/-6)
4 files modified
jenkins/testconfig.py (+1/-0)
scripts/device_info.py (+50/-5)
scripts/provision.sh (+11/-1)
utils/host/get-device-type (+9/-0)
To merge this branch: bzr merge lp:~vila/ubuntu-test-cases/boottest
Reviewer Review Type Date Requested Status
Para Siva (community) Approve
Review via email: mp+249301@code.launchpad.net

Description of the change

Reconcile the boottest branch by merging lp:~ubuntu-test-case-dev/ubuntu-test-cases/touch to get the krillin recovery handling and krillin-11 -> krillin-15 declarations

To post a comment you must log in.
Revision history for this message
Para Siva (psivaa) wrote :

Thanks for spotting this, the main ubuntu-test-cases/touch does provision the device properly. I assume merging this would not cause any boottest specific issues, if there were any tweaks made for that. But we could deal with it as and when they arise.
Thanks again.
+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'jenkins/testconfig.py'
--- jenkins/testconfig.py 2014-11-20 17:28:52 +0000
+++ jenkins/testconfig.py 2015-02-11 10:52:47 +0000
@@ -59,6 +59,7 @@
59 APTest('unity8-autopilot', 'unity8'),59 APTest('unity8-autopilot', 'unity8'),
60 APTest('camera-app-autopilot'),60 APTest('camera-app-autopilot'),
61 APTest('dialer-app-autopilot', pkgs=['dialer-app-autopilot']),61 APTest('dialer-app-autopilot', pkgs=['dialer-app-autopilot']),
62 APTest('ubuntu-keyboard-autopilot', pkgs=['ubuntu-keyboard-autopilot']),
62 APTest('messaging-app-autopilot', pkgs=['messaging-app-autopilot']),63 APTest('messaging-app-autopilot', pkgs=['messaging-app-autopilot']),
63 APTest('address-book-app-autopilot', pkgs=['address-book-app-autopilot']),64 APTest('address-book-app-autopilot', pkgs=['address-book-app-autopilot']),
64 APTest('reminders-autopilot',65 APTest('reminders-autopilot',
6566
=== modified file 'scripts/device_info.py'
--- scripts/device_info.py 2015-01-27 03:37:14 +0000
+++ scripts/device_info.py 2015-02-11 10:52:47 +0000
@@ -1,9 +1,13 @@
1#!/usr/bin/env python1#!/usr/bin/env python
22
3import logging3import logging
4import os
4import re5import re
6import requests
5import subprocess7import subprocess
8import sys
6import time9import time
10import urlparse
711
8from ncd_usb import set_relay12from ncd_usb import set_relay
913
@@ -57,12 +61,27 @@
5761
58 def reimage_from_fastboot(self):62 def reimage_from_fastboot(self):
59 #Starting from fastboot mode, put a known-good image on the device63 #Starting from fastboot mode, put a known-good image on the device
64 recovery_base = 'http://people.canonical.com/~plars/touch'
65 recovery_img = 'recovery-{}.img'.format(self.devtype)
66 recovery_url = os.path.join(recovery_base, recovery_img)
67 # For certain devices, we need to first pull an alternate
68 # recovery image that has adb enabled. If it's needed, it will
69 # be at that url, otherwise we don't even try to use it.
70 if not os.path.exists(os.path.join('recovery', recovery_img)):
71 try:
72 _download(recovery_url, 'recovery')
73 except:
74 # Don't fail for any reason, if attempt to flash without
75 pass
76 udf_command = ['ubuntu-device-flash', 'touch', '--serial',
77 self.serial, '--channel', 'ubuntu-touch/stable',
78 '--bootstrap', '--developer-mode',
79 '--password', '0000']
80 if os.path.exists(os.path.join('recovery', recovery_img)):
81 udf_command.extend(['--recovery-image',
82 os.path.join('recovery', recovery_img)])
60 log.info("Flashing the last stable image")83 log.info("Flashing the last stable image")
61 subprocess.check_output(['ubuntu-device-flash', 'touch', '--serial',84 subprocess.check_output(udf_command)
62 self.serial, '--channel',
63 'ubuntu-touch/stable', '--bootstrap',
64 '--developer-mode',
65 '--password', '0000'])
66 return self.wait_for_device(600)85 return self.wait_for_device(600)
6786
68 def wait_for_fastboot(self, timeout=120):87 def wait_for_fastboot(self, timeout=120):
@@ -108,6 +127,9 @@
108 def force_bootloader(self):127 def force_bootloader(self):
109 bootloader_func = getattr(128 bootloader_func = getattr(
110 self, '_{}_to_bootloader'.format(self.devtype))129 self, '_{}_to_bootloader'.format(self.devtype))
130 if not self.relay_url:
131 log.error("Device cannot be recovered, no relay data exists!")
132 sys.exit(-1)
111 if bootloader_func and callable(bootloader_func):133 if bootloader_func and callable(bootloader_func):
112 bootloader_func()134 bootloader_func()
113 else:135 else:
@@ -185,6 +207,11 @@
185 relay_url="http://decatur.ubuntu-ci",207 relay_url="http://decatur.ubuntu-ci",
186 bank=2, power_pin=0, volume_up_pin=1,208 bank=2, power_pin=0, volume_up_pin=1,
187 volume_down_pin=2),209 volume_down_pin=2),
210 "krillin-11": TouchDevice("krillin", "JB072312"),
211 "krillin-12": TouchDevice("krillin", "JB071487"),
212 "krillin-13": TouchDevice("krillin", "JB044235"),
213 "krillin-14": TouchDevice("krillin", "JB072205"),
214 "krillin-15": TouchDevice("krillin", "JB071743"),
188 "ps-mako-01": TouchDevice("mako", "0090f741e3d141bc"),215 "ps-mako-01": TouchDevice("mako", "0090f741e3d141bc"),
189 "ps-mako-02": TouchDevice("mako", "04ccca120acd4dea"),216 "ps-mako-02": TouchDevice("mako", "04ccca120acd4dea"),
190 "ps-mako-03": TouchDevice("mako", "04cb53b598546534"),217 "ps-mako-03": TouchDevice("mako", "04cb53b598546534"),
@@ -256,3 +283,21 @@
256def get_device(name):283def get_device(name):
257 # This raises KeyError if we don't have any record of that device284 # This raises KeyError if we don't have any record of that device
258 return DEVICES[name]285 return DEVICES[name]
286
287
288def _download(url, path):
289 os.makedirs(path)
290 urlpath = urlparse.urlsplit(url).path
291 filename = os.path.basename(urlpath)
292 filename = os.path.join(path, filename)
293
294 response = requests.get(url, stream=True)
295 response.raise_for_status()
296 with open(filename, 'wb') as f:
297 for chunk in response.iter_content(chunk_size=64 * 1024):
298 # Ignore keep-alives
299 if not chunk:
300 continue
301 f.write(chunk)
302 f.flush()
303 return filename
259304
=== modified file 'scripts/provision.sh'
--- scripts/provision.sh 2014-11-17 15:52:10 +0000
+++ scripts/provision.sh 2015-02-11 10:52:47 +0000
@@ -8,6 +8,7 @@
8export PATH=${BASEDIR}/../utils/host:${PATH}8export PATH=${BASEDIR}/../utils/host:${PATH}
99
10RESDIR=`pwd`/clientlogs10RESDIR=`pwd`/clientlogs
11RECOVERY_URL="http://people.canonical.com/~plars/touch"
1112
12NETWORK_FILE="${NETWORK_FILE-${HOME}/.ubuntu-ci/wifi.conf}"13NETWORK_FILE="${NETWORK_FILE-${HOME}/.ubuntu-ci/wifi.conf}"
1314
@@ -118,6 +119,7 @@
118119
119full_flash() {120full_flash() {
120 log "FLASHING DEVICE"121 log "FLASHING DEVICE"
122 DEVICE_TYPE=$(get-device-type)
121 # Use a 60 second retry loop for reboot_bootloader.123 # Use a 60 second retry loop for reboot_bootloader.
122 # If the attempt failed, it may take nearly 60 seconds to complete124 # If the attempt failed, it may take nearly 60 seconds to complete
123 # the reboot cycle to get the device back to a sane state.125 # the reboot cycle to get the device back to a sane state.
@@ -125,7 +127,15 @@
125 # Use a 10 second retry loop for ubuntu-device-flash.127 # Use a 10 second retry loop for ubuntu-device-flash.
126 # Most failures appear to be transient and work with an immediate128 # Most failures appear to be transient and work with an immediate
127 # retry.129 # retry.
128 retry 10 3 timeout 1800 ubuntu-device-flash ${REVISION} touch --password $PHABLET_PASSWORD $IMAGE_OPT130 RECOVERY=""
131 mkdir -p recovery
132 log "The following wget is only needed for some devices. If it fails, it's probably safe to ignore"
133 wget -P recovery \
134 ${RECOVERY_URL}/recovery-${DEVICE_TYPE}.img || /bin/true
135 if [ -f recovery/recovery-${DEVICE_TYPE}.img ]; then
136 RECOVERY="--recovery-image=recovery/recovery-${DEVICE_TYPE}.img"
137 fi
138 retry 10 3 timeout 1800 ubuntu-device-flash ${REVISION} touch ${RECOVERY} --password $PHABLET_PASSWORD $IMAGE_OPT
129 adb wait-for-device139 adb wait-for-device
130 sleep 60 #give the system a little time140 sleep 60 #give the system a little time
131}141}
132142
=== added file 'utils/host/get-device-type'
--- utils/host/get-device-type 1970-01-01 00:00:00 +0000
+++ utils/host/get-device-type 2015-02-11 10:52:47 +0000
@@ -0,0 +1,9 @@
1#!/usr/bin/env python
2
3import os
4from phabletutils.environment import detect_device
5
6device_type = os.environ.get('DEVICE_TYPE')
7if device_type is None:
8 device_type = detect_device(None)
9print(device_type)

Subscribers

People subscribed via source and target branches