unhandled exception when running cpufreq_test.py as a non-root user

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

Bug Description

Forgot to use sudo to run cpufreq_test.py manually and instead of a useful message I got a traceback:

$ /usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py -d |tee -a /home/bladernr/cpufreq.log
---------------------
| CpuFreqTest Begin |
---------------------
* disabling thread siblings (hyperthreading):
  - disabling cores: {4, 5, 6, 7}
Unable to write file: /sys/devices/system/cpu/cpu4/online
ERROR: Unable to write file: /sys/devices/system/cpu/cpu4/online
Traceback (most recent call last):
  File "/usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py", line 162, in _write_sysfs
    with open(abs_path, 'wb') as _file:
PermissionError: [Errno 13] Permission denied: '/sys/devices/system/cpu/cpu4/online'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py", line 765, in <module>
    sys.exit(main())
  File "/usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py", line 761, in main
    return cpu_freq_test.execute_test()
  File "/usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py", line 360, in execute_test
    self.disable_thread_siblings()
  File "/usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py", line 250, in disable_thread_siblings
    self._write_sysfs(fpath, 0)
  File "/usr/lib/plainbox-provider-checkbox/bin/cpufreq_test.py", line 166, in _write_sysfs
    'Unable to write file: %s' % abs_path)
__main__.CpuFreqTestError

This exception should be handled (and realistically, should never be hit, the script should immeidately exit if the user is not root/sudo)

Jeff Lane  (bladernr)
Changed in plainbox-provider-checkbox:
assignee: Adrian Lane (alanec) → Jeff Lane (bladernr)
status: Confirmed → In Progress
milestone: none → 0.58.0
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
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.