networks script dumps a traceback on Divide By Zero when ethtool doesn't report max speed properly

Bug #1257308 reported by Jeff Lane on 2013-12-03
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Jeff Lane

Bug Description

Ran into a problem with the network script that caused a div by zero error due to ethtool not reporting max supported speed properly.

That was a firmware issue with the device, but this bug is about handling the divide by zero error more elegantly. The traceback is unnecessary here, we just need a failing exit and a message saying what the deal was

Related branches

Jeff Lane (bladernr) wrote :

DEBUG:root:Shutting down interface:eth1
DEBUG:root:timeout 180 iperf -c -n 1024M
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/network", line 542, in <module>
  File "/usr/share/checkbox/scripts/network", line 538, in main
    return args.func(args)
  File "/usr/share/checkbox/scripts/network", line 433, in interface_test
    result =
  File "/usr/share/checkbox/scripts/network", line 100, in run
    percent = scaled_throughput / int(self.iface.max_speed) * 100
ZeroDivisionError: division by zero

Changed in checkbox:
status: New → Confirmed
assignee: nobody → Jeff Lane (bladernr)
status: Confirmed → Triaged
importance: Undecided → High
status: Triaged → In Progress
Jeff Lane (bladernr) wrote :

Just added some error handling for the ZeroDivisionError case. This lets the script continue... is marked as a fail but still provides enough data that the reviewer can decided manually whether to accept the results as pass or not.

Daniel Manrique (roadmr) on 2013-12-04
Changed in checkbox:
status: In Progress → Fix Committed
Daniel Manrique (roadmr) on 2013-12-20
Changed in checkbox:
milestone: none → 2013-dec-20
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers