cdimage_resource script in checkbox fails to read casper.log
Bug #558728 reported by
Marc Tardif
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
lp://staging/~cr3/ubuntu/lucid/checkbox/0.9.2
Ready for review
for merging
into
lp://staging/ubuntu/lucid/checkbox
- Mathias Gug: Needs Fixing
-
Diff: 822 lines (+253/-247)20 files modifiedbackend (+12/-3)
checkbox/job.py (+1/-1)
checkbox/resource.py (+3/-2)
checkbox/user_interface.py (+7/-2)
debian/changelog (+17/-0)
debian/control (+1/-0)
jobs/disk.txt.in (+1/-2)
jobs/local.txt.in (+1/-1)
jobs/resource.txt.in (+1/-0)
plugins/backend_info.py (+15/-17)
plugins/begin_prompt.py (+33/-0)
plugins/launchpad_exchange.py (+2/-1)
plugins/persist_info.py (+2/-2)
po/checkbox.pot (+10/-10)
scripts/ansi_parser (+2/-1)
scripts/device_list (+0/-168)
scripts/disk_test (+0/-33)
scripts/run_templates (+142/-0)
scripts/suspend_test (+2/-3)
scripts/udev_resource (+1/-1)
lp://staging/~roadmr/ubuntu/lucid/checkbox/0.9.2
- Stéphane Graber: Approve
-
Diff: 807 lines (+250/-246)19 files modifiedbackend (+12/-3)
checkbox/job.py (+1/-1)
checkbox/resource.py (+3/-2)
checkbox/user_interface.py (+7/-2)
debian/changelog (+16/-0)
debian/control (+1/-0)
jobs/disk.txt.in (+1/-2)
jobs/local.txt.in (+1/-1)
jobs/resource.txt.in (+1/-0)
plugins/backend_info.py (+15/-17)
plugins/begin_prompt.py (+33/-0)
plugins/launchpad_exchange.py (+2/-1)
plugins/persist_info.py (+2/-2)
po/checkbox.pot (+10/-10)
scripts/device_list (+0/-168)
scripts/disk_test (+0/-33)
scripts/run_templates (+142/-0)
scripts/suspend_test (+2/-3)
scripts/udev_resource (+1/-1)
Changed in checkbox: | |
assignee: | nobody → Marc Tardif (cr3) |
status: | New → Fix Committed |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |
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 |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
To post a comment you must log in.
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. checkbox/ text_report. txt which should contain information about the cd image used to install. installer/ media-info so that checkbox doesn't find it and tries to use the casper.log fallback. 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.
2- Launch System Testing
3- Deselect all tests and complete the test run (should be quick).
4- Look at ~/.cache/
5- delete the whole .cache/checkbox directory.
6- rename /var/log/
7- Rerun steps 2-3 to do another test run.
8- Confirm that ~/.cache/
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.