Merge ~alextu/plainbox-provider-pc-sanity:bats-in-jemmy into plainbox-provider-pc-sanity:master

Proposed by Alex Tu
Status: Merged
Approved by: Kai-Chuan Hsieh
Approved revision: ef3142a7c36d512444ca86016ce26081d6d8e4fa
Merged at revision: 6652f44e3d32d789ed5164424fc5018e535899e3
Proposed branch: ~alextu/plainbox-provider-pc-sanity:bats-in-jemmy
Merge into: plainbox-provider-pc-sanity:master
Diff against target: 243 lines (+110/-102)
2 files modified
bin/platform_meta_test (+1/-1)
test/platform_meta_test.bats (+109/-101)
Reviewer Review Type Date Requested Status
Kai-Chuan Hsieh Approve
OEM Solutions Group: Engineers Pending
Review via email: mp+418940@code.launchpad.net
To post a comment you must log in.
Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/platform_meta_test b/bin/platform_meta_test
2index deacc30..2d7818a 100755
3--- a/bin/platform_meta_test
4+++ b/bin/platform_meta_test
5@@ -111,7 +111,7 @@ check_somerville_meta() {
6 fi
7 done
8 ;;
9- ('focal')
10+ ('focal' | 'jammy')
11 for meta in $(ubuntu-drivers list | grep "^oem" | grep "meta$"); do
12 if apt-cache show "$meta" | grep ^Modaliases | grep -i "sv00001028sd0000$BIOSID" > /dev/null 2>&1; then
13 if dpkg-query -W -f='${Status}\n' "$meta" 2>&1 | grep "install ok installed" >/dev/null 2>&1; then
14diff --git a/test/platform_meta_test.bats b/test/platform_meta_test.bats
15index c9f9c61..1ae5e75 100644
16--- a/test/platform_meta_test.bats
17+++ b/test/platform_meta_test.bats
18@@ -12,116 +12,124 @@ function ubuntu-drivers() {
19 echo "$ubuntu_drivers_string"
20 }
21
22-@test "somerville in focal : Pass if meta package installed" {
23+function lsb_release() {
24+ echo "$ubuntu_codename"
25+}
26+
27+@test "somerville in focal/jammy : Pass if meta package installed" {
28 set -e
29- ubuntu_codename='focal'
30- BIOSID='08AF'
31- ubuntu_drivers_string="oem-somerville-beric-icl-meta"
32- function dpkg() {
33- echo "$dpkg_string"
34- }
35- function apt-cache() {
36- echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
37- }
38- function dpkg-query() {
39- opts="$@"
40- if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
41- echo "install ok installed"
42- elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
43- echo "install ok installed"
44- fi
45- }
46- dpkg_string="
47- ii oem-somerville-beric-icl-meta 20.04ubuntu3.1 all hardware support for Somerville beric-icl platform
48- ii oem-somerville-factory-beric-icl-meta 20.04ubuntu3.1 all hardware support for Somerville beric-icl platform
49- "
50- run check_somerville_meta
51- [ "$status" -eq 0 ]
52+ for ubuntu_codename in 'focal' 'jammy'; do
53+ BIOSID='08AF'
54+ ubuntu_drivers_string="oem-somerville-beric-icl-meta"
55+ function dpkg() {
56+ echo "$dpkg_string"
57+ }
58+ function apt-cache() {
59+ echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
60+ }
61+ function dpkg-query() {
62+ opts="$@"
63+ if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
64+ echo "install ok installed"
65+ elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
66+ echo "install ok installed"
67+ fi
68+ }
69+ dpkg_string="
70+ ii oem-somerville-beric-icl-meta 20.04ubuntu3.1 all hardware support for Somerville beric-icl platform
71+ ii oem-somerville-factory-beric-icl-meta 20.04ubuntu3.1 all hardware support for Somerville beric-icl platform
72+ "
73+ run check_somerville_meta
74+ [ "$status" -eq 0 ]
75+ done
76 }
77
78-@test "somerville in focal : Error if meta package in remove candidate state" {
79+@test "somerville in focal/jammy : Error if meta package in remove candidate state" {
80 set -e
81- ubuntu_codename='focal'
82- BIOSID='08AF'
83- ubuntu_drivers_string="oem-somerville-beric-icl-meta"
84- function dpkg() {
85- echo "$dpkg_string"
86- }
87- function apt-cache() {
88- echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
89- }
90- function dpkg-query() {
91- # the message when `dpkg-query -W -f='${Status}\n' "$package_in_rc_state"`
92- opts="$@"
93- if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
94- echo "deinstall ok config-files"
95- elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
96- echo "deinstall ok config-files"
97- fi
98- }
99- dpkg_string="
100- ii oem-somerville-beric-icl-meta 20.04ubuntu3.1 all hardware support for Somerville Bulbasaur platform
101- "
102- run check_somerville_meta
103- [ "$status" -eq 1 ]
104+ for ubuntu_codename in 'focal' 'jammy'; do
105+ BIOSID='08AF'
106+ ubuntu_drivers_string="oem-somerville-beric-icl-meta"
107+ function dpkg() {
108+ echo "$dpkg_string"
109+ }
110+ function apt-cache() {
111+ echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
112+ }
113+ function dpkg-query() {
114+ # the message when `dpkg-query -W -f='${Status}\n' "$package_in_rc_state"`
115+ opts="$@"
116+ if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
117+ echo "deinstall ok config-files"
118+ elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
119+ echo "deinstall ok config-files"
120+ fi
121+ }
122+ dpkg_string="
123+ ii oem-somerville-beric-icl-meta 20.04ubuntu3.1 all hardware support for Somerville Bulbasaur platform
124+ "
125+ run check_somerville_meta
126+ [ "$status" -eq 1 ]
127+ done
128 }
129
130 # For the case that meta package not installed.
131-@test "somerville in focal : Error if meta package Not installed" {
132+@test "somerville in focal/jammy : Error if meta package Not installed" {
133 set -e
134- ubuntu_codename='focal'
135- BIOSID='08AF'
136- ubuntu_driers_string="oem-somerville-beric-icl-meta"
137- function dpkg() {
138- echo "$dpkg_string"
139- }
140- function apt-cache() {
141- echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
142- }
143- function dpkg-query() {
144- opts="$@"
145- if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
146- # the message when `dpkg-query -W -f='${Status}\n' "$package_not_installed"`
147- echo "dpkg-query: no packages found matching "
148- elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
149- echo "dpkg-query: no packages found matching "
150- fi
151- }
152- dpkg_string="
153- ii oem-ouagadougou-meta 1.0~20.04ouagadougou4 all Meta package for the OEM mainstreams image.
154- ii oem-somerville-factory-meta 20.04ubuntu9 all hardware support for Somerville platform
155- ii oem-somerville-meta 20.04ubuntu9 all hardware support for Somerville platform
156- ii python3-importlib-metadata 1.5.0-1 all library to access the metadata for a Python package - Python 3.x
157- "
158- run check_somerville_meta
159- [ "$status" -eq 1 ]
160+ for ubuntu_codename in 'focal' 'jammy'; do
161+ BIOSID='08AF'
162+ ubuntu_drivers_string="oem-somerville-beric-icl-meta"
163+ function dpkg() {
164+ echo "$dpkg_string"
165+ }
166+ function apt-cache() {
167+ echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
168+ }
169+ function dpkg-query() {
170+ opts="$@"
171+ if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
172+ # the message when `dpkg-query -W -f='${Status}\n' "$package_not_installed"`
173+ echo "dpkg-query: no packages found matching "
174+ elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
175+ echo "dpkg-query: no packages found matching "
176+ fi
177+ }
178+ dpkg_string="
179+ ii oem-ouagadougou-meta 1.0~20.04ouagadougou4 all Meta package for the OEM mainstreams image.
180+ ii oem-somerville-factory-meta 20.04ubuntu9 all hardware support for Somerville platform
181+ ii oem-somerville-meta 20.04ubuntu9 all hardware support for Somerville platform
182+ ii python3-importlib-metadata 1.5.0-1 all library to access the metadata for a Python package - Python 3.x
183+ "
184+ run check_somerville_meta
185+ [ "$status" -eq 1 ]
186+ done
187 }
188
189-@test "somerville in focal : Error if factory meta package Not installed" {
190+@test "somerville in focal/jammy : Error if factory meta package Not installed" {
191 set -e
192- ubuntu_codename='focal'
193- BIOSID='08AF'
194- ubuntu_driers_string="oem-somerville-beric-icl-meta"
195- function dpkg() {
196- echo "$dpkg_string"
197- }
198- function apt-cache() {
199- echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
200- }
201- function dpkg-query() {
202- opts="$@"
203- if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
204- echo "install ok installed"
205- elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
206- echo "dpkg-query: no packages found matching "
207- fi
208- }
209- dpkg_string="
210- ii oem-ouagadougou-meta 1.0~20.04ouagadougou4 all Meta package for the OEM mainstreams image.
211- ii oem-somerville-factory-meta 20.04ubuntu9 all hardware support for Somerville platform
212- ii oem-somerville-meta 20.04ubuntu9 all hardware support for Somerville platform
213- ii python3-importlib-metadata 1.5.0-1 all library to access the metadata for a Python package - Python 3.x
214- "
215- run check_somerville_meta
216- [ "$status" -eq 1 ]
217+ for ubuntu_codename in 'focal' 'jammy'; do
218+ BIOSID='08AF'
219+ ubuntu_drivers_string="oem-somerville-beric-icl-meta"
220+ function dpkg() {
221+ echo "$dpkg_string"
222+ }
223+ function apt-cache() {
224+ echo "Modaliases: meta(pci:*sv00001028sd0000$BIOSID*)"
225+ }
226+ function dpkg-query() {
227+ opts="$@"
228+ if [ -z ${opts##*oem-somerville-beric-icl-meta*} ]; then
229+ echo "install ok installed"
230+ elif [ -z ${opts##*oem-somerville-factory-beric-icl-meta*} ];then
231+ echo "dpkg-query: no packages found matching "
232+ fi
233+ }
234+ dpkg_string="
235+ ii oem-ouagadougou-meta 1.0~20.04ouagadougou4 all Meta package for the OEM mainstreams image.
236+ ii oem-somerville-factory-meta 20.04ubuntu9 all hardware support for Somerville platform
237+ ii oem-somerville-meta 20.04ubuntu9 all hardware support for Somerville platform
238+ ii python3-importlib-metadata 1.5.0-1 all library to access the metadata for a Python package - Python 3.x
239+ "
240+ run check_somerville_meta
241+ [ "$status" -eq 1 ]
242+ done
243 }

Subscribers

People subscribed via source and target branches