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

Bug #1257308 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
High
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

Revision history for this message
Jeff Lane  (bladernr) wrote :

DEBUG:root:Shutting down interface:eth1
DEBUG:root:timeout 180 iperf -c 10.10.2.10 -n 1024M
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/network", line 542, in <module>
    sys.exit(main())
  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 = iperf_benchmark.run()
  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
Revision history for this message
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)
Changed in checkbox:
status: In Progress → Fix Committed
Daniel Manrique (roadmr)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.