cdimage_resource script in checkbox fails to read casper.log

Bug #558728 reported by Marc Tardif
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Undecided
Marc Tardif
checkbox (Ubuntu)
Fix Released
Undecided
Marc Tardif
Lucid
Fix Released
Undecided
Unassigned

Bug Description

The impact of this bug is that when the cdimage_resource script fails to run, checkbox cannot submit information about the media used to install the system. This fix simply makes sure the script is run by the backend in order to read the casper.log.

The cdimage_resource script does a best effort for finding information about the cdimage used to install a system. It first tries the media-info file under /var/log/installer and, if that fails, it then tries the casper.log file under the same directory. The problem is that the former file is readable by all whereas the latter file is only readable by root. So, the cdimage_resource script should be run as root.

Related branches

Marc Tardif (cr3)
Changed in checkbox:
assignee: nobody → Marc Tardif (cr3)
status: New → Fix Committed
Marc Tardif (cr3)
Changed in checkbox:
status: Fix Committed → Fix Released
Marc Tardif (cr3)
Changed in checkbox (Ubuntu Lucid):
milestone: none → lucid-updates
Changed in checkbox (Ubuntu):
assignee: nobody → Marc Tardif (cr3)
status: New → Fix Released
Changed in checkbox (Ubuntu Lucid):
status: New → In Progress
Marc Tardif (cr3)
description: updated
Revision history for this message
Daniel Manrique (roadmr) wrote :

Hello, the following information should complete this bug as a valid SRU report, to hopefully upload this fix to Lucid.

Note that even though the data is collected, checkbox doesn't actually include it in any reports. This is used when doing a certification run using checkbox-compatibility.

Solution:
Checkbox revision 784 changes the job definition to run as root, which causes checkbox to run it through the superprivileged backend.

TEST CASE:
For this test case we need to come up with a way of including the cdimage information in a report, so we can verify the behavior. Do this test on a Lucid 10.04 system (a virtual machine works fine).

1- Drop the attached text_report.py file in /usr/share/dropbox/plugins.
2- Launch System Testing
3- Deselect all tests and complete the test run (should be quick).
4- Look at ~/.cache/checkbox/text_report.txt which should contain information about the cd image used to install.
5- delete the whole .cache/checkbox directory.
6- rename /var/log/installer/media-info so that checkbox doesn't find it and tries to use the casper.log fallback.
7- Rerun steps 2-3 to do another test run.
8- Confirm that ~/.cache/checkbox/text_report.txt did NOT get created, meaning that cdimage_resource was unable to gather the requested information due to inability to read /var/log/installer/casper.log.

With the fix applied, the text_report.txt gets created even without the media info file, by taking the data from casper.log read running as root.

Regression potential:
The fix only makes the script run as root instead of the current user, nothing else in the code has changed. Since checkbox is installed system-wide, there's no chance of a regression where the script doesn't run due to the user change. Also, cdimage_resource opens files read-only so even if it runs as root, it won't affect the system in ways that weren't present before.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Use this to perform the test case as given in the previous comment.

Revision history for this message
Ara Pulido (ara) wrote :

This bug is awaiting verification that the checkbox version in lucid-proposed solves the problem. Please test checkbox and update this bug with the results. If the problem is solved, change the tag 'verification-needed' to 'verification-done'.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed
Revision history for this message
Chris Halse Rogers (raof) wrote :

ubuntu-sru approved and reviewed. Please accept into lucid-proposed.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Marc, or anyone else affected,

Accepted checkbox into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in checkbox (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
Chad A Davis (chadadavis) wrote :

I cannot reproduce the original issue with checkbox-gtk 0.9.1

The ~/.cache/checkbox/checkbox.log shows that the text_report plugin is loaded, but no ~/.cache/checkbox/text_report.txt is ever created.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi Chad,

Thanks so much for looking at and helping verify this bug report!

I went looking at scripts/cdimage_resource and found out that the regular expression it uses to obtain the Ubuntu release (10.04 in this case) doesn't work as-is with LTS releases (because the release is called 10.04.2 LTS, the "LTS" component throws it off).

Could you please change /var/log/installer/media-info to remove the LTS:

sudo pico /var/log/installer/media-info

it should read:

Ubuntu 10.04.2 "Lucid Lynx" - Release i386 (20110211.1)

This should be done also in /var/log/installer/casper.log (edit with sudo), remove the "LTS" in the line that starts with (should be line 8 in the file):

Found label

With this change, the test case should work correctly.

Also, if you can confirm whether this enabled you to run the test cases correctly, I'll file a bug on that behavior as well.

Thanks again!

Revision history for this message
Chad A Davis (chadadavis) wrote :

Verfied.
After removing LTS from /var/log/installer/{media-info,casper.log} the test case behaves as described
This allowed 0.91. to create ~/.cache/checkbox/text_report.txt
Removing media-info prevented 0.9.1 from creating text_report.txt
Installing 0.9.2 allowed creation of text_report.txt again.

Can this be marked as verification-done or is that now dependent on bug 814085 ?

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.9.2

---------------
checkbox (0.9.2) lucid-proposed; urgency=low

  New upstream release (LP: #567568):
  * Added referer when sending submissions to Launchpad (LP: #550973)
  * Added suggests to checkbox package in debian/control file (LP: #352740)
  * Fixed udev_resource script to be more resilient (LP: #556824)
  * Fixed cdimage_resource script to read casper.log (LP: #558728)
  * Fixed reporting all resources found for a job (LP: #560948)
  * Fixed stalling when using kdesudo to start backend (LP: #557443)
  * Fixed starting the appropriate default browser on UNR (LP: #563050)
  * Fixed opening the report with the gconf preferred browser (LP: #562580)
  * Fixed suspend_test to use relative time for wakealarm (LP: #349768)
  * Fixed backend not getting terminated upon closing (LP: #553328)
 -- Daniel Manrique <email address hidden> Wed, 22 Jun 2011 14:18:08 -0400

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