Merge lp:~liuyq0307/lava-dispatcher/problems-deploy-android into lp:lava-dispatcher

Proposed by Yongqin Liu
Status: Work in progress
Proposed branch: lp:~liuyq0307/lava-dispatcher/problems-deploy-android
Merge into: lp:lava-dispatcher
Diff against target: 84 lines (+19/-4)
3 files modified
lava_dispatcher/client/targetdevice.py (+6/-0)
lava_dispatcher/config.py (+1/-0)
lava_dispatcher/device/master.py (+12/-4)
To merge this branch: bzr merge lp:~liuyq0307/lava-dispatcher/problems-deploy-android
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+129135@code.launchpad.net

Description of the change

Fix some problems for deploying android image
1. update the source that modify vold.fstab for mounting sdcard
2. the typo for calling hard_reboot method
3. problem when run boot_linaro_android_image without the boot_linaro_android_image action
4. add the rc= to the PS1 of the master image(when the master image is rebooted by pressing the power button or rebooted by hardreset, there will be no rc= in the the PS1 prompt)

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

1) I don't understand that part. It almost looks like its making a change that won't work with old Android builds? Does "/storage/sdcard0" need to become a config value or something?

2) +1

3) Can you explain how you make this happen. The only way I see this being possible is if your job file doesn't include a deploy action? If this is to make unit testing easier, just set target.deployment_data in your python shell or test script

4) Good catch. But why not just always set this rather than waiting for the prompt and timing out. I'd also drop the
 self.proc.sendline('echo "check rc in PS1"')
You'll see that in the job file anyway.

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

> 1) I don't understand that part. It almost looks like its making a change that
> won't work with old Android builds? Does "/storage/sdcard0" need to become a
> config value or something?
Good Idea
> 2) +1
>
> 3) Can you explain how you make this happen. The only way I see this being
> possible is if your job file doesn't include a deploy action? If this is to
> make unit testing easier, just set target.deployment_data in your python shell
> or test script
Usually, I use the following job to boot to the deployed android and do the following test,
this will same me the time to deploy the android:
$ cat /var/www/images/workspace/jobs/reboot.json
{
  "job_name": "reboot",
  "image_type": "android",
  "target": "panda01",
  "timeout": 18000,
  "actions": [
    {
      "command": "boot_linaro_android_image"
    }
  ]
}
$
> 4) Good catch. But why not just always set this rather than waiting for the
> prompt and timing out. I'd also drop the
> self.proc.sendline('echo "check rc in PS1"')
> You'll see that in the job file anyway.
If we don't check, we may get the PS1 like "$PS1 $PS1 [rc=$(echo \$?)]: $PS1 [rc=$(echo \$?)]:".

And about the check, we can use sendline(""), but I'd like to make it more explicitly.

400. By Yongqin Liu

use config for the sdcard mount point path

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Yongqin Liu <email address hidden> writes:

>> 3) Can you explain how you make this happen. The only way I see this being
>> possible is if your job file doesn't include a deploy action? If this is to
>> make unit testing easier, just set target.deployment_data in your python shell
>> or test script
> Usually, I use the following job to boot to the deployed android and do the following test,
> this will same me the time to deploy the android:
> $ cat /var/www/images/workspace/jobs/reboot.json
> {
> "job_name": "reboot",
> "image_type": "android",
> "target": "panda01",
> "timeout": 18000,
> "actions": [
> {
> "command": "boot_linaro_android_image"
> }
> ]
> }

I think we'll need to change this a bit -- maybe create actions like
"assume_android_deployed" and "assume_ubuntu_deployed" that set the
deployment_data appropriately but do not do anything else?

> $
>> 4) Good catch. But why not just always set this rather than waiting for the
>> prompt and timing out. I'd also drop the
>> self.proc.sendline('echo "check rc in PS1"')
>> You'll see that in the job file anyway.
> If we don't check, we may get the PS1 like "$PS1 $PS1 [rc=$(echo
> \$?)]: $PS1 [rc=$(echo \$?)]:".
> And about the check, we can use sendline(""), but I'd like to make it more explicitly.

I'm completely changing how prompts are handled in my prompt-sanity
branch. I hope this part of your branch is no longer needed.

Cheers,
mwh

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

Unmerged revisions

400. By Yongqin Liu

use config for the sdcard mount point path

399. By Yongqin Liu

fix some problems when delopy android image

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/client/targetdevice.py'
2--- lava_dispatcher/client/targetdevice.py 2012-09-30 17:01:36 +0000
3+++ lava_dispatcher/client/targetdevice.py 2012-10-12 02:55:21 +0000
4@@ -30,6 +30,7 @@
5 )
6 from lava_dispatcher.device.target import (
7 get_target,
8+ Target,
9 )
10 from lava_dispatcher.utils import (
11 logging_system,
12@@ -65,6 +66,9 @@
13 self.target_device.deploy_linaro_prebuilt(image)
14
15 def _boot_linaro_image(self):
16+ # because this method may be called from _boot_linaro_android_image
17+ if not self.target_device.deployment_data:
18+ self.target_device.deployment_data = Target.ubuntu_deployment_data
19 self.proc = self.target_device.power_on()
20
21 def _boot_linaro_android_image(self):
22@@ -75,6 +79,8 @@
23 logging.info("waiting for TIME_WAIT 5555 socket to finish")
24 time.sleep(3)
25
26+ self.target_device.deployment_data = Target.android_deployment_data
27+
28 self._boot_linaro_image()
29
30 def reliable_session(self):
31
32=== modified file 'lava_dispatcher/config.py'
33--- lava_dispatcher/config.py 2012-10-02 20:54:32 +0000
34+++ lava_dispatcher/config.py 2012-10-12 02:55:21 +0000
35@@ -65,6 +65,7 @@
36 tester_hostname = schema.StringOption(default="linaro")
37 tester_str = schema.StringOption()
38 val = schema.StringOption()
39+ sdcard_mountpoint_path = schema.StringOption(default="/storage/sdcard0")
40
41 simulator_binary = schema.StringOption()
42 license_server = schema.StringOption()
43
44=== modified file 'lava_dispatcher/device/master.py'
45--- lava_dispatcher/device/master.py 2012-10-09 02:05:17 +0000
46+++ lava_dispatcher/device/master.py 2012-10-12 02:55:21 +0000
47@@ -373,6 +373,12 @@
48 """
49 try:
50 self._in_master_shell()
51+ self.proc.sendline('echo "check rc in PS1"')
52+ match_id = self.proc.expect(["\[rc=", pexpect.TIMEOUT],
53+ timeout=3, lava_no_logging=1)
54+ if match_id != 0:
55+ self.proc.sendline('export PS1="$PS1 [rc=$(echo \$?)]: "')
56+
57 yield MasterCommandRunner(self)
58 except OperationFailed:
59 self.boot_master_image()
60@@ -427,7 +433,7 @@
61 self._enter_uboot()
62 except:
63 logging.exception("_enter_uboot failed")
64- self.hard_reboot()
65+ self._hard_reboot()
66 self._enter_uboot()
67 self.proc.sendline(boot_cmds[0])
68 for line in range(1, len(boot_cmds)):
69@@ -610,10 +616,12 @@
70 # If there is no userdata partition on the sdcard(like iMX and Origen),
71 # then the sdcard partition will be used as the userdata partition as
72 # before, and so cannot be used here as the sdcard on android
73- original = 'dev_mount sdcard /mnt/sdcard %s ' % (
74+ original = 'dev_mount sdcard %s %s ' % (
75+ target.config.sdcard_mountpoint_path,
76 target.config.sdcard_part_android_org)
77- replacement = 'dev_mount sdcard /mnt/sdcard %s ' % (
78- target.sdcard_part_lava)
79+ replacement = 'dev_mount sdcard %s %s ' % (
80+ target.config.sdcard_mountpoint_path,
81+ target.config.sdcard_part_android)
82 sed_cmd = "s@{original}@{replacement}@".format(original=original,
83 replacement=replacement)
84 session.run(

Subscribers

People subscribed via source and target branches