Merge lp:~cr3/checkbox/sru into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1148
Proposed branch: lp:~cr3/checkbox/sru
Merge into: lp:checkbox
Diff against target: 267 lines (+117/-6)
15 files modified
.bzrignore (+2/-0)
bin/checkbox-cli (+1/-1)
bin/checkbox-gtk (+1/-1)
bin/checkbox-sru (+18/-0)
bin/checkbox-urwid (+1/-1)
data/whitelists/sru.whitelist (+28/-0)
debian/checkbox-sru.install (+2/-0)
debian/checkbox-sru.links (+1/-0)
debian/checkbox-sru.postinst (+7/-0)
debian/control (+9/-0)
debian/rules (+3/-1)
examples/checkbox-sru.ini (+5/-0)
jobs/sru.txt.in (+4/-0)
scripts/sru_suspend (+33/-0)
setup.py (+2/-2)
To merge this branch: bzr merge lp:~cr3/checkbox/sru
Reviewer Review Type Date Requested Status
Brendan Donegan (community) Approve
Marc Tardif (community) Needs Resubmitting
Review via email: mp+84771@code.launchpad.net

Description of the change

This is an initial proposal for introducing SRU testing by the community. Until we clearly define how checkbox will be called, the current implementation is non-interactive and assumes being called like this:

  checkbox-sru --<email address hidden>

Also note that the sru job is defined as remote because the current assumption is that there would be one script that would result in many test results. For example, the sru_suspend test results in both suspend and hibernate tests. This needs to be remote instead of local so that the test is performed during the run phase rather than the gathering phase. This might change in the future but that seems to make the most sense for now.

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I have a comment about the naming. It seems like it might be wise to generalise the names of the test to describe what they do, rather than under what circumstances they're run. Also, you're clobbering my whitelist name! Thankfully it's in checkbox-certification at the moment but we did plan to move the whitelists out of checkbox-certification and into base checkbox.

review: Needs Fixing
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

To try and be constructive, rather than just poo-pooing your names, how about, e.g:

sru_suspend -> suspend/suspend_succeeded

and put it in the suspend job file rather than a separate SRU one?

lp:~cr3/checkbox/sru updated
1142. By Marc Tardif

Renamed sru tests and improved description.

Revision history for this message
Marc Tardif (cr3) wrote :

Thanks for the suggestion, I agree that the naming could be better. I have chosen:

  sru/suspend_success
  sru/hibernate_success

I have also taken the opportunity of improving the descriptions to be more useful. I have specifically chosen the sru/ namespace because these tests might eventually validate that you're effectively running a proposed kernel. I would like this side effect to be clearly delineated from the other tests.

As for the conflict with the checkbox-certification sru whitelist, I think it would make sense to clearly identify it as such: sru-certification.whitelist. Ideally, I would like both whitelists to eventually become one and the same, but we'll burn that bridge when we're on it...

review: Needs Resubmitting
lp:~cr3/checkbox/sru updated
1143. By Marc Tardif

Updated whitelist for sru tests.

Revision history for this message
Marc Tardif (cr3) wrote :

Forgot to update the whitelist, good catch brd!

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

Looks fine to me, but what about the sru.whitelist? does it clobber something in checkbox-cert that we need to worry about? do we need to rename something?

Revision history for this message
Marc Tardif (cr3) wrote :

The same sru.whitelist file name can be used in both checkbox and checkbox-certification where they will be referenced independently. For example, this is what we use in the checkbox-satellite preseeds which clearly reference a path specific to checkbox-certification:

  --whitelist-file=/usr/share/checkbox-certification/data/sru.whitelist

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Sorry I didn't pick these things up yesterday, but I just got the chance to actually run the thing today and I first noticed that checkbox-sru had not been given permissions. Secondly I noticed that the checkbox-sru script doesn't define a whitelist to CHECKBOX_OPTIONS, meaning it would need to be defined on the command line. I personally think it makes more sense to encode the whitelist in the script itself, just like we do with checkbox-certification-server/client

review: Needs Fixing
lp:~cr3/checkbox/sru updated
1144. By Marc Tardif

Moved whitelist-file option from setup.py directly in scripts.

Revision history for this message
Marc Tardif (cr3) wrote :

Brendan, good catch! I added the execute bit to checkbox-sru. As for the whitelist, I decided to specify the whitelist in each script instead of having setup.py do it. So, when running checkbox-* from the source tree, it will behave pretty much the same way as when running them from an installed package.

review: Needs Resubmitting
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I was about to merge this, as I got it to work after setting the execute bit on scripts/sru_suspend, but then I noticed that in the sru_suspend script you seem to have written a test that can't fail. Is it the case that no evidence is left behind that a system failed to suspend? If so then what value is this? At the moment not having tested suspend and the suspend actually failing give equivalent results, which is just wrong.

Some chatting with cking shows that while there is not a 100% reliable method there are ways to detect that suspend/hibernate failed.

review: Needs Fixing
Revision history for this message
Marc Tardif (cr3) wrote :

There are indeed ways to detect whether suspend/hibernate failed. If you look at the source of fwts, this is done by attempting to match one of 26 regular expressions over strings output by pm-utils in /var/log/pm-*.log. If these strings change, even by one character, then the attempt to detect a failure misses which is where reliability goes out the window. Instead, the current tests only checks for one success string which increases reliability by 26 times and also happens to reduce maintenance by as many times in the event pm-utils changes a string.

If you are concerned about detecting failure, I would propose that we check for two strings: one when suspend/hibernate started and another for success. If none is detected: untested. If one is detected: fail. If two are detected: pass. However, I think improvements to tests should be discussed in a bug rather than in this merge request.

Please note that the intent of this merge request is simply to put in place the necessary infrastructure for SRU testing, hence the name of this branch. The suspend/hibernate test was mostly intended to demonstrate that the infrastructure works.

review: Needs Resubmitting
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Ok. I am going to raise a bug for the test and merge this now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2011-06-29 13:34:45 +0000
+++ .bzrignore 2011-12-10 14:32:35 +0000
@@ -4,6 +4,7 @@
4debian/checkbox4debian/checkbox
5debian/checkbox-cli5debian/checkbox-cli
6debian/checkbox-gtk6debian/checkbox-gtk
7debian/checkbox-sru
7debian/checkbox-urwid8debian/checkbox-urwid
8debian/*-cli.postrm9debian/*-cli.postrm
9debian/*.debhelper10debian/*.debhelper
@@ -16,6 +17,7 @@
16debian/stamp-patched17debian/stamp-patched
17debian/*.substvars18debian/*.substvars
18debian/tmp19debian/tmp
20debian/*-sru.postrm
19debian/*-urwid.postrm21debian/*-urwid.postrm
20gtk/checkbox-gtk.glade.bak22gtk/checkbox-gtk.glade.bak
21gtk/checkbox-gtk.gladep23gtk/checkbox-gtk.gladep
2224
=== modified file 'bin/checkbox-cli'
--- bin/checkbox-cli 2011-06-29 09:46:26 +0000
+++ bin/checkbox-cli 2011-12-10 14:32:35 +0000
@@ -3,7 +3,7 @@
3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}
5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}
6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:-}6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:---whitelist-file=$CHECKBOX_SHARE/data/whitelists/default.whitelist}
7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE
88
9if [ $CHECKBOX_DATA != '.' ]9if [ $CHECKBOX_DATA != '.' ]
1010
=== modified file 'bin/checkbox-gtk'
--- bin/checkbox-gtk 2011-06-29 09:46:26 +0000
+++ bin/checkbox-gtk 2011-12-10 14:32:35 +0000
@@ -3,7 +3,7 @@
3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}
5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}
6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:-}6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:---whitelist-file=$CHECKBOX_SHARE/data/whitelists/default.whitelist}
7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE
88
9if [ $CHECKBOX_DATA != '.' ]9if [ $CHECKBOX_DATA != '.' ]
1010
=== added file 'bin/checkbox-sru'
--- bin/checkbox-sru 1970-01-01 00:00:00 +0000
+++ bin/checkbox-sru 2011-12-10 14:32:35 +0000
@@ -0,0 +1,18 @@
1#!/bin/bash
2
3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}
5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}
6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:---whitelist-file=$CHECKBOX_SHARE/data/whitelists/sru.whitelist}
7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE
8
9if [ $CHECKBOX_DATA != '.' ]
10then
11 old_data=$HOME/.checkbox
12 if [ -d $old_data ] && [ ! -d $CHECKBOX_DATA ]
13 then
14 mv -f $old_data $CHECKBOX_DATA
15 fi
16fi
17
18python $CHECKBOX_SHARE/run "$@" $CHECKBOX_SHARE/configs/$(basename $0).ini
019
=== modified file 'bin/checkbox-urwid'
--- bin/checkbox-urwid 2011-06-29 09:46:26 +0000
+++ bin/checkbox-urwid 2011-12-10 14:32:35 +0000
@@ -3,7 +3,7 @@
3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}3export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}4export CHECKBOX_DATA=${CHECKBOX_DATA:-.}
5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}5export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.}
6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:-}6export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:---whitelist-file=$CHECKBOX_SHARE/data/whitelists/default.whitelist}
7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE7export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE
88
9if [ $CHECKBOX_DATA != '.' ]9if [ $CHECKBOX_DATA != '.' ]
1010
=== added file 'data/whitelists/sru.whitelist'
--- data/whitelists/sru.whitelist 1970-01-01 00:00:00 +0000
+++ data/whitelists/sru.whitelist 2011-12-10 14:32:35 +0000
@@ -0,0 +1,28 @@
1cdimage
2cpuinfo
3device
4dmi
5dpkg
6gconf
7lsb
8meminfo
9module
10package
11uname
12__info__
13codecs_attachment
14cpuinfo_attachment
15dmesg_attachment
16dmi_attachment
17dmidecode_attachment
18lsmod_attachment
19lspci_attachment
20gcov_attachment
21modprobe_attachment
22modules_attachment
23sysfs_attachment
24sysctl_attachment
25udev_attachment
26__sru__
27sru/suspend_success
28sru/hibernate_success
029
=== added file 'debian/checkbox-sru.install'
--- debian/checkbox-sru.install 1970-01-01 00:00:00 +0000
+++ debian/checkbox-sru.install 2011-12-10 14:32:35 +0000
@@ -0,0 +1,2 @@
1usr/bin/checkbox-sru
2usr/share/checkbox/examples/checkbox-sru.ini
03
=== added file 'debian/checkbox-sru.links'
--- debian/checkbox-sru.links 1970-01-01 00:00:00 +0000
+++ debian/checkbox-sru.links 2011-12-10 14:32:35 +0000
@@ -0,0 +1,1 @@
1usr/share/man/man1/checkbox.1.gz usr/share/man/man1/checkbox-sru.1.gz
02
=== added file 'debian/checkbox-sru.postinst'
--- debian/checkbox-sru.postinst 1970-01-01 00:00:00 +0000
+++ debian/checkbox-sru.postinst 2011-12-10 14:32:35 +0000
@@ -0,0 +1,7 @@
1#! /bin/sh -e
2
3base_package="checkbox"
4. /usr/share/debconf/confmodule
5. /usr/share/checkbox/install/postinst
6
7#DEBHELPER#
08
=== modified file 'debian/control'
--- debian/control 2011-12-06 21:32:26 +0000
+++ debian/control 2011-12-10 14:32:35 +0000
@@ -56,6 +56,15 @@
56 .56 .
57 This package provides a GTK interface for answering tests.57 This package provides a GTK interface for answering tests.
5858
59Package: checkbox-sru
60Architecture: all
61Depends: checkbox (>= ${source:Version}), ${misc:Depends}
62Description: SRU interface for checkbox
63 This project provides an extensible interface for system testing. The
64 results can then be sent to Launchpad.
65 .
66 This package provides a non-interactive interface for SRU testing.
67
59Package: hwtest68Package: hwtest
60Section: python69Section: python
61Architecture: all70Architecture: all
6271
=== modified file 'debian/rules'
--- debian/rules 2011-06-23 21:45:46 +0000
+++ debian/rules 2011-12-10 14:32:35 +0000
@@ -7,6 +7,7 @@
7 cp debian/checkbox.postrm debian/checkbox-cli.postrm7 cp debian/checkbox.postrm debian/checkbox-cli.postrm
8 cp debian/checkbox.postrm debian/checkbox-urwid.postrm8 cp debian/checkbox.postrm debian/checkbox-urwid.postrm
9 cp debian/checkbox.postrm debian/checkbox-gtk.postrm9 cp debian/checkbox.postrm debian/checkbox-gtk.postrm
10 cp debian/checkbox.postrm debian/checkbox-sru.postrm
10 cp debian/hwtest.postrm debian/hwtest-cli.postrm11 cp debian/hwtest.postrm debian/hwtest-cli.postrm
11 cp debian/hwtest.postrm debian/hwtest-gtk.postrm12 cp debian/hwtest.postrm debian/hwtest-gtk.postrm
12 dh_installdeb13 dh_installdeb
@@ -16,6 +17,7 @@
16 dh_installdocs -pcheckbox-cli ./README 17 dh_installdocs -pcheckbox-cli ./README
17 dh_installdocs -pcheckbox-urwid ./README 18 dh_installdocs -pcheckbox-urwid ./README
18 dh_installdocs -pcheckbox-gtk ./README 19 dh_installdocs -pcheckbox-gtk ./README
20 dh_installdocs -pcheckbox-sru ./README
19 dh_installdocs -phwtest ./README 21 dh_installdocs -phwtest ./README
20 dh_installdocs -phwtest-cli ./README 22 dh_installdocs -phwtest-cli ./README
21 dh_installdocs -phwtest-gtk ./README 23 dh_installdocs -phwtest-gtk ./README
@@ -23,7 +25,7 @@
2325
24override_dh_clean:26override_dh_clean:
25 -find . -name \*.mo -exec rm {} \;27 -find . -name \*.mo -exec rm {} \;
26 -rm -f debian/checkbox-cli.postrm debian/checkbox-urwid.postrm debian/checkbox-gtk.postrm28 -rm -f debian/checkbox-cli.postrm debian/checkbox-urwid.postrm debian/checkbox-gtk.postrm debian/checkbox-sru.postrm
27 -rm -f debian/hwtest-cli.postrm debian/hwtest-gtk.postrm29 -rm -f debian/hwtest-cli.postrm debian/hwtest-gtk.postrm
28 debconf-updatepo30 debconf-updatepo
29 dh_clean31 dh_clean
3032
=== added file 'examples/checkbox-sru.ini'
--- examples/checkbox-sru.ini 1970-01-01 00:00:00 +0000
+++ examples/checkbox-sru.ini 2011-12-10 14:32:35 +0000
@@ -0,0 +1,5 @@
1[DEFAULT]
2
3# Space separated list of files to include as a dependency for the
4# SRU interface.
5includes = %(checkbox_share)s/configs/checkbox.ini
06
=== added file 'jobs/sru.txt.in'
--- jobs/sru.txt.in 1970-01-01 00:00:00 +0000
+++ jobs/sru.txt.in 2011-12-10 14:32:35 +0000
@@ -0,0 +1,4 @@
1name: __sru__
2plugin: remote
3_description: SRU tests.
4command: sru_suspend
05
=== added file 'scripts/sru_suspend'
--- scripts/sru_suspend 1970-01-01 00:00:00 +0000
+++ scripts/sru_suspend 2011-12-10 14:32:35 +0000
@@ -0,0 +1,33 @@
1#!/bin/bash
2#
3# Simplistic test to determine whether the system successfully resumed
4# from suspend and thawed from hibernate.
5
6if zgrep -q '/usr/lib/pm-utils/sleep.d/000kernel-change resume suspend: success.' /var/log/pm-suspend.log*; then
7 suspend_status="pass"
8else
9 suspend_status="untested"
10fi
11
12if zgrep -q '/usr/lib/pm-utils/sleep.d/000kernel-change thaw hibernate: success.' /var/log/pm-suspend.log*; then
13 hibernate_status="pass"
14else
15 hibernate_status="untested"
16fi
17
18cat <<EOF
19plugin: shell
20name: sru/suspend_success
21status: $suspend_status
22description:
23 Check that /var/log/pm-suspend.log contains the string:
24 resume suspend: success.
25
26plugin: shell
27name: sru/hibernate_success
28status: $hibernate_status
29description:
30 Check that /var/log/pm-suspend.log contains the string:
31 thaw hibernate: success.
32
33EOF
034
=== modified file 'setup.py'
--- setup.py 2011-10-11 20:15:01 +0000
+++ setup.py 2011-12-10 14:32:35 +0000
@@ -188,7 +188,6 @@
188 for outfile in self.outfiles:188 for outfile in self.outfiles:
189 infile = posixpath.join("bin", posixpath.basename(outfile))189 infile = posixpath.join("bin", posixpath.basename(outfile))
190 substitute_variables(infile, outfile, {190 substitute_variables(infile, outfile, {
191 "CHECKBOX_OPTIONS:-": "CHECKBOX_OPTIONS:---whitelist-file=$CHECKBOX_SHARE/data/whitelists/default.whitelist",
192 "CHECKBOX_SHARE:-.": "CHECKBOX_SHARE:-/usr/share/checkbox",191 "CHECKBOX_SHARE:-.": "CHECKBOX_SHARE:-/usr/share/checkbox",
193 "CHECKBOX_DATA:-.": "CHECKBOX_DATA:-$XDG_CACHE_HOME/checkbox"})192 "CHECKBOX_DATA:-.": "CHECKBOX_DATA:-$XDG_CACHE_HOME/checkbox"})
194193
@@ -230,7 +229,8 @@
230 ("share/checkbox/gtk/", ["gtk/checkbox-gtk.ui", "gtk/*.png"]),229 ("share/checkbox/gtk/", ["gtk/checkbox-gtk.ui", "gtk/*.png"]),
231 ("share/apport/package-hooks/", ["apport/source_checkbox.py"]),230 ("share/apport/package-hooks/", ["apport/source_checkbox.py"]),
232 ("share/apport/general-hooks/", ["apport/checkbox.py"])],231 ("share/apport/general-hooks/", ["apport/checkbox.py"])],
233 scripts = ["bin/checkbox-cli", "bin/checkbox-gtk", "bin/checkbox-urwid"],232 scripts = ["bin/checkbox-cli", "bin/checkbox-gtk", "bin/checkbox-sru",
233 "bin/checkbox-urwid"],
234 packages = ["checkbox", "checkbox.contrib", "checkbox.lib", "checkbox.parsers",234 packages = ["checkbox", "checkbox.contrib", "checkbox.lib", "checkbox.parsers",
235 "checkbox.reports", "checkbox_cli", "checkbox_gtk", "checkbox_urwid"],235 "checkbox.reports", "checkbox_cli", "checkbox_gtk", "checkbox_urwid"],
236 package_data = {236 package_data = {

Subscribers

People subscribed via source and target branches