Merge lp:~liuyq0307/lava-dispatcher/fix-1195536 into lp:lava-dispatcher

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 633
Proposed branch: lp:~liuyq0307/lava-dispatcher/fix-1195536
Merge into: lp:lava-dispatcher
Diff against target: 185 lines (+53/-38)
5 files modified
lava_dispatcher/config.py (+2/-2)
lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf (+13/-7)
lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf (+12/-6)
lava_dispatcher/device/fastmodel.py (+22/-19)
lava_dispatcher/device/target.py (+4/-4)
To merge this branch: bzr merge lp:~liuyq0307/lava-dispatcher/fix-1195536
Reviewer Review Type Date Requested Status
Tyler Baker Approve
Review via email: mp+171954@code.launchpad.net

Description of the change

1. fix the bug in _find_and_copy function,
     we should use the root to genertate the src path
2. rename the file variable to file_name,
     since file is a keyword of python

To post a comment you must log in.
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

One thing I am not sure is that if I should change the usage of _copy_needed_files_from_partition method in deploy_android method of lava_dispatcher/device/fastmodel.py file.

it is called as such in the deploy_linaro method:
self._copy_needed_files_from_directory(odir)
self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm')
self._copy_needed_files_from_partition(self.config.root_part, 'boot')

but called like this in the deploy_android method:
self._copy_needed_files_from_partition(self.config.boot_part, '')

if we add following line to the deploy_android method, I guess it will work too.
self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm')

but do we really need to specify the second parameter?

Revision history for this message
Tyler Baker (tyler-baker) wrote :

Thanks for fixing these issue I introduced :)

However the issue still persists:

http://www.nwdrone.com/scheduler/job/1331

review: Approve
633. By Yongqin Liu

remove the directory of axf file path specified for simulator_axf_files
based on the thought like this:
we do not have much files in the boot partition,
and there will be no files with the same base name under different directory

634. By Yongqin Liu

change for copy necessary uImage and uInitrd files

635. By Yongqin Liu

fix the error about parameter of _copy_first_find_from_list

636. By Yongqin Liu

fix some other bugs

Revision history for this message
Tyler Baker (tyler-baker) wrote :

Still in the process of testing these changes again.

One small issue I've encountered:

- simulator_kernel = schema.StringOption(default=None)
- simulator_initrd = schema.StringOption(default=None)
+ simulator_kernel_files = schema.ListOption(default=None)
+ simulator_initrd_files = schema.ListOption(default=None)

review: Needs Fixing
Revision history for this message
Tyler Baker (tyler-baker) wrote :

With the changes mentioned above, I confirmed this fix is now working properly.

Revision history for this message
Tyler Baker (tyler-baker) wrote :

We should also update the device-types for the following:

rtsm_foundation-armv8

rtsm_ve-armv8

637. By Yongqin Liu

fix the bug of definition of simulator_kernel_files and simulator_initrd_files

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

Hi, Tyler

I updated the definition of simulator_initrd_files and simulator_kernel_files according to your comments.
Please check that.

> We should also update the device-types for the following:
>
> rtsm_foundation-armv8
>
> rtsm_ve-armv8
For the above comments, sorry, I am not very clear about what to do.
Why should we update these two device types.

They don't need to specify the simulator_initrd_files and simulator_kernel_files now.

638. By Yongqin Liu

fix bug of use of simulator_kernel and simulator_initrd

Revision history for this message
Tyler Baker (tyler-baker) wrote :

> Hi, Tyler
>
> I updated the definition of simulator_initrd_files and simulator_kernel_files
> according to your comments.
> Please check that.
>
> > We should also update the device-types for the following:
> >
> > rtsm_foundation-armv8
> >
> > rtsm_ve-armv8
> For the above comments, sorry, I am not very clear about what to do.
> Why should we update these two device types.
>
> They don't need to specify the simulator_initrd_files and
> simulator_kernel_files now.

At this point they do not. However in the future they will need to ;) We can do this work now or later, I just thought it might be nice to have them updated now.

Revision history for this message
Tyler Baker (tyler-baker) :
review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

File is not a keyword in python.

It is okay to use, it might be confusing sometimes though

Thanks
ZK
2 lip 2013 17:08, "Tyler Baker" <email address hidden> napisał(a):

> Review: Approve
>
>
> --
>
> https://code.launchpad.net/~liuyq0307/lava-dispatcher/fix-1195536/+merge/171954
> You are subscribed to branch lp:lava-dispatcher.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lava_dispatcher/config.py'
--- lava_dispatcher/config.py 2013-06-20 15:37:54 +0000
+++ lava_dispatcher/config.py 2013-07-01 10:49:37 +0000
@@ -85,8 +85,8 @@
85 simulator_version_command = schema.StringOption()85 simulator_version_command = schema.StringOption()
86 simulator_command = schema.StringOption()86 simulator_command = schema.StringOption()
87 simulator_axf_files = schema.ListOption()87 simulator_axf_files = schema.ListOption()
88 simulator_kernel = schema.StringOption(default=None)88 simulator_kernel_files = schema.ListOption(default=None)
89 simulator_initrd = schema.StringOption(default=None)89 simulator_initrd_files = schema.ListOption(default=None)
90 simulator_dtb = schema.StringOption(default=None)90 simulator_dtb = schema.StringOption(default=None)
91 simulator_uefi = schema.StringOption(default=None)91 simulator_uefi = schema.StringOption(default=None)
92 simulator_boot_wrapper = schema.StringOption(default=None)92 simulator_boot_wrapper = schema.StringOption(default=None)
9393
=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf 2013-06-19 16:22:43 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf 2013-07-01 10:49:37 +0000
@@ -45,17 +45,23 @@
45 sendline 245 sendline 2
4646
47simulator_axf_files =47simulator_axf_files =
48 img.axf48 img.axf
49 linux-system-ISW.axf49 linux-system-ISW.axf
50 rtsm/linux-system-semi.axf50 linux-system-semi.axf
5151
52simulator_kernel = vmlinuz.*52simulator_kernel_files =
53simulator_initrd = initrd.*53 uImage
54 vmlinuz.*
55
56simulator_initrd_files =
57 uInitrd
58 initrd.*
59
54simulator_dtb = rtsm_ve-ca15x1-ca7x1.dtb60simulator_dtb = rtsm_ve-ca15x1-ca7x1.dtb
55simulator_uefi = uefi_rtsm_ve-ca15.bin61simulator_uefi = uefi_rtsm_ve-ca15.bin
5662
57license_file = 8224@localhost63license_file = 8224@localhost
58sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x464sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x1-A7x1/RTSM_VE_Cortex-A15x1-A7x1
59android_adb_port = 655565android_adb_port = 6555
6066
61simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//'67simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//'
6268
=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf 2013-06-19 16:22:43 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf 2013-07-01 10:49:37 +0000
@@ -45,12 +45,18 @@
45 sendline 245 sendline 2
4646
47simulator_axf_files =47simulator_axf_files =
48 img.axf48 img.axf
49 linux-system-ISW.axf49 linux-system-ISW.axf
50 rtsm/linux-system-semi.axf50 linux-system-semi.axf
5151
52simulator_kernel = vmlinuz.*52simulator_kernel_files =
53simulator_initrd = initrd.*53 uImage
54 vmlinuz.*
55
56simulator_initrd_files =
57 uInitrd
58 initrd.*
59
54simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb60simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb
55simulator_uefi = uefi_rtsm_ve-ca15.bin61simulator_uefi = uefi_rtsm_ve-ca15.bin
5662
5763
=== modified file 'lava_dispatcher/device/fastmodel.py'
--- lava_dispatcher/device/fastmodel.py 2013-06-25 10:50:02 +0000
+++ lava_dispatcher/device/fastmodel.py 2013-07-01 10:49:37 +0000
@@ -23,10 +23,8 @@
23import cStringIO23import cStringIO
24import logging24import logging
25import os25import os
26import shutil
27import stat26import stat
28import subprocess27import subprocess
29import re
3028
31import lava_dispatcher.device.boot_options as boot_options29import lava_dispatcher.device.boot_options as boot_options
3230
@@ -48,7 +46,6 @@
48 ensure_directory,46 ensure_directory,
49 extract_targz,47 extract_targz,
50 DrainConsoleOutput,48 DrainConsoleOutput,
51 string_to_list,
52 )49 )
5350
5451
@@ -93,24 +90,30 @@
93 subdir = os.path.join(mntdir, subdir)90 subdir = os.path.join(mntdir, subdir)
94 self._copy_needed_files_from_directory(subdir)91 self._copy_needed_files_from_directory(subdir)
9592
93 def _copy_first_find_from_list(self, subdir, odir, file_list):
94 f_path = None
95 for fname in file_list:
96 f_path = self._find_and_copy(subdir, odir, fname)
97 if f_path:
98 break
99
100 return f_path
101
96 def _copy_needed_files_from_directory(self, subdir):102 def _copy_needed_files_from_directory(self, subdir):
97 odir = os.path.dirname(self._sd_image)103 odir = os.path.dirname(self._sd_image)
98 if self._bootloader == 'u_boot':104 if self._bootloader == 'u_boot':
99 # Extract the bootwrapper from the image105 # Extract the bootwrapper from the image
100 for fname in self.config.simulator_axf_files:106 if self.config.simulator_axf_files and self._axf is None:
101 if self._axf is None:107 self._axf = self._copy_first_find_from_list(subdir, odir,
102 self._axf = self._find_and_copy(108 self.config.simulator_axf_files)
103 subdir, odir, fname)
104 else:
105 break
106 # Extract the kernel from the image109 # Extract the kernel from the image
107 if self.config.simulator_kernel and self._kernel is None:110 if self.config.simulator_kernel_files and self._kernel is None:
108 self._kernel = self._find_and_copy(111 self._kernel = self._copy_first_find_from_list(subdir, odir,
109 subdir, odir, self.config.simulator_kernel)112 self.config.simulator_kernel_files)
110 # Extract the initrd from the image113 # Extract the initrd from the image
111 if self.config.simulator_initrd and self._initrd is None:114 if self.config.simulator_initrd_files and self._initrd is None:
112 self._initrd = self._find_and_copy(115 self._initrd = self._copy_first_find_from_list(subdir, odir,
113 subdir, odir, self.config.simulator_initrd)116 self.config.simulator_initrd_files)
114 # Extract the dtb from the image117 # Extract the dtb from the image
115 if self.config.simulator_dtb and self._dtb is None:118 if self.config.simulator_dtb and self._dtb is None:
116 self._dtb = self._find_and_copy(119 self._dtb = self._find_and_copy(
@@ -128,13 +131,13 @@
128 raise RuntimeError('No AXF found, %r' %131 raise RuntimeError('No AXF found, %r' %
129 self.config.simulator_axf_files)132 self.config.simulator_axf_files)
130 # Kernel is needed only for b.L models133 # Kernel is needed only for b.L models
131 if self._kernel is None and self.config.simulator_kernel:134 if self._kernel is None and self.config.simulator_kernel_files:
132 raise RuntimeError('No KERNEL found, %r' %135 raise RuntimeError('No KERNEL found, %r' %
133 self.config.simulator_kernel)136 self.config.simulator_kernel_files)
134 # Initrd is needed only for b.L models137 # Initrd is needed only for b.L models
135 if self._initrd is None and self.config.simulator_initrd:138 if self._initrd is None and self.config.simulator_initrd_files:
136 raise RuntimeError('No INITRD found, %r' %139 raise RuntimeError('No INITRD found, %r' %
137 self.config.simulator_initrd)140 self.config.simulator_initrd_files)
138 # DTB is needed only for b.L models141 # DTB is needed only for b.L models
139 if self._dtb is None and self.config.simulator_dtb:142 if self._dtb is None and self.config.simulator_dtb:
140 raise RuntimeError('No DTB found, %r' %143 raise RuntimeError('No DTB found, %r' %
141144
=== modified file 'lava_dispatcher/device/target.py'
--- lava_dispatcher/device/target.py 2013-06-19 21:49:04 +0000
+++ lava_dispatcher/device/target.py 2013-07-01 10:49:37 +0000
@@ -158,14 +158,14 @@
158 def _find_and_copy(self, rootdir, odir, pattern, name=None):158 def _find_and_copy(self, rootdir, odir, pattern, name=None):
159 dest = None159 dest = None
160 for root, dirs, files in os.walk(rootdir):160 for root, dirs, files in os.walk(rootdir):
161 for file in files:161 for file_name in files:
162 if re.match(pattern, file):162 if re.match(pattern, file_name):
163 if name:163 if name:
164 dest = os.path.join(odir, name)164 dest = os.path.join(odir, name)
165 else:165 else:
166 dest = os.path.join(odir, file)166 dest = os.path.join(odir, file_name)
167 if rootdir != odir:167 if rootdir != odir:
168 src = os.path.join(rootdir, file)168 src = os.path.join(root, file_name)
169 shutil.copyfile(src, dest)169 shutil.copyfile(src, dest)
170 return dest170 return dest
171 else:171 else:

Subscribers

People subscribed via source and target branches