Merge lp://staging/~qzhang/lava-dispatcher/reliable-result-transfer into lp://staging/lava-dispatcher
Proposed by
Spring Zhang
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 84 | ||||
Proposed branch: | lp://staging/~qzhang/lava-dispatcher/reliable-result-transfer | ||||
Merge into: | lp://staging/lava-dispatcher | ||||
Diff against target: |
232 lines (+68/-87) 4 files modified
lava_dispatcher/actions/launch_control.py (+47/-86) lava_dispatcher/client.py (+19/-0) lava_dispatcher/config.py (+1/-0) lava_dispatcher/utils.py (+1/-1) |
||||
To merge this branch: | bzr merge lp://staging/~qzhang/lava-dispatcher/reliable-result-transfer | ||||
Related bugs: |
|
||||
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Larson (community) | Approve | ||
Spring Zhang (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
Tested on normal image except one issue-download() fails to get lava_result.tgz, other part pass.
1. For getting the master image IP, I use enumerating, it may waste some time, but I can't get better idea now, it needs to install python-netaddr package on server.
2. For python-minimal, I use development branch master image now, it includes SimpleHTTPServer, I didn't get a chance to check nano yet.
3. It now gets IP by eth0, if there is no network_interface member in self.client.board.
4. Add a new macro LAVA_MASTER_NETWORK in config.py to provide the validation farm IP range.
5. Update Android part code.
To post a comment you must log in.
174 + def enum_master_ ip(self, network): board.network_ interface: board.network_ interface run_shell_ command( cmd, response= MASTER_ STR) run_shell_ command( 'cat myip',
175 + #store ip in myip of current path
176 + print "Determine master image IP"
177 + client = self.client
178 + try:
179 + if client.
180 + eth_device = client.
181 + else:
182 + eth_device = "eth0"
183 + except:
184 + eth_device = "eth0"
185 + cmd = ("ifconfig %s | grep 'inet addr' | awk -F: '{print $2}' |"
186 + "awk '{print $1}' > myip" % eth_device)
187 + client.
188 + for ip in IPNetwork(network):
189 + try:
190 + client.
191 + response=str(ip), timeout=2)
This is pretty complicated, and fails to deal with the fact that some boards may need to have some other interface, say usb0 for instance. I think there's two things we need to do around this:
1. Add a config item for the network interface we will use (using the new config files would be great for this!)
2. simplify this by just running ifconfig ont hat interface, and using expect to match the pattern
97 + client. proc.sendline( 'python -m SimpleHTTPServer 80')
98 + time.sleep(5)
Instead, why not just run 'python -m SimpleHTTPServer &> /dev/null &' and expect the shell prompt back? Then when it's over, we can just kill %1 to end the process.