Merge lp:~sbaldassin/autopilot/fix_mir into lp:autopilot

Proposed by Santiago Baldassin
Status: Merged
Approved by: Heber Parrucci
Approved revision: 589
Merged at revision: 589
Proposed branch: lp:~sbaldassin/autopilot/fix_mir
Merge into: lp:autopilot
Diff against target: 41 lines (+17/-7)
1 file modified
autopilot/display/_upa.py (+17/-7)
To merge this branch: bzr merge lp:~sbaldassin/autopilot/fix_mir
Reviewer Review Type Date Requested Status
Heber Parrucci (community) Approve
platform-qa-bot continuous-integration Approve
Omer Akram (community) Needs Fixing
Review via email: mp+313729@code.launchpad.net

Commit message

Adding default resolutions to create the upa display

Description of the change

Adding the default resolutions back so that people can still run tests through shh using autopilot

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :

Please check my inline comment on how this approach is flawed.

review: Needs Fixing
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Reply inline

lp:~sbaldassin/autopilot/fix_mir updated
587. By Santiago Baldassin

Adding default resolutions for M10 and desktop and removing non supported devices

588. By Santiago Baldassin

fixing flake8 errors

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Heber Parrucci (heber013) wrote :

see comment

review: Needs Fixing
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Comment addressed

lp:~sbaldassin/autopilot/fix_mir updated
589. By Santiago Baldassin

minor fix

Revision history for this message
Heber Parrucci (heber013) wrote :

Code LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/display/_upa.py'
2--- autopilot/display/_upa.py 2016-11-07 10:14:17 +0000
3+++ autopilot/display/_upa.py 2017-02-20 20:39:26 +0000
4@@ -21,7 +21,7 @@
5 import subprocess
6
7 from autopilot.display import Display as DisplayBase
8-from autopilot.platform import get_display_server
9+from autopilot.platform import get_display_server, image_codename
10
11 DISPLAY_SERVER_X11 = 'X11'
12 DISPLAY_SERVER_MIR = 'MIR'
13@@ -35,12 +35,22 @@
14 elif display_server == DISPLAY_SERVER_MIR:
15 return _get_resolution_from_mirout()
16 else:
17- raise RuntimeError(
18- 'Unknown display server. Only {} and {} are supported.'.format(
19- DISPLAY_SERVER_MIR,
20- DISPLAY_SERVER_X11
21- )
22- )
23+ return _get_hardcoded_resolution()
24+
25+
26+def _get_hardcoded_resolution():
27+ name = image_codename()
28+
29+ resolutions = {
30+ "Aquaris_M10_HD": (800, 1280),
31+ "Desktop": (1920, 1080)
32+ }
33+
34+ if name not in resolutions:
35+ raise NotImplementedError(
36+ 'Device "{}" is not supported by Autopilot.'.format(name))
37+
38+ return resolutions[name]
39
40
41 def _get_stdout_for_command(command, *args):

Subscribers

People subscribed via source and target branches