Merge ~alextu/pc-enablement/+git/prepare-checkbox-sanity:autopkgtest-init into ~oem-solutions-engineers/pc-enablement/+git/prepare-checkbox-sanity:master

Proposed by Alex Tu
Status: Merged
Merged at revision: 365319a002f30f85aaf8985e1950c3146a1f0890
Proposed branch: ~alextu/pc-enablement/+git/prepare-checkbox-sanity:autopkgtest-init
Merge into: ~oem-solutions-engineers/pc-enablement/+git/prepare-checkbox-sanity:master
Diff against target: 224 lines (+70/-55)
7 files modified
README.md (+23/-47)
TODO (+2/-0)
debian/changelog (+6/-0)
debian/tests/control (+2/-0)
debian/tests/help (+2/-0)
usr/lib/prepare-checkbox-sanity/fall-back-checkbox.conf (+20/-0)
usr/sbin/checkbox-run-plan (+15/-8)
Reviewer Review Type Date Requested Status
Shih-Yuan Lee Approve
Yuan-Chen Cheng Pending
OEM Solutions Group: Engineers Pending
Review via email: mp+384079@code.launchpad.net

Description of the change

the work prepared for autopkgtest.

created testbed by referring to comment of commit d2f8a10

$ sudo autopkgtest -U --summary-file=summary.log --log-file=complete.log -- lxc autopkgtest-focal-amd64

$ cat complete.log
https://pastebin.canonical.com/p/2HvJGFHSDZ/

$ cat
help PASS

To post a comment you must log in.
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

LGTM

But it has the following problem that makes me have to checkout it manually.

$ sudo autopkgtest https://git.launchpad.net/~alextu/pc-enablement/+git/prepare-checkbox-sanity -- lxc autopkgtest-focal-amd64
...
Cloning into 'prepare-checkbox-sanity'...
remote: Counting objects: 98, done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 98 (delta 38), reused 0 (delta 0)
Unpacking objects: 100% (98/98), 14.48 KiB | 322.00 KiB/s, done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

sed: can't read debian/changelog: No such file or directory
blame: https://git.launchpad.net/~alextu/pc-enablement/+git/prepare-checkbox-sanity
badpkg: rules extract failed with exit code 2
autopkgtest [12:29:00]: ERROR: erroneous package: rules extract failed with exit code 2

review: Approve
Revision history for this message
Alex Tu (alextu) wrote :

refer to [1] the correct parameter to autopkgtest a branch should be: URL#branch

e.g.
$ sudo autopkgtest https://git.launchpad.net/\~alextu/pc-enablement/+git/prepare-checkbox-sanity\#autopkgtest-init -- lxc autopkgtest-focal-amd64

[1] https://manpages.debian.org/testing/autopkgtest/autopkgtest.1.en.html

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index cfcc852..8f646da 100644
3--- a/README.md
4+++ b/README.md
5@@ -1,6 +1,6 @@
6 # Background
7
8-[Checkbox](checkbox.readthedocs.io/en/latest/) is a flexible test automation software. It’s the main tool used in Ubuntu Certification program.
9+[Checkbox](https://checkbox.readthedocs.io/) is a flexible test automation software. It’s the main tool used in Ubuntu Certification program.
10
11 prepare-checkbox-sanity is a wrapper to help people prepare the environment for PC sanity with checkbox and run plans easier.
12
13@@ -59,53 +59,29 @@ $ checkbox-cli list | grep plan | grep poweroff | grep auto
14 test plan 'com.canonical.certification::power-management-reboot-poweroff-cert-automated'
15 test plan 'com.canonical.certification::stress-30-reboot-poweroff-automated'
16 $ checkbox-run-plan stress-30-reboot-poweroff-automated
17+
18+$ checkbox-cli list | grep plan | grep tpm2 | grep auto
19+# -b is to skip asking for configuration file
20+$ checkbox-run-plan tpm2.0_3.0.4-automated -b
21 ```
22
23 ## All usage can also be refered to help:
24-
25-
26-~~~ sh
27+```sh
28 $ prepare-checkbox-sanity --help
29-usage: prepare-checkbox-sanity options
30-
31- -h|--help print this message
32- --init If you installed this package by baser from git repository directly,
33- Then you need to do this first to setup the environment.
34- If you install it by debian package, then all things be done automatically.
35- --dev Get dev packages for plans under development from https://launchpad.net/~oem-solutions-group/+archive/ubuntu/pc-sanity-daily
36-
37-$ prepare-checkbox-sanity --help
38-usage: ./checkbox-run-plan options plan
39-
40- options:
41- -h|--help print this message
42- -e|--exclude-unites exclude unites
43- e.g. -e ".*audio/alsa_record_playback_automated .*suspend/record_playback_after_suspend_auto"
44- --checkbox-conf The path of checkbox.conf, refer to https://checkbox.readthedocs.io/en/latest/launcher-tutorial.html
45- The default path will refer to CHECKBOX_CONF in /etc/default/prepare-checkbox-sanity.conf
46- See usage below for detail.
47- -b batch mode, which will go all default way.
48-
49- plan:
50- pc_sanity_before_suspend
51- the plan in plainbox-provider-pc-sanity on ppa:oem-solutions-group/pc-sanity
52-
53- pc_sanity_after_suspend
54- the plan in plainbox-provider-pc-sanity on ppa:oem-solutions-group/pc-sanity
55-
56- stress-suspend-30-cycles-with-reboots-automated
57- the plan in plainbox-provider-checkbox
58-
59- sru
60- the plan in plainbox-provider-sru
61-
62- Or any plan in /usr/share/plainbox-provider-*/units could be used here as well.
63-
64- usage:
65- run sru plan, and use the checkbox.conf from current folder
66- ./checkbox-run-plan sru --checkbox-conf `pwd`/checkbox.conf -b
67-
68- run sru plan, and get the checkbox.conf from http://192.168.0.40/checkbox.conf
69- ./checkbox-run-plan sru --checkbox-conf http://192.168.0.40/checkbox.conf -b
70-
71-~~~
72+$ checkbox-run-plan --help
73+```
74+## Tips for checkbox
75+## [checkbox remote](https://checkbox.readthedocs.io/en/latest/remote.html)
76+## [side-loading proficders](https://checkbox.readthedocs.io/en/latest/side-loading.html)
77+```
78+Invocation:
79+ Slave:
80+$ checkbox-cli slave
81+ Master:
82+$ checkbox-cli master HOST [/PATH/TO/LAUNCHER]
83+```
84+## checkbox bootstrap
85+```
86+# checkbox-cli list-bootstrapped ${target-plan}
87+$ checkbox-cli list-bootstrapped com.canonical.certification::client-cert-auto
88+```
89diff --git a/TODO b/TODO
90index 1e2f8a6..e6f8b1a 100644
91--- a/TODO
92+++ b/TODO
93@@ -1,3 +1,5 @@
94+- the way to edit pxu test items without root.
95+https://checkbox.readthedocs.io/en/latest/tutorials.html#developing-provider-without-constantly-reinstalling-it
96 - interactive to generate launcher to run plan by plan.
97 - interactive to make change SSID easier.
98 - contribute the checkbox-run-plan model to upstream.
99diff --git a/debian/changelog b/debian/changelog
100index 971bc27..052edaf 100644
101--- a/debian/changelog
102+++ b/debian/changelog
103@@ -1,3 +1,9 @@
104+prepare-checkbox-sanity (1.0.5ubuntu1) UNRELEASED; urgency=medium
105+
106+ * autodpkgtest
107+
108+ -- Alex Tu <alex.tu@canonical.com> Thu, 14 May 2020 21:59:46 +0800
109+
110 prepare-checkbox-sanity (1.0.5) bionic; urgency=medium
111
112 * remove the dependency of sru
113diff --git a/debian/tests/control b/debian/tests/control
114new file mode 100644
115index 0000000..f91925d
116--- /dev/null
117+++ b/debian/tests/control
118@@ -0,0 +1,2 @@
119+Tests: help
120+Depends: @
121diff --git a/debian/tests/help b/debian/tests/help
122new file mode 100755
123index 0000000..3a2c83a
124--- /dev/null
125+++ b/debian/tests/help
126@@ -0,0 +1,2 @@
127+#!/bin/sh
128+checkbox-run-plan --help
129diff --git a/usr/lib/prepare-checkbox-sanity/fall-back-checkbox.conf b/usr/lib/prepare-checkbox-sanity/fall-back-checkbox.conf
130new file mode 100644
131index 0000000..f705efa
132--- /dev/null
133+++ b/usr/lib/prepare-checkbox-sanity/fall-back-checkbox.conf
134@@ -0,0 +1,20 @@
135+#!/usr/bin/env checkbox-cli
136+[launcher]
137+launcher_version = 1
138+stock_reports = text, submission_files
139+
140+[transport:example_local_file]
141+type = file
142+path = /tmp/c3-local-submission.tar.xz
143+
144+[exporter:example_tar]
145+unit = com.canonical.plainbox::tar
146+
147+[report:report_example_file]
148+transport = example_local_file
149+exporter = example_tar
150+forced = yes
151+
152+[environment]
153+ROUTERS = multiple
154+TRANSFER_SERVER = cdimage.ubuntu.com
155diff --git a/usr/sbin/checkbox-run-plan b/usr/sbin/checkbox-run-plan
156index aea820a..48f07c1 100755
157--- a/usr/sbin/checkbox-run-plan
158+++ b/usr/sbin/checkbox-run-plan
159@@ -1,8 +1,6 @@
160 #!/bin/bash
161-set -x
162
163-
164-EXCLUDE=".*usb/storage-preinserted .*suspend/usb_storage_preinserted_after_suspend .*stress/cpu_stress_ng_test .*disk/disk_stress_.*"
165+EXCLUDE=""
166 DEF_ENV="/etc/default/prepare-checkbox-sanity.conf"
167 source $DEF_ENV
168
169@@ -42,8 +40,14 @@ usage: $0 options plan
170 $0 sru --checkbox-conf http://192.168.0.40/checkbox.conf -b
171
172 EOF
173+}
174+
175+error(){
176+usage
177 exit 1
178 }
179+
180+
181 while [ $# -gt 0 ]
182 do
183 case "$1" in
184@@ -53,7 +57,7 @@ do
185 ;;
186 -e | --exclude)
187 shift
188- [ -z "$1" ] && usage
189+ [ -z "$1" ] && error
190 EXCLUDE="$EXCLUDE $1"
191 ;;
192 --checkbox-conf)
193@@ -64,7 +68,7 @@ do
194 SILENCE="TRUE"
195 ;;
196 *)
197- [ -z "$1" ] && usage
198+ [ -z "$1" ] && error
199 if [ -z "${1##exclude = *}" ];then
200 # a back door for jenkins testflinger job
201 EXCLUDE="$EXCLUDE ${1##exclude = }"
202@@ -76,7 +80,7 @@ do
203 shift
204 done
205
206-[ -z "$PLAN" ] && usage
207+[ -z "$PLAN" ] && error
208
209 interactive(){
210 echo "do you want to set the path of checkbox.conf? (refer to https://checkbox.readthedocs.io/en/latest/launcher-tutorial.html)"
211@@ -90,8 +94,11 @@ interactive(){
212 [ "$SILENCE" == "TRUE" ] || interactive
213 if [ -n "$CHECKBOX_CONF" ] && [ -z "${CHECKBOX_CONF##http*}" ]; then
214 mkdir -p $HOME/.cache/prepare-checkbox
215- wget $CHECKBOX_CONF -O $HOME/.cache/prepare-checkbox/checkbox.conf
216- CHECKBOX_CONF="$HOME/.cache/prepare-checkbox/checkbox.conf"
217+ if wget --waitretry=5 -T 5 -t 3 $CHECKBOX_CONF -O $HOME/.cache/prepare-checkbox/checkbox.conf; then
218+ CHECKBOX_CONF="$HOME/.cache/prepare-checkbox/checkbox.conf"
219+ else
220+ CHECKBOX_CONF="usr/lib/prepare-checkbox-sanity/fall-back-checkbox.conf"
221+ fi
222 fi
223
224 # always use the latest plan

Subscribers

People subscribed via source and target branches