rotation_test crashes when rotation is unsupported

Bug #1092925 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Low
Zygmunt Krynicki

Bug Description

Testing a desktop with an nVidia card installed requiring the nVidia-current driver. Ran the rotation test and discovered that it crashed with an ugly traceback that is recreatable manually:

Traceback (most recent call last):
    File "/usr/share/checkbox/scripts/rotation_test, line 72, in <module> exit(main())
    File "/usr/share/checkbox/scripts/rotation_test, line 52, in main
        rots_statuses[rot] = (status, error)
UnboundLocalError: local variable 'error' referenced before assignment

The script didnt' work. On further investigation, the 'Displays' tool does not provide any options or rotations available, and this is bore out by looking at nvidia-settings which ALSO does not appear to provide any rotation options.

This script should probably be fixed to handle cases like proprietary drivers as well as provide a cleaner error in this case.

Related branches

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

ii checkbox 0.15+bzr1842+201212050848~precise1 System testing application
ii checkbox-certification 0.15+bzr556+201211161747~precise1 Checkbox Certification Tests
ii checkbox-certification-client 0.15+bzr556+201211161747~precise1 Client Certification
ii checkbox-qt 0.15+bzr1842+201212050848~precise1 QT4 interface for checkbox

Zygmunt Krynicki (zyga)
affects: checkbox → plainbox-provider-checkbox
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Oh, blast from the past. Let's see

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

The script is clearly broken due to scoping rules in python3:

    for rot in rotations:
        try:
            raise xrandr.RRError # added to test this
            status = rotate_screen(rotations[rot])
        except(xrandr.RRError, xrandr.UnsupportedRRError) as error:
            status = 1
        else:
            error = 'N/A'
        # Collect the status and the error message
        rots_statuses[rot] = (status, error)

The variable 'error' is not in scope at the last line as it's only bound during the except handler.

Changed in plainbox-provider-checkbox:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Zygmunt Krynicki (zkrynicki)
status: Triaged → In Progress
milestone: none → 0.6
summary: - rotation_test crashes on 12.04.1 with nVidia-current driver installedl
+ rotation_test crashes when rotation is unsupported
Changed in plainbox-provider-checkbox:
milestone: 0.6 → 0.7
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
milestone: 0.7 → 0.6
Changed in plainbox-provider-checkbox:
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.