Merge lp:~brendan-donegan/checkbox/bug1084601 into lp:checkbox
- bug1084601
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Zygmunt Krynicki | ||||
Approved revision: | 1866 | ||||
Merged at revision: | 1880 | ||||
Proposed branch: | lp:~brendan-donegan/checkbox/bug1084601 | ||||
Merge into: | lp:checkbox | ||||
Diff against target: |
406 lines (+184/-51) 3 files modified
debian/changelog (+5/-0) jobs/bluetooth.txt.in (+15/-1) jobs/suspend.txt.in (+164/-50) |
||||
To merge this branch: | bzr merge lp:~brendan-donegan/checkbox/bug1084601 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zygmunt Krynicki (community) | Approve | ||
Brendan Donegan (community) | Needs Resubmitting | ||
Review via email: mp+142852@code.launchpad.net |
Commit message
Description of the change
This branch adds a couple of checks before running commands which depend on Bluetooth working. One is to check if the hardware is hard blocked and provide a warning - the subsequent attempt to test will fail. The second is to check if the hardware is soft blocked and again provide a warning, but this time try and unblock it. There is also a short delay after the unblock as most Bluetooth chips take a few seconds to reinitialise (running the test with no delay was exhibiting failures)
Zygmunt Krynicki (zyga) wrote : | # |
The attempt to merge lp:~brendan-donegan/checkbox/bug1084601 into lp:checkbox failed. Below is the output from the failed tests.
Running unittests...
[checkbox/
(tests=9, failures=0, errors=0)
[checkbox/
(tests=8, failures=0, errors=0)
[checkbox/
(tests=5, failures=0, errors=0)
[checkbox/
(tests=14, failures=0, errors=0)
[checkbox/
(tests=3, failures=0, errors=0)
[checkbox/
(tests=0, failures=0, errors=0)
[checkbox/
(tests=4, failures=0, errors=0)
[checkbox/
(tests=2, failures=0, errors=0)
[checkbox/
(tests=10, failures=0, errors=0)
[checkbox/
(tests=7, failures=0, errors=0)
[checkbox/
(tests=4, failures=0, errors=0)
[checkbox/
(tests=3, failures=0, errors=0)
[checkbox/
(tests=2, failures=0, errors=0)
[checkbox/
(tests=1, failures=0, errors=0)
Running doctests...
[checkbox/
(tests=0, failures=0, errors=0)
[checkbox/
(tests=0, failures=0, errors=0)
Total test cases: 72
Total doctests: 0
Total failures: 0
Total errors: 0
running test
running egg_info
creating plainbox.egg-info
writing requirements to plainbox.
writing plainbox.
writing top-level names to plainbox.
writing dependency_links to plainbox.
writing entry points to plainbox.
writing manifest file 'plainbox.
reading manifest file 'plainbox.
reading manifest template 'MANIFEST.in'
writing manifest file 'plainbox.
running build_ext
+ ./test
.........
-------
Ran 9 tests in 0.041s
OK
........
-------
Ran 8 tests in 0.177s
OK
.....
-------
Ran 5 tests in 0.050s
OK
..............
-------
Ran 14 tests in 0.053s
OK
...
-------
Ran 3 tests in 0.025s
OK
-------
Ran 0 tests in 0.000s
OK
....
-------
Ran 4 tests in 0.037s
OK
..
-------
Ran 2 tests in 0.008s
OK
..........
-------
Ran 10 tests in 3.043s
OK
.......
-------
Ran 7 tests in 82.222s
OK
....
-------
Ran 4 tests in 0.054s
OK
...
-------
Zygmunt Krynicki (zyga) wrote : | # |
11:02 < zyga> brendand: I found a bug in your MP
11:02 < zyga> brendand: and something else that's wrong as well, digging deeper
11:13 < zyga> brendand: there's a bug in the shell code
11:13 < zyga> but shell is not parsed here so it should _not_ break
11:14 < zyga> brendand: the actual error is caused by parsing two job entries as one
11:14 < zyga> brendand: so all kinds of weird text gets interpreted as python expression
11:15 < zyga> brendand: this comes from
11:15 < zyga> Failed to parse resource program for job <JobDefinition name:'suspend/
11:15 < zyga> I'm trying to figure out exactly why this happens, the text looks fine to me
11:17 < zyga> ehhh
11:17 < zyga> ok
11:17 < zyga> I see it
11:17 < zyga> brendand: line 502 in suspend.txt.in
11:17 < zyga> brendand: remove the leading space
11:17 < zyga> brendand: and I'll get the extra debug features as a patch
11:18 < zyga> brendand: also you've missed echo in subsequent line in the shell
Brendan Donegan (brendan-donegan) wrote : | # |
Addressed on line 502 and 514
Zygmunt Krynicki (zyga) wrote : | # |
There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2013-01-10 09:28:29 +0000 |
3 | +++ debian/changelog 2013-01-14 10:51:21 +0000 |
4 | @@ -1,7 +1,12 @@ |
5 | checkbox (0.15.1) raring; urgency=low |
6 | |
7 | + [ Daniel Manrique ] |
8 | * Bumped revision number to 0.15.1 and restored previous trunk changelog. |
9 | |
10 | + [ Brendan Donegan ] |
11 | + * jobs/bluetooth.txt.in, jobs/suspend.txt.in - unblock Bluetooth hardware |
12 | + before running any Bluetooth tests to avoid these failing (LP: #1084601) |
13 | + |
14 | -- Daniel Manrique <roadmr@ubuntu.com> Wed, 09 Jan 2013 16:40:02 -0500 |
15 | |
16 | checkbox (0.15) raring; urgency=low |
17 | |
18 | === modified file 'jobs/bluetooth.txt.in' |
19 | --- jobs/bluetooth.txt.in 2013-01-07 16:57:11 +0000 |
20 | +++ jobs/bluetooth.txt.in 2013-01-14 10:51:21 +0000 |
21 | @@ -4,7 +4,21 @@ |
22 | requires: |
23 | package.name == 'bluez' |
24 | device.category == 'BLUETOOTH' |
25 | -command: set -o pipefail; hcitool dev | tail -n+2 | awk '{print $2}' | tee $CHECKBOX_DATA/bluetooth_address |
26 | +command: |
27 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes'; then |
28 | + echo "rfkill shows BT is hard blocked" |
29 | + fi |
30 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes'; then |
31 | + echo "rfkill shows BT is soft blocked, removing before testing" |
32 | + rfkill unblock bluetooth |
33 | + sleep 3 |
34 | + fi |
35 | + output=$(hcitool dev | tail -n+2 | awk '{print $2}' | tee $CHECKBOX_DATA/bluetooth_address) |
36 | + echo "$output" |
37 | + if [ -z "$output" ]; then |
38 | + "BT hardware not available" |
39 | + exit 1 |
40 | + fi |
41 | _description: |
42 | Automated test to store bluetooth device information in checkbox report |
43 | |
44 | |
45 | === modified file 'jobs/suspend.txt.in' |
46 | --- jobs/suspend.txt.in 2013-01-07 17:06:27 +0000 |
47 | +++ jobs/suspend.txt.in 2013-01-14 10:51:21 +0000 |
48 | @@ -47,9 +47,18 @@ |
49 | then |
50 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
51 | exit 1 |
52 | - else |
53 | - obex_send $BTDEVADDR $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
54 | - fi |
55 | + fi |
56 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
57 | + then |
58 | + echo "rfkill shows BT is hard blocked" |
59 | + fi |
60 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
61 | + then |
62 | + echo "rfkill shows BT is soft blocked, removing before testing." |
63 | + rfkill unblock bluetooth |
64 | + sleep 3 |
65 | + fi |
66 | + obex_send $BTDEVADDR $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
67 | _description: |
68 | This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. |
69 | |
70 | @@ -59,14 +68,22 @@ |
71 | package.name == 'bluez' and package.name == 'obexftp' |
72 | device.category == 'BLUETOOTH' |
73 | command: |
74 | - set -o pipefail |
75 | if [ -z "$BTDEVADDR" ] |
76 | then |
77 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
78 | exit 1 |
79 | - else |
80 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser |
81 | - fi |
82 | + fi |
83 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
84 | + then |
85 | + echo "rfkill list shows BT is hard blocked" |
86 | + fi |
87 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
88 | + then |
89 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
90 | + rfkill unblock bluetooth |
91 | + sleep 3 |
92 | + fi |
93 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser |
94 | _description: |
95 | This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. |
96 | |
97 | @@ -76,14 +93,22 @@ |
98 | package.name == 'bluez' and package.name == 'obexftp' |
99 | device.category == 'BLUETOOTH' |
100 | command: |
101 | - set -o pipefail |
102 | if [ -z "$BTDEVADDR" ] |
103 | then |
104 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
105 | exit 1 |
106 | - else |
107 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser |
108 | - fi |
109 | + fi |
110 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
111 | + then |
112 | + echo "rfkill list shows BT is hard blocked" |
113 | + fi |
114 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
115 | + then |
116 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
117 | + rfkill unblock bluetooth |
118 | + sleep 3 |
119 | + fi |
120 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser |
121 | _description: |
122 | This is an automated Bluetooth test. It emulates browsing on a remote device specified by the BTDEVADDR environment variable. |
123 | |
124 | @@ -93,14 +118,22 @@ |
125 | package.name == 'bluez' and package.name == 'obexftp' |
126 | device.category == 'BLUETOOTH' |
127 | command: |
128 | - set -o pipefail |
129 | if [ -z "$BTDEVADDR" ] |
130 | then |
131 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
132 | exit 1 |
133 | - else |
134 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser |
135 | - fi |
136 | + fi |
137 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
138 | + then |
139 | + echo "rfkill list shows BT is hard blocked" |
140 | + fi |
141 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
142 | + then |
143 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
144 | + rfkill unblock bluetooth |
145 | + sleep 3 |
146 | + fi |
147 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser |
148 | _description: |
149 | This is an automated Bluetooth test. It receives the given file from a remote host specified by the BTDEVADDR environment variable |
150 | |
151 | @@ -109,13 +142,14 @@ |
152 | requires: |
153 | package.name == 'bluez' and package.name == 'obexd-client' |
154 | device.category == 'BLUETOOTH' |
155 | -command: obex_send `bluetooth_scan` $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
156 | +command: rfkill unblock bluetooth; obex_send `bluetooth_scan` $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
157 | _description: |
158 | PURPOSE: |
159 | This test will send the image 'JPEG_Color_Image_Ubuntu.jpg' to a specified device |
160 | STEPS: |
161 | - 1. Click "Test" and you will be prompted to enter the Bluetooth device name of a device that can accept file transfers (It may take a few moments after entering the name for the file to begin sending) |
162 | - 2. Accept any prompts that appear on both devices |
163 | + 1. Make sure Bluetooth is enabled by checking the Bluetooth indicator applet |
164 | + 2. Click "Test" and you will be prompted to enter the Bluetooth device name of a device that can accept file transfers (It may take a few moments after entering the name for the file to begin sending) |
165 | + 3. Accept any prompts that appear on both devices |
166 | VERIFICATION: |
167 | Was the data correctly transferred? |
168 | |
169 | @@ -465,7 +499,21 @@ |
170 | requires: |
171 | package.name == 'bluez' |
172 | device.category == 'BLUETOOTH' |
173 | -command: hcitool dev | tail -n+2 | awk '{print $2}' |diff $CHECKBOX_DATA/bluetooth_address - |
174 | +command: |
175 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes'; then |
176 | + echo "rfkill shows BT is hard blocked" |
177 | + fi |
178 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes'; then |
179 | + echo "rfkill shows BT is soft blocked, removing before testing" |
180 | + rfkill unblock bluetooth |
181 | + sleep 3 |
182 | + fi |
183 | + output=$(hcitool dev | tail -n+2 | awk '{print $2}') |
184 | + echo $output | diff $CHECKBOX_DATA/bluetooth_address - |
185 | + if [ -z "$output" ]; then |
186 | + echo "BT hardware not available" |
187 | + exit 1 |
188 | + fi |
189 | _description: |
190 | This test grabs the hardware address of the bluetooth adapter after suspend and compares it to the address grabbed before suspend. |
191 | |
192 | @@ -480,9 +528,18 @@ |
193 | then |
194 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
195 | exit 1 |
196 | - else |
197 | - obex_send $BTDEVADDR $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
198 | - fi |
199 | + fi |
200 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
201 | + then |
202 | + echo "rfkill shows BT is hard blocked" |
203 | + fi |
204 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
205 | + then |
206 | + echo "rfkill shows BT is soft blocked, removing before testing." |
207 | + rfkill unblock bluetooth |
208 | + sleep 3 |
209 | + fi |
210 | + obex_send $BTDEVADDR $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
211 | _description: |
212 | This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. |
213 | |
214 | @@ -497,9 +554,18 @@ |
215 | then |
216 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
217 | exit 1 |
218 | - else |
219 | - obex_send $BTDEVADDR $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
220 | - fi |
221 | + fi |
222 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
223 | + then |
224 | + echo "rfkill shows BT is hard blocked" |
225 | + fi |
226 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
227 | + then |
228 | + echo "rfkill shows BT is soft blocked, removing before testing." |
229 | + rfkill unblock bluetooth |
230 | + sleep 3 |
231 | + fi |
232 | + obex_send $BTDEVADDR $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
233 | _description: |
234 | This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. |
235 | |
236 | @@ -510,14 +576,22 @@ |
237 | package.name == 'bluez' and package.name == 'obexftp' |
238 | device.category == 'BLUETOOTH' |
239 | command: |
240 | - set -o pipefail |
241 | if [ -z "$BTDEVADDR" ] |
242 | then |
243 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
244 | exit 1 |
245 | - else |
246 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser |
247 | - fi |
248 | + fi |
249 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
250 | + then |
251 | + echo "rfkill list shows BT is hard blocked" |
252 | + fi |
253 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
254 | + then |
255 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
256 | + rfkill unblock bluetooth |
257 | + sleep 3 |
258 | + fi |
259 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser |
260 | _description: |
261 | This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. |
262 | |
263 | @@ -528,14 +602,22 @@ |
264 | package.name == 'bluez' and package.name == 'obexftp' |
265 | device.category == 'BLUETOOTH' |
266 | command: |
267 | - set -o pipefail |
268 | if [ -z "$BTDEVADDR" ] |
269 | then |
270 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
271 | exit 1 |
272 | - else |
273 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser |
274 | - fi |
275 | + fi |
276 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
277 | + then |
278 | + echo "rfkill list shows BT is hard blocked" |
279 | + fi |
280 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
281 | + then |
282 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
283 | + rfkill unblock bluetooth |
284 | + sleep 3 |
285 | + fi |
286 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR send 2>&1 | ansi_parser |
287 | _description: |
288 | This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable. |
289 | |
290 | @@ -546,14 +628,22 @@ |
291 | package.name == 'bluez' and package.name == 'obexftp' |
292 | device.category == 'BLUETOOTH' |
293 | command: |
294 | - set -o pipefail |
295 | if [ -z "$BTDEVADDR" ] |
296 | then |
297 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
298 | exit 1 |
299 | - else |
300 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser |
301 | - fi |
302 | + fi |
303 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
304 | + then |
305 | + echo "rfkill list shows BT is hard blocked" |
306 | + fi |
307 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
308 | + then |
309 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
310 | + rfkill unblock bluetooth |
311 | + sleep 3 |
312 | + fi |
313 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser |
314 | _description: |
315 | This is an automated Bluetooth test. It emulates browsing on a remote device specified by the BTDEVADDR environment variable. |
316 | |
317 | @@ -564,14 +654,22 @@ |
318 | package.name == 'bluez' and package.name == 'obexftp' |
319 | device.category == 'BLUETOOTH' |
320 | command: |
321 | - set -o pipefail |
322 | if [ -z "$BTDEVADDR" ] |
323 | then |
324 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
325 | exit 1 |
326 | - else |
327 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser |
328 | - fi |
329 | + fi |
330 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
331 | + then |
332 | + echo "rfkill list shows BT is hard blocked" |
333 | + fi |
334 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
335 | + then |
336 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
337 | + rfkill unblock bluetooth |
338 | + sleep 3 |
339 | + fi |
340 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR browse 2>&1 | ansi_parser |
341 | _description: |
342 | This is an automated Bluetooth test. It emulates browsing on a remote device specified by the BTDEVADDR environment variable. |
343 | |
344 | @@ -582,14 +680,22 @@ |
345 | package.name == 'bluez' and package.name == 'obexftp' |
346 | device.category == 'BLUETOOTH' |
347 | command: |
348 | - set -o pipefail |
349 | if [ -z "$BTDEVADDR" ] |
350 | then |
351 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
352 | exit 1 |
353 | - else |
354 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser |
355 | - fi |
356 | + fi |
357 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
358 | + then |
359 | + echo "rfkill list shows BT is hard blocked" |
360 | + fi |
361 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
362 | + then |
363 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
364 | + rfkill unblock bluetooth |
365 | + sleep 3 |
366 | + fi |
367 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser |
368 | _description: |
369 | This is an automated Bluetooth test. It receives the given file from a remote host specified by the BTDEVADDR environment variable |
370 | |
371 | @@ -600,14 +706,22 @@ |
372 | package.name == 'bluez' and package.name == 'obexftp' |
373 | device.category == 'BLUETOOTH' |
374 | command: |
375 | - set -o pipefail |
376 | if [ -z "$BTDEVADDR" ] |
377 | then |
378 | echo "btdevaddr option not set to device address of Bluetooth target in checkbox.ini" |
379 | exit 1 |
380 | - else |
381 | - bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser |
382 | - fi |
383 | + fi |
384 | + if rfkill list bluetooth | grep -q 'Hard blocked: yes' |
385 | + then |
386 | + echo "rfkill list shows BT is hard blocked" |
387 | + fi |
388 | + if rfkill list bluetooth | grep -q 'Soft blocked: yes' |
389 | + then |
390 | + echo "rfkill list shows BT is soft blocked, removing before testing" |
391 | + rfkill unblock bluetooth |
392 | + sleep 3 |
393 | + fi |
394 | + set -o pipefail; bluetooth_test $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg $BTDEVADDR get 2>&1 | ansi_parser |
395 | _description: |
396 | This is an automated Bluetooth test. It receives the given file from a remote host specified by the BTDEVADDR environment variable |
397 | |
398 | @@ -617,7 +731,7 @@ |
399 | requires: |
400 | package.name == 'bluez' and package.name == 'obexd-client' |
401 | device.category == 'BLUETOOTH' |
402 | -command: obex_send `bluetooth_scan` $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
403 | +command: rfkill unblock bluetooth; obex_send `bluetooth_scan` $CHECKBOX_SHARE/data/images/JPEG_Color_Image_Ubuntu.jpg |
404 | _description: |
405 | PURPOSE: |
406 | This test will send the image 'JPEG_Color_Image_Ubuntu.jpg' to a specified device |
10:24 < zyga> brendand: looking at your MP
10:24 < zyga> brendand: were you intending to fail the test if bluetooth is hard blocked?
10:25 < zyga> brendand: also, I have this feeling that the rate of repetition in that job warrants a small refactoring to a shell script
10:25 < brendand> zyga, hmm yeah, that's a fair point
10:26 < brendand> zyga, for the hard block, i'd rather just say it's hard block and then let it run and fail, which it probably will