Merge lp:~liuyq0307/lava-android-test/modify4mmtest into lp:lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 133
Proposed branch: lp:~liuyq0307/lava-android-test/modify4mmtest
Merge into: lp:lava-android-test
Diff against target: 38 lines (+10/-5)
1 file modified
lava_android_test/test_definitions/mmtest.py (+10/-5)
To merge this branch: bzr merge lp:~liuyq0307/lava-android-test/modify4mmtest
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+90682@code.launchpad.net

Description of the change

did two things
1. modify the level of wget so that we can get the sub directory
2. modify the location that to put media files, so that the apk and see the files

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

5 -# Copyright (c) 2011 Linaro
6 -
7 +# Copyright (C) 2012 Linaro Limited
8 +#

You should append the date, don't remove older year numbers (so 2011-2012 or 2011, 2012)

23 -RUN_STEPS_HOST_PRE = ['wget -r -np -l 2 -R csv,txt,css,html,gif %s -P %s' % (site, local_name),
24 +RUN_STEPS_HOST_PRE = ['wget -r -np -l 10 -R csv,txt,css,html,gif,pdf %s -P %s' % (site, local_name),

While not critical using the long option names and would make this part much easier to understand. Also, by
keeping the formatting per-argument you avoid white-space bugs and keep formatting operator closer to where it is used. I did not check if this is possible in our current dispatcher interface but still this makes it readable.

[ 'wget', '--recursive', '--no-parent', '--level=20', '--reject csv,txt,css,html,gif,pdf', '--directory-prefix=%s' % local_name, site]

Still, a +1

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

> 5 -# Copyright (c) 2011 Linaro
> 6 -
> 7 +# Copyright (C) 2012 Linaro Limited
> 8 +#
>
> You should append the date, don't remove older year numbers (so 2011-2012 or
> 2011, 2012)

Thanks!
>
> 23 -RUN_STEPS_HOST_PRE = ['wget -r -np -l 2 -R csv,txt,css,html,gif %s -P
> %s' % (site, local_name),
> 24 +RUN_STEPS_HOST_PRE = ['wget -r -np -l 10 -R csv,txt,css,html,gif,pdf
> %s -P %s' % (site, local_name),
>
> While not critical using the long option names and would make this part much
> easier to understand. Also, by
> keeping the formatting per-argument you avoid white-space bugs and keep
> formatting operator closer to where it is used. I did not check if this is
> possible in our current dispatcher interface but still this makes it readable.
>
> [ 'wget', '--recursive', '--no-parent', '--level=20', '--reject
> csv,txt,css,html,gif,pdf', '--directory-prefix=%s' % local_name, site]

with the string format, we can do some substitutions in the command simply.
like such command:
   RUN_STEPS_HOST_PRE = ['/bin/bash %s $(SERIAL)' % test_sh_path]
we can replace the $(SERIAL) with the real device serial number easily.

but, yes, this format will cause white-space bugs easier.
we need to pay attention to this point.:(

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_android_test/test_definitions/mmtest.py'
2--- lava_android_test/test_definitions/mmtest.py 2011-12-30 09:22:23 +0000
3+++ lava_android_test/test_definitions/mmtest.py 2012-01-30 12:20:43 +0000
4@@ -1,5 +1,5 @@
5-# Copyright (c) 2011 Linaro
6-
7+# Copyright (C) 2012 Linaro Limited
8+#
9 # Author: Linaro Validation Team <linaro-dev@lists.linaro.org>
10 #
11 # This file is part of LAVA Android Test.
12@@ -21,19 +21,24 @@
13 import re
14 import lava_android_test.testdef
15 from lava_android_test.utils import get_local_name
16+from lava_android_test.config import get_config
17
18 test_name = 'mmtest'
19+config = get_config()
20
21 site = 'http://samplemedia.linaro.org/'
22 local_name = get_local_name(site)
23-RUN_STEPS_HOST_PRE = ['wget -r -np -l 2 -R csv,txt,css,html,gif %s -P %s' % (site, local_name),
24+RUN_STEPS_HOST_PRE = ['wget -r -np -l 10 -R csv,txt,css,html,gif,pdf %s -P %s' % (site, local_name),
25 r'find %s -type f -name "index*" -exec rm -f \{\} \;' % local_name,
26 r'find %s -type f -name "README" -exec rm -f \{\} \;' % local_name]
27-test_files_target_path = os.path.join('/sdcard', local_name)
28+
29+test_files_target_path = os.path.join(config.installdir_android,
30+ test_name, local_name)
31 RUN_STEPS_ADB_PRE = ['push %s %s' % (local_name, test_files_target_path)]
32 RUN_ADB_SHELL_STEPS = ['am instrument -r -e targetDir %s \
33 -w com.android.mediaframeworktest/.MediaFrameworkTestRunner'
34- % test_files_target_path]
35+ % test_files_target_path,
36+ 'rm -r %s' % (test_files_target_path) ]
37
38 class MMTestTestParser(lava_android_test.testdef.AndroidTestParser):
39

Subscribers

People subscribed via source and target branches