Merge lp:~sergiusens/phablet-tools/emu_prov into lp:phablet-tools

Proposed by Sergio Schvezov
Status: Needs review
Proposed branch: lp:~sergiusens/phablet-tools/emu_prov
Merge into: lp:phablet-tools
Prerequisite: lp:~doanac/phablet-tools/autopilot-args
Diff against target: 80 lines (+27/-4)
3 files modified
click-buddy (+1/-0)
phablet-click-test-setup (+15/-2)
phablet-config (+11/-2)
To merge this branch: bzr merge lp:~sergiusens/phablet-tools/emu_prov
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Needs Fixing
PS Jenkins bot continuous-integration Approve
Andy Doan Pending
Ubuntu Phablet Team Pending
Review via email: mp+207440@code.launchpad.net

Commit message

Adding emulator (and future ap) provisioning; in the future this would only work if the tests are py3.

Description of the change

Tested from the branch like
PATH=$PWD:$PATH click-buddy --dir ~/source/apps/clock/trunk --provision
PATH=$PWD:$PATH phablet-test-run -o $(mktemp -d) -f xml ubuntu_clock_app

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Works fine, but I would like to see a one option added to click-buddy:

1) Support to skip the phablet-config autopilot --setup step; in the case where we already have pulled things, we don't need to do it again. Heck, I'm not even sure the step should be on by default. The first time you run tests from your project it's needed, but after you don't need it. I suppose having it default means it will do the right thing for new folks, but I'd like to be able to skip it at least.. Just makes me want to adb push even more if it takes too long . . .

In addition;

2) Potentially provision and push tests only; don't push the click package. I might want to test using the pre-installed click, but with my newer tests. This is really a corner case, and not important or critical. I wouldn't hold up this merge for it :-)

review: Needs Fixing

Unmerged revisions

244. By Sergio Schvezov

Adding emulator (and future ap) provisioning; in the future this would only work if the tests ar py3.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'click-buddy'
--- click-buddy 2014-01-20 18:31:52 +0000
+++ click-buddy 2014-02-20 13:39:04 +0000
@@ -123,6 +123,7 @@
123 done123 done
124124
125 adb $ADBOPTS shell mkdir -p /home/$DEVICE_USER/autopilot125 adb $ADBOPTS shell mkdir -p /home/$DEVICE_USER/autopilot
126 phablet-config autopilot --setup
126 adb $ADBOPTS push $SOURCE/tests/autopilot /home/$DEVICE_USER/autopilot127 adb $ADBOPTS push $SOURCE/tests/autopilot /home/$DEVICE_USER/autopilot
127 adb $ADBOPTS shell chown -R "$DEVICE_USER":"$DEVICE_USER" /home/$DEVICE_USER/autopilot128 adb $ADBOPTS shell chown -R "$DEVICE_USER":"$DEVICE_USER" /home/$DEVICE_USER/autopilot
128 set +e129 set +e
129130
=== modified file 'phablet-click-test-setup'
--- phablet-click-test-setup 2014-02-20 13:39:04 +0000
+++ phablet-click-test-setup 2014-02-20 13:39:04 +0000
@@ -101,6 +101,13 @@
101 help='User on device to use')101 help='User on device to use')
102 parser.add_argument('--wipe', action='store_true',102 parser.add_argument('--wipe', action='store_true',
103 help='Clean up previous setup on device')103 help='Clean up previous setup on device')
104 base = parser.add_mutually_exclusive_group()
105 base.add_argument('--skip-base', action='store_true',
106 help='''Skips the base setup such as installation of
107 emulators and autopilot.''')
108 base.add_argument('--only-base', action='store_true',
109 help='''Only sets up the base for testing such as the
110 emulators and autopilot.''')
104 return parser.parse_args()111 return parser.parse_args()
105112
106113
@@ -223,8 +230,14 @@
223 test_dir = tempfile.mkdtemp()230 test_dir = tempfile.mkdtemp()
224 os.mkdir(os.path.join(test_dir, py2_subdir))231 os.mkdir(os.path.join(test_dir, py2_subdir))
225 atexit.register(cleanup, test_dir)232 atexit.register(cleanup, test_dir)
226 fetch_test_base(adb, test_dir)233 if args.wipe and args.skip_base:
227 fetch_click_tests(adb, test_dir, args.user, args.click)234 print('Ignoring request to skip base provisioning as wipe was also '
235 'requested')
236 args.skip_base = False
237 if not args.skip_base:
238 fetch_test_base(adb, test_dir)
239 if not args.only_base:
240 fetch_click_tests(adb, test_dir, args.user, args.click)
228 destination = path.join('/home', args.user, 'autopilot')241 destination = path.join('/home', args.user, 'autopilot')
229 if args.wipe:242 if args.wipe:
230 print('Clearing previous test setup in %s' % destination)243 print('Clearing previous test setup in %s' % destination)
231244
=== modified file 'phablet-config'
--- phablet-config 2013-12-12 23:45:16 +0000
+++ phablet-config 2014-02-20 13:39:04 +0000
@@ -104,8 +104,15 @@
104 if args.dbus_probe == 'enable':104 if args.dbus_probe == 'enable':
105 rfile = '/usr/share/autopilot-touch/apparmor/click.rules'105 rfile = '/usr/share/autopilot-touch/apparmor/click.rules'
106 adb.shell('aa-clickhook -f --include=%s' % rfile)106 adb.shell('aa-clickhook -f --include=%s' % rfile)
107 else:107 elif args.dbus_probe == 'disable':
108 adb.shell('aa-clickhook -f')108 adb.shell('aa-clickhook -f')
109 elif args.setup:
110 # TODO replace with better implementation, phablet-click-test-setup
111 # scheduled to depart
112 subprocess.check_call(['phablet-click-test-setup', '--only-base'])
113 else:
114 print('Use --help for additional information')
115 exit(1)
109116
110117
111def _handle_writable_image(adb, args):118def _handle_writable_image(adb, args):
@@ -213,9 +220,11 @@
213220
214 ap = sub.add_parser('autopilot', help='Configure autopilot for device.')221 ap = sub.add_parser('autopilot', help='Configure autopilot for device.')
215 ap.add_argument('--dbus-probe', choices=('enable', 'disable'),222 ap.add_argument('--dbus-probe', choices=('enable', 'disable'),
216 required=True,223 default='None',
217 help='''Allows autopilot the ability to introspect DBUS224 help='''Allows autopilot the ability to introspect DBUS
218 objects so that tests will work.''')225 objects so that tests will work.''')
226 ap.add_argument('--setup', action='store_true',
227 help='''Sets up autopilot (not yet) and it's emulators''')
219 ap.set_defaults(func=_handle_autopilot)228 ap.set_defaults(func=_handle_autopilot)
220 dm = sub.add_parser('writable-image', help='''Enable read/write access to229 dm = sub.add_parser('writable-image', help='''Enable read/write access to
221 device partitions and optionally install extra230 device partitions and optionally install extra

Subscribers

People subscribed via source and target branches