power-management/fwts_wakealarm not run as root, fails

Bug #1004102 reported by Daniel Manrique
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
High
Daniel Manrique
checkbox (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

This was reported using checkbox-certification-server on a server running Ubuntu 12.04.

Even though it appears as PASS on the test report, fwts-wakealarm.log shows the test didn't run as intended:

00012 wakealarm Test ACPI Wakealarm.
00013 wakealarm -----------------------------------------------------------------------------
00014 wakealarm Must be run as root or sudo to be able to read system information.
00015 wakealarm Aborted test, insufficient privilege.
00016 wakealarm =============================================================================
00017 wakealarm 0 passed, 0 failed, 0 warnings, 4 aborted, 0 skipped, 0 info only.
00018 wakealarm =============================================================================

This is because the test definition does not specify user: root.

Thus, even if the job is not normally run by Ubuntu users, if they attempt to run it it will produce bogus information and not run at all.

The solution implemented in the development version is to make this job use root. Also, the "environ" directive must be used to instruct the job to save its log file in the checkbox data directory (otherwise it will save it in /).

The job is defined in jobs/power-management.txt.in.

[Test case]
- Install fwts (sudo apt-get install fwts)
- Run checkbox like this (what this does is specify a whitelist on-the-fly with the failing job):

checkbox-qt -W <(cat <<EOF
`head -n 14 /usr/share/checkbox/data/whitelists/default.whitelist`
__power-management__
power-management/fwts_wakealarm
EOF
)

- Click on "start testing" when you see the list of tests (there should be only one).

Expected result:
- System suspends and then wakes up.
- A log file is left in ~/.cache/checkbox/fwts-wakealarm.log with a detailed log for the test.

Actual result:
- Test is marked as passed
- However, in ~/.cache/checkbox/fwts-wakealarm.log, the fwts log will indicate that the test was actually not run.

[Regression potential]
A slight chance for regression exists in that, if a system that wasn't running this test correctly now runs it, and the system fails to suspend properly, it may cause a system crash. The user is properly warned to save his work since checkbox tests may cause the system to stop responding so the impact from this should be minimal. Also, since this test is not run by default, it should only affect users who knowingly want to use it.

Related branches

Daniel Manrique (roadmr)
Changed in checkbox:
milestone: none → 0.14
importance: Undecided → High
Daniel Manrique (roadmr)
Changed in checkbox:
status: New → In Progress
Marc Tardif (cr3)
Changed in checkbox:
status: In Progress → Fix Committed
assignee: nobody → Daniel Manrique (roadmr)
Ara Pulido (ara)
Changed in checkbox:
status: Fix Committed → Fix Released
Daniel Manrique (roadmr)
description: updated
Jeff Marcom (jeffmarcom)
description: updated
Daniel Manrique (roadmr)
description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Daniel, or anyone else affected,

Accepted checkbox into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/checkbox/0.13.8 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in checkbox (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Daniel Manrique (roadmr)
Changed in checkbox (Ubuntu):
status: New → Fix Released
Revision history for this message
Daniel Manrique (roadmr) wrote :
Download full text (4.8 KiB)

Based on the comment that this was observed on servers, I tried this on a server installation of Ubuntu, though the problem should still occur with a client installation.

First, with checkbox 0.13.7 installed:

$ dpkg --list 'checkbox*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii checkbox 0.13.7 System testing application
ii checkbox-cli 0.13.7 Command line interface for checkbox
un checkbox-gtk <none> (no description available)

I had to change the test command to use checkbox-cli instead of checkbox-qt. Otherwise the way it works is exactly the same. I did the test run, the fwts_wakealarm test did NOT cause the system to suspend. The xml report shows the test as passed:

<question name="power-management/fwts_wakealarm">
<answer type="multiple_choice">pass</answer>
<answer_choices>
<value type="str">fail</value>
<value type="str">pass</value>
<value type="str">uninitiated</value>
<value type="str">unresolved</value>
<value type="str">unsupported</value>
<value type="str">untested</value>
</answer_choices>
<comment></comment>
</question>

but then the fwts_wakealarm.log says it didn't actually do anything:

00012 wakealarm Test ACPI Wakealarm.
00013 wakealarm -----------------------------------------------------------------------------
00014 wakealarm Must be run as root or sudo to be able to read system information.
00015 wakealarm Aborted test, insufficient privilege.
00016 wakealarm =============================================================================
00017 wakealarm 0 passed, 0 failed, 0 warnings, 4 aborted, 0 skipped, 0 info only.
00018 wakealarm =============================================================================

OK, then I remove the .cache/checkbox directory, upgrade to checkbox 0.13.8 from proposed:

$ dpkg --list 'checkbox*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii checkbox 0.13.8 System testing application
ii checkbox-cli 0.13.8 Command line interface for checkbox
un checkbox-gtk <none> (no description available)

I ran the tests using the given testing command. I noticed the system did *not* suspend, though it *did* take longer than the previous try. The test is now running as root, and the proof is that the fwts-wakealarm.log file is getting created in /. This is not entirely desirable but the behavior is at least better than it was previously (i.e. non-running test).

Here's the result from the fwts-wakealarm.log:

00012 wakealarm Test ACPI Wakealarm.
00013 wakealarm -----------------------------------------------------------------------------
00014 wakealarm ...

Read more...

tags: added: verification-done
removed: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Daniel, or anyone else affected,

Accepted checkbox into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/checkbox/0.13.9 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-done
tags: added: verification-needed
Revision history for this message
Daniel Manrique (roadmr) wrote :

First, testing with checkbox 0.13.7:
$ dpkg --list checkbox{,-cli}
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================-==================-====================================================
ii checkbox 0.13.7 System testing application
ii checkbox-cli 0.13.7 Command line interface for checkbox

Running the test command and checking the checkbox report says the test passed:
Power Management tests

   power-management/fwts_wakealarm [pass]
 : Space when finished

But the report in .cache/checkbox/fwts-wakealarm.log says otherwise (didn't run due to lack of privileges):

00012 wakealarm Test ACPI Wakealarm.
00013 wakealarm -----------------------------------------------------------------------------
00014 wakealarm Must be run as root or sudo to be able to read system information.
00015 wakealarm Aborted test, insufficient privilege.

With checkbox 0.13.9 installed:

$ dpkg --list checkbox{,-cli}
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==================-==================-====================================================
ii checkbox 0.13.9 System testing application
ii checkbox-cli 0.13.9 Command line interface for checkbox

The text-mode report shows success:
Power Management tests

   power-management/fwts_wakealarm [pass]
 : Space when finished

Here's the extract from the logfile showing it actually did something this time. Note the logfile is in /, as in comment #2, this is better than the test not running at all:

00010 fwts Running tests: wakealarm.

00012 wakealarm Test ACPI Wakealarm.
00013 wakealarm -----------------------------------------------------------------------------
00014 wakealarm Test 1 of 4: Check existance of /sys/class/rtc/rtc0/wakealarm.
00015 wakealarm PASSED: Test 1, /sys/class/rtc/rtc0/wakealarm found.
00016 wakealarm
00017 wakealarm Test 2 of 4: Trigger wakealarm for 1 seconds in the future.
00018 wakealarm Trigger wakealarm for 1 seconds in the future.
00019 wakealarm PASSED: Test 2, RTC wakealarm was triggered successfully.
00020 wakealarm
00021 wakealarm Test 3 of 4: Check if wakealarm is fired.
00022 wakealarm PASSED: Test 3, RTC wakealarm triggered and fired successfully.
00023 wakealarm
00024 wakealarm Test 4 of 4: Multiple wakealarm firing tests.
00025 wakealarm Trigger wakealarm for 1 seconds in the future.
00026 wakealarm Trigger wakealarm for 2 seconds in the future.
00027 wakealarm Trigger wakealarm for 3 seconds in the future.
00028 wakealarm Trigger wakealarm for 4 seconds in the future.
00029 wakealarm PASSED: Test 4, RTC wakealarm triggered and fired successfully.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.13.9

---------------
checkbox (0.13.9) precise-proposed; urgency=low

  * Updated fix for bug #1026614 which was missing some code.
  * Removed bad fix for bug 990133.

checkbox (0.13.8) precise-proposed; urgency=low

  * New upstream release (LP: #1061198)

  [Marc Tardif]
  * checkbox/dispatcher.py: Updated license to GPLv3 to be consistent with
    rest of Checkbox files (LP: #1049881)

  [Sylvain Pineau]
  * qt/frontend/qtfront.ui: Fixed the test purpose widget size to allow two
    lines of description (LP: #1032255)
  * scripts/camera_test, jobs/camera.txt.in: Added a 10s timeout to the camera
    still test (LP: #990133)

  [Daniel Manrique]
  * jobs/audio.txt.in: replaced gconfaudiosink by autoaudiosink (LP: #978895)
  * Instruct Chromium browser to accept file:// URLs so it can correctly
    open the checkbox submission.xml report (LP: #1026614)
  * scripts/network_check: InvalidURL exception is caught and handled more
    cleanly (LP: #751701)
  * Set the correct user (root) for fwts-wakealarm test (LP: #1004102)
  * Set correct user (root) for usb/storage-preinserted, so it works correctly
    on servers (LP: #1004131)

  [Nathan Williams]
  * scripts/network_check: Fixed exception handling in the absence of zenity
    (LP: #988260)
 -- Daniel Manrique <email address hidden> Tue, 20 Nov 2012 16:31:02 -0500

Changed in checkbox (Ubuntu Precise):
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.