Merge ~sylvain-pineau/checkbox-snappy/+git/checkbox-snappy-classic:interim_release_support into checkbox-snappy:master

Proposed by Sylvain Pineau
Status: Superseded
Proposed branch: ~sylvain-pineau/checkbox-snappy/+git/checkbox-snappy-classic:interim_release_support
Merge into: checkbox-snappy:master
Diff against target: 322 lines (+123/-13) (has conflicts)
10 files modified
launchers/client-cert-iot-server (+18/-0)
launchers/configure (+15/-0)
launchers/hw-collection (+0/-0)
launchers/shell-wrapper (+3/-1)
launchers/test-runner (+4/-0)
launchers/wrapper_local (+24/-0)
snap/hooks/configure (+17/-4)
snap/hooks/install (+18/-1)
snap/hooks/remove (+5/-0)
snap/snapcraft.yaml (+19/-7)
Conflict in launchers/client-cert-iot-server
Conflict in launchers/client-cert-iot-ubuntucore
Conflict in launchers/configure
Conflict in launchers/hw-collection
Conflict in launchers/shell-wrapper
Conflict in launchers/smoke-test
Conflict in launchers/smoke-test-netplan
Conflict in launchers/test-runner
Conflict in launchers/test-runner-edgex
Conflict in launchers/wrapper_common
Conflict in launchers/wrapper_local
Conflict in snap/hooks/configure
Conflict in snap/hooks/install
Conflict in snap/snapcraft.yaml
Reviewer Review Type Date Requested Status
Checkbox Developers Pending
Review via email: mp+401776@code.launchpad.net

This proposal has been superseded by a proposal from 2021-04-26.

Description of the change

To post a comment you must log in.

Unmerged commits

2066223... by Sylvain Pineau

wrapper_local: Move $PERL5LIB export after the $PATH adjustments

Otherwise perl is the one from the host not the snap and can't load extra
modules only available in the snap.

8c5502e... by Sylvain Pineau

hooks:install: Preserve sudoer include directive with the pound (#) character

To stay comptabible with older version of sudo that don't understand the @include.

See https://unix.stackexchange.com/questions/244064/why-are-the-include-and-includedir-directives-in-sudo-prefixed-with-the-pound

16cc0f9... by PMR <pmr@pmr-lander>

Merge #400248 from ~jocave/checkbox-snappy/+git/checkbox-snappy-classic:use-service-subcommand

4fc06c9... by Jonathan Cave

Change: use service subcommand

595baea... by PMR <pmr@pmr-lander>

Merge #400135 from ~jocave/checkbox-snappy/+git/checkbox-snappy-classic:remove-old-launchers

fb32a14... by Jonathan Cave

Change: remove unused launchers

9826cf9... by PMR <pmr@pmr-lander>

Merge #397983 from ~checkbox-dev/checkbox-snappy/+git/checkbox-snappy-classic:release

Release_2021_Week6

c585d53... by PMR <pmr@pmr-lander>

Bump version to next dev release

fae1a2d... by PMR <pmr@pmr-lander>

Bump version number and tag parts

d3f0454... by PMR <pmr@pmr-lander>

Merge #394895 from ~checkbox-dev/checkbox-snappy/+git/checkbox-snappy-classic:release

Release_2020_Week49

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/launchers/client-cert-iot-server b/launchers/client-cert-iot-server
2new file mode 100755
3index 0000000..1b858fb
4--- /dev/null
5+++ b/launchers/client-cert-iot-server
6@@ -0,0 +1,18 @@
7+#!/usr/bin/env checkbox-cli-wrapper
8+[launcher]
9+app_id = com.canonical.certification:checkbox-snappy
10+launcher_version = 1
11+stock_reports = text, submission_files
12+
13+[test plan]
14+unit = com.canonical.certification::client-cert-iot-server-20-04-automated
15+forced = yes
16+
17+[test selection]
18+forced = yes
19+
20+[ui]
21+type = silent
22+auto_retry = yes
23+max_attempts = 4
24+delay_before_retry = 30
25diff --git a/launchers/configure b/launchers/configure
26index b729bb2..86be431 100755
27--- a/launchers/configure
28+++ b/launchers/configure
29@@ -10,6 +10,7 @@ import re
30 import sys
31
32 sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages"))
33+<<<<<<< launchers/configure
34 sitepkgpath = "$SNAP/lib/python{}.{}/site-packages".format(
35 sys.version_info[0], sys.version_info[1])
36 sys.path.append(os.path.expandvars(sitepkgpath))
37@@ -18,6 +19,14 @@ sys.path.append(os.path.expandvars(
38 "$SNAP/checkbox-runtime/usr/lib/python3/dist-packages"))
39 runtimepath = "$SNAP/checkbox-runtime/lib/python{}.{}/site-packages".format(
40 sys.version_info[0], sys.version_info[1])
41+=======
42+sitepkgpath = "$SNAP/lib/python3.8/site-packages"
43+sys.path.append(os.path.expandvars(sitepkgpath))
44+
45+sys.path.append(os.path.expandvars(
46+ "/snap/checkbox20/current/usr/lib/python3/dist-packages"))
47+runtimepath = "/snap/checkbox20/current/lib/python3.8/site-packages"
48+>>>>>>> launchers/configure
49 sys.path.append(os.path.expandvars(runtimepath))
50
51 try:
52@@ -26,6 +35,7 @@ try:
53 except ImportError:
54 msg = """
55 checkbox-support not found!
56+<<<<<<< launchers/configure
57 You need to connect this snap to the checkbox20 snap.
58
59 You can do this with those commands:
60@@ -39,6 +49,11 @@ snap connect $SNAP_NAME:provider-docker checkbox20:provider-docker
61 snap connect $SNAP_NAME:provider-tpm2 checkbox20:provider-tpm2
62 snap connect $SNAP_NAME:provider-sru checkbox20:provider-sru
63 snap connect $SNAP_NAME:provider-edgex checkbox20:provider-edgex
64+=======
65+You need to install the checkbox20 snap:
66+
67+snap install checkbox20
68+>>>>>>> launchers/configure
69 """
70 print(os.path.expandvars(msg), file=sys.stderr)
71 sys.exit(1)
72diff --git a/launchers/hw-collection b/launchers/hw-collection
73new file mode 100644
74index 0000000..e69de29
75--- /dev/null
76+++ b/launchers/hw-collection
77diff --git a/launchers/shell-wrapper b/launchers/shell-wrapper
78index 7cd58e7..1382771 100755
79--- a/launchers/shell-wrapper
80+++ b/launchers/shell-wrapper
81@@ -1,7 +1,9 @@
82 #!/bin/bash
83
84+<<<<<<< launchers/shell-wrapper
85 . $(dirname "$(realpath $BASH_SOURCE)")/wrapper_local
86
87+=======
88+>>>>>>> launchers/shell-wrapper
89 echo "$SNAP_NAME runtime shell, type 'exit' to quit the session"
90-
91 exec bash
92diff --git a/launchers/test-runner b/launchers/test-runner
93index f7c3b90..6c7044a 100755
94--- a/launchers/test-runner
95+++ b/launchers/test-runner
96@@ -6,4 +6,8 @@ launcher_version = 1
97 stock_reports = text, submission_files, certification
98
99 [test plan]
100+<<<<<<< launchers/test-runner
101 filter = com.canonical.certification::client-cert-iot-ubuntucore-20-*
102+=======
103+filter = com.canonical.certification::client-cert-iot-server-20-04-*
104+>>>>>>> launchers/test-runner
105diff --git a/launchers/wrapper_local b/launchers/wrapper_local
106index 4c85cc2..53beffd 100755
107--- a/launchers/wrapper_local
108+++ b/launchers/wrapper_local
109@@ -18,6 +18,7 @@ esac
110 # Launcher common exports for any checkbox app #
111 ################################################
112
113+<<<<<<< launchers/wrapper_local
114 if [ -d $SNAP/checkbox-runtime ]; then
115 RUNTIME=$SNAP/checkbox-runtime
116 if [ ! -d $RUNTIME/usr ]; then
117@@ -41,6 +42,29 @@ if [ -e $RUNTIME/wrapper_common ]; then
118 . $RUNTIME/wrapper_common
119 else
120 echo "ERROR: no $RUNTIME/wrapper_common found"
121+=======
122+RUNTIME=/snap/checkbox20/current
123+if [ ! -d "$RUNTIME" ]; then
124+ echo "You need to install the checkbox20 snap."
125+ echo ""
126+ echo "You can do this with this command:"
127+ echo "snap install checkbox20"
128+ exit 1
129+fi
130+
131+export LC_ALL=C.UTF-8
132+export GI_TYPELIB_PATH=$SNAP/usr/lib/girepository-1.0:$SNAP/usr/lib/$ARCH/girepository-1.0
133+export PATH="$SNAP/usr/sbin:$SNAP/sbin:$SNAP/usr/bin:$SNAP/bin:/snap/bin:$PATH"
134+export ALSA_CONFIG_PATH=$SNAP/usr/share/alsa/alsa.conf:$SNAP/usr/share/alsa/pcm/default.conf
135+export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH"
136+PERL_VERSION=$(perl -e '$^V=~/^v(\d+\.\d+)/;print $1')
137+export PERL5LIB="$PERL5LIB:$SNAP/usr/lib/$ARCH/perl/$PERL_VERSION:$SNAP/usr/lib/$ARCH/perl5/$PERL_VERSION:$SNAP/usr/share/perl/$PERL_VERSION:$SNAP/usr/share/perl5"
138+
139+if [ -e $RUNTIME/wrapper_common_classic ]; then
140+ . $RUNTIME/wrapper_common_classic
141+else
142+ echo "ERROR: no $RUNTIME/wrapper_common_classic found"
143+>>>>>>> launchers/wrapper_local
144 exit 1
145 fi
146
147diff --git a/snap/hooks/configure b/snap/hooks/configure
148index 036ede2..ecff58c 100755
149--- a/snap/hooks/configure
150+++ b/snap/hooks/configure
151@@ -21,27 +21,31 @@ STRESS_S3_WAIT_DELAY=60
152
153 To change those values use the configure launcher.
154 E.g.
155- $ checkbox-snappy.configure OPEN_N_SSID=my-wifi
156+ $ checkbox-snappy-classic.configure OPEN_N_SSID=my-wifi
157
158 If you __really__ need to change those values using `snap set` command,
159 you need to change CAPS to lowercase and underscores to dashes (-).
160
161 E.g.
162- $ snap set checkbox-snappy open-n-ssid=my-wifi
163+ $ snap set checkbox-snappy-classic open-n-ssid=my-wifi
164 """
165
166 import os
167 import sys
168
169 sys.path.append(os.path.expandvars("$SNAP/usr/lib/python3/dist-packages"))
170-sitepkgpath = "$SNAP/lib/python{}.{}/site-packages".format(
171- sys.version_info[0], sys.version_info[1])
172+sitepkgpath = "$SNAP/lib/python3.8/site-packages"
173 sys.path.append(os.path.expandvars(sitepkgpath))
174
175 sys.path.append(os.path.expandvars(
176+<<<<<<< snap/hooks/configure
177 "$SNAP/checkbox-runtime/usr/lib/python3/dist-packages"))
178 runtimepath = "$SNAP/checkbox-runtime/lib/python{}.{}/site-packages".format(
179 sys.version_info[0], sys.version_info[1])
180+=======
181+ "/snap/checkbox20/current/usr/lib/python3/dist-packages"))
182+runtimepath = "/snap/checkbox20/current/lib/python3.8/site-packages"
183+>>>>>>> snap/hooks/configure
184 sys.path.append(os.path.expandvars(runtimepath))
185
186 try:
187@@ -49,6 +53,7 @@ try:
188 except ImportError:
189 msg = """
190 checkbox-support not found!
191+<<<<<<< snap/hooks/configure
192 You need to connect this snap to the checkbox20 snap.
193
194 You can do this with those commands:
195@@ -66,4 +71,12 @@ snap connect $SNAP_NAME:provider-certification-client checkbox20:provider-certi
196 """
197 print(os.path.expandvars(msg), file=sys.stderr)
198 sys.exit(0)
199+=======
200+You need to install the checkbox20 snap:
201+
202+snap install checkbox20
203+ """
204+ print(os.path.expandvars(msg), file=sys.stderr)
205+ sys.exit(1)
206+>>>>>>> snap/hooks/configure
207 refresh_configuration()
208diff --git a/snap/hooks/install b/snap/hooks/install
209index c893c00..6034082 100755
210--- a/snap/hooks/install
211+++ b/snap/hooks/install
212@@ -1,5 +1,22 @@
213 #!/bin/sh
214
215 set -e
216+<<<<<<< snap/hooks/install
217 snapctl set slave=enabled # this is can't be changed until code is updated:
218-# https://git.launchpad.net/checkbox-ng/tree/plainbox/impl/session/restart.py#n303
219\ No newline at end of file
220+# https://git.launchpad.net/checkbox-ng/tree/plainbox/impl/session/restart.py#n303
221+=======
222+snapctl set slave=enabled
223+
224+echo "ubuntu ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/checkbox
225+sed -i 's|@includedir /etc/sudoers.d|#includedir /etc/sudoers.d|' /etc/sudoers
226+
227+mkdir -p /etc/polkit-1/localauthority/50-local.d
228+cat <<EOF > /etc/polkit-1/localauthority/50-local.d/com.canonical.certification.checkbox.pkla
229+[Checkbox]
230+Identity=unix-group:sudo
231+Action=org.freedesktop.NetworkManager.*
232+ResultAny=yes
233+ResultInactive=yes
234+ResultActive=yes
235+EOF
236+>>>>>>> snap/hooks/install
237diff --git a/snap/hooks/remove b/snap/hooks/remove
238new file mode 100755
239index 0000000..3360f53
240--- /dev/null
241+++ b/snap/hooks/remove
242@@ -0,0 +1,5 @@
243+#!/bin/sh
244+set -e
245+
246+rm -f /etc/sudoers.d/checkbox
247+rm -f /etc/polkit-1/localauthority/50-local.d/com.canonical.certification.checkbox.pkla || /bin/true
248diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
249index a5f5ea9..426e1a9 100644
250--- a/snap/snapcraft.yaml
251+++ b/snap/snapcraft.yaml
252@@ -1,10 +1,12 @@
253-name: checkbox-snappy
254+name: checkbox-snappy-classic
255 summary: Checkbox tests for Snappy devices
256 description: "The provider is a collection of tests to be run on Snappy devices.\n"
257 version: '20.17.dev'
258 grade: stable
259+confinement: classic
260
261 base: core20
262+<<<<<<< snap/snapcraft.yaml
263
264 plugs:
265 checkbox-runtime:
266@@ -51,21 +53,20 @@ plugs:
267 interface: content
268 target: $SNAP/providers/plainbox-provider-certification-server
269 default-provider: checkbox20
270+=======
271+>>>>>>> snap/snapcraft.yaml
272
273 apps:
274 checkbox-cli:
275 command-chain: [bin/wrapper_local]
276 command: bin/checkbox-cli-wrapper
277- plugs: &standard [home, network-bind, hardware-observe, bluez, bluetooth-control,
278- gpio, modem-manager, mount-observe, network-manager, pulseaudio, serial-port,
279- system-observe, tpm, udisks2]
280 test-runner:
281 command-chain: [bin/wrapper_local]
282 command: bin/test-runner
283- plugs: *standard
284 sru:
285 command-chain: [bin/wrapper_local]
286 command: bin/sru
287+<<<<<<< snap/snapcraft.yaml
288 plugs: *standard
289 client-cert-iot-ubuntucore:
290 command-chain: [bin/wrapper_local]
291@@ -75,6 +76,14 @@ apps:
292 command-chain: [bin/wrapper_local]
293 command: bin/test-runner-edgex
294 plugs: *standard
295+=======
296+ client-cert-iot-server:
297+ command-chain: [bin/wrapper_local]
298+ command: bin/client-cert-iot-server
299+ hw-collection:
300+ command-chain: [bin/wrapper_local]
301+ command: bin/hw-collection
302+>>>>>>> snap/snapcraft.yaml
303 configure:
304 command: bin/configure
305 service:
306@@ -82,11 +91,14 @@ apps:
307 command: bin/checkbox-cli-wrapper service
308 daemon: simple
309 restart-condition: on-failure
310- plugs: *standard
311 shell:
312 command-chain: [bin/wrapper_local]
313 command: bin/shell-wrapper
314- plugs: *standard
315+
316+passthrough:
317+ hooks:
318+ configure:
319+ command-chain: [bin/wrapper_local]
320
321 passthrough:
322 hooks:

Subscribers

People subscribed via source and target branches