Merge lp://qastaging/~liuyq0307/lava-android-test/command-file into lp://qastaging/lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 143
Proposed branch: lp://qastaging/~liuyq0307/lava-android-test/command-file
Merge into: lp://qastaging/lava-android-test
Diff against target: 240 lines (+91/-19)
2 files modified
lava_android_test/commands.py (+54/-16)
lava_android_test/testdef.py (+37/-3)
To merge this branch: bzr merge lp://qastaging/~liuyq0307/lava-android-test/command-file
Reviewer Review Type Date Requested Status
Yongqin Liu Approve
Review via email: mp+98091@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2012-03-16.

Description of the change

1. Add support to push a specified android command file to android and run it on android.
2. Add some process for deal with the test result
3. Modify to use add_mutually_exclusive_group according review comment
4. Change result patterns to Parser member, so that we can change them out of the class
5. Modify to use the require option for add_mutually_exclusive_group method

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote : Posted in a previous version of this proposal

32 + if self.args.android_command and self.args.command_file:
33 + raise LavaCommandError("Please specified one option of -c and -f")
34 + if not self.args.android_command and not self.args.command_file:
35 + raise LavaCommandError("Please specified one option of -c and -f")

You should use mutex group instead:

group = parser.add_mutually_exclusive_group()
group.add_argument('-f', ...)
group.add_argument('-c', ...)

Then argparse will this check for you.

53 + STEPS_HOST_PRE = ["wget %s -O %s" % (file_url, file_name)]

I'd like us to use python on the host if possible. Downloading stuff with wget eventually means we have no error handling. This can stay as-is but we should look at the problem of how we download anything throughout lava and fix it.

Revision history for this message
Zygmunt Krynicki (zyga) wrote : Posted in a previous version of this proposal

+ if self.args.android_command and self.args.command_file:
39 + raise LavaCommandError("Please specified one option of -c and -f")
40 + if not self.args.android_command and not self.args.command_file:
41 + raise LavaCommandError("Please specified one option of -c and -f")

This won't be need if you indicate that both -c and -f are required

add_argument( ..., required=True)

Otherwise looks okay

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

after test

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches