Can't get the test result from the board
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LAVA Dispatcher |
Fix Released
|
Critical
|
Michael Hudson-Doyle |
Bug Description
Email from Chi Thu
Hi
I do not understand why the get_master_ip return wrong ip address ?
Here is the code in the lava-dispatcher
def get_master_
#get master image ip address
try:
except:
return None
#tty device uses minimal match, see pexpect wiki
#pattern1 = ".*\n(\
pattern1 = "(\d?\d?
cmd = ("ifconfig %s | grep 'inet addr' | awk -F: '{print $2}' |"
"awk '{print $1}'" % self._client.
self.run(
cmd, [pattern1, pexpect.EOF, pexpect.TIMEOUT], timeout=5)
if self.match_id == 0:
ip = self.match.
return ip
return None
In the log file from job
http://
--- 192.168.1.10 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.579/0.
root@master:/tmp# [rc=0]: ifconfig eth0 | grep 'inet addr' | awk -F:
'{print $2}' |awk '{print $1}'
ifconfig eth0 | grep 'inet addr' | awk -F: '{print $2
}' |awk '{print $1}'
192.168.1.152
root@master:/tmp# [rc=0]: <LAVA_DISPATCHE
matching pattern is 0
<LAVA_DISPATCHE
python -m SimpleHTTPServer 80 &> /dev/null &
BR
/Chi Thu
reply from mwhudson:
The only thing I can think of is that for some reason pexpect received
just the "192.168.1.1" part of the ip address first, which matches the
regexp of course, returned that as the matched, then the "52" part came
in after this had been processed. I don't know enough about how pexpect
works to know if this is plausible, but if this is the problem I guess
we can fix it by getting awk to print out some delimiters for the ip
address, e.g. changing the last invocation to awk '{ print "<" $1 ">" }'
and including the delimiters in the regexp.
I suggest filing a bug as the next course of action :-)
Cheers,
mwh
Related branches
Changed in lava-dispatcher: | |
status: | Confirmed → Fix Committed |
milestone: | none → 2012.01 |
Changed in lava-dispatcher: | |
assignee: | nobody → Le Chi Thu (le-chi-thu) |
Changed in lava-dispatcher: | |
assignee: | Le Chi Thu (le-chi-thu) → Michael Hudson-Doyle (mwhudson) |
Changed in lava-dispatcher: | |
status: | Fix Committed → Fix Released |
pexpect use the minimal match in serial devices, but pattern is provided with enough: ".\d?\d?\d?", the only thing I can imagine is the buffer is not sent all when match.