Merge lp:~pwlars/utah/utah-phablet-noroot into lp:utah

Proposed by Paul Larson
Status: Merged
Merged at revision: 1059
Proposed branch: lp:~pwlars/utah/utah-phablet-noroot
Merge into: lp:utah
Diff against target: 49 lines (+11/-2)
3 files modified
client.py (+3/-1)
debian/changelog (+7/-0)
examples/run_utah_phablet.py (+1/-1)
To merge this branch: bzr merge lp:~pwlars/utah/utah-phablet-noroot
Reviewer Review Type Date Requested Status
Para Siva (community) Approve
Review via email: mp+235722@code.launchpad.net

Commit message

Add an option for bypassing the check for root permissions to be used for running host-side phablet tests

Description of the change

The phablet runner for utah actually doesn't need root, since we're running everything host-side. Add an option to utah so that we can bypass the check for root permissions in cases like this, and have run_utah_phablet use that option

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

+1, thanks for clarifying this too Paul

review: Approve
lp:~pwlars/utah/utah-phablet-noroot updated
1059. By Paul Larson

0.15+20140924-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client.py'
2--- client.py 2014-02-26 17:54:17 +0000
3+++ client.py 2014-09-24 20:17:42 +0000
4@@ -83,6 +83,8 @@
5 help='Choose which battery implementation to use.')
6 parser.add_argument('-p', '--probe-dir', default='/tmp',
7 help='Directory to store probe files.')
8+ parser.add_argument('--no-root', action='store_true',
9+ help='Do not require root permissions')
10
11 return parser
12
13@@ -119,7 +121,7 @@
14 except SystemExit:
15 sys.exit(ReturnCodes.CMD_PARSING_ERROR)
16
17- if not os.getuid() == 0:
18+ if not args.no_root and not os.getuid() == 0:
19 parser.print_usage()
20 msg = ('{}: UTAH client is expected to be executed as root user\n'
21 .format(parser.prog))
22
23=== modified file 'debian/changelog'
24--- debian/changelog 2014-09-11 15:14:15 +0000
25+++ debian/changelog 2014-09-24 20:17:42 +0000
26@@ -1,3 +1,10 @@
27+utah (0.15+20140924-0ubuntu1) utopic; urgency=medium
28+
29+ * Add an option to bypass checking for root permission, because
30+sometimes we don't need it
31+
32+ -- Paul Larson <paul.larson@canonical.com> Wed, 24 Sep 2014 15:15:35 -0500
33+
34 utah (0.15+20140911-0ubuntu1) utopic; urgency=medium
35
36 * Adjust the sleep time before VM shutdown
37
38=== modified file 'examples/run_utah_phablet.py'
39--- examples/run_utah_phablet.py 2014-08-21 20:23:01 +0000
40+++ examples/run_utah_phablet.py 2014-09-24 20:17:42 +0000
41@@ -272,7 +272,7 @@
42
43 host = os.path.join(args.results_dir, 'utah-host.yml')
44 tmpdir = tempfile.mkdtemp()
45- cmd = '{} -d -o {} -r {} -p {} -t {}'.format(
46+ cmd = '{} -d -o {} -r {} -p {} -t {} --no-root'.format(
47 args.utah_cmd, host, args.runlist, args.results_dir, tmpdir)
48 rc = subprocess.call(cmd, env=env, shell=True)
49 print('utah runlist exited with rc={}'.format(rc))

Subscribers

People subscribed via source and target branches