Red Hat Bugzilla – Bug 467981
Network test reported the wrong supported speed
Last modified: 2014-03-25 20:55:44 EDT
In network.py function getInterfaceSpeed() only read the first line of ethtool's output, so it is impossible to get the correct speed.
At least, 3 lines need to be modified:
# default to 100 Mb/s
self.interfaceSpeed = 0
for interfaceString in (self.interface, "p%s" % self.interface):
ethtoolCommand = "ethtool %s" % interfaceString
pipe = os.popen(ethtoolCommand)
# line = pipe.readline()
line=pipe.read() # use method read() to get the whole output
# pattern = re.compile("Speed: \d+Mb/s")
pattern = re.compile("(Speed: )(?P<speed>\d+)(Mb/s)") # use re to match the speed
match = pattern.search(line)
# self.interfaceSpeed = string.atoi(match.group())
self.interfaceSpeed = string.atoi(match.group("speed")) # transfer speed to type int
if self.interfaceSpeed == 0:
# default it to 100
self.interfaceSpeed = 100
Created attachment 324219 [details]
network.py patch to for network speed
This patch revises the network test to use the HTS Command wrapper to find network speed on a multi-line result from ethtool.
Verified network.py patch of Comment #1 was included in hts-5.3-12.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.