diff options
author | Ferry Toth <ftoth@exalondelft.nl> | 2022-04-13 22:37:41 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-19 14:14:11 +0100 |
commit | 4a3f3f2c3491fe4ef65557be7d298b8a5adb47a4 (patch) | |
tree | e8dd2855d4107f45ef74d470e2c03c43f9cb9d9f /meta/lib/oeqa/selftest/cases/runtime_test.py | |
parent | b550a21a6659adec8dc226baaaa0372e319b7eda (diff) | |
download | poky-4a3f3f2c3491fe4ef65557be7d298b8a5adb47a4.tar.gz |
apt: add apt selftest to test signed package feeds
Since Gatesgarth apt (1.8.2) has become more strict and doesn’t allow unsigned repositories by default.
Currently when building images this requirement is worked around by using [allow-insecure=yes] and
equivalently when performing selftest.
Patches "gpg-sign: Add parameters to gpg signature function" and "package_manager: sign DEB package feeds"
enable signed DEB package feeds. This patch adds a runtime test for apt derived from the test_testimage_dnf
test. It creates a signed deb package feed, runs a qemu image to install the key and performs some package
management. To be able to install the key the gnupg package is added to the testimage.
(From OE-Core rev: 3ec30490d09d6639eea2638cf12a323948f221cc)
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/runtime_test.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/runtime_test.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 2ad89490fc..3ece617cb0 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py | |||
@@ -162,6 +162,44 @@ class TestImage(OESelftestTestCase): | |||
162 | bitbake('core-image-full-cmdline socat') | 162 | bitbake('core-image-full-cmdline socat') |
163 | bitbake('-c testimage core-image-full-cmdline') | 163 | bitbake('-c testimage core-image-full-cmdline') |
164 | 164 | ||
165 | def test_testimage_apt(self): | ||
166 | """ | ||
167 | Summary: Check package feeds functionality for apt | ||
168 | Expected: 1. Check that remote package feeds can be accessed | ||
169 | Product: oe-core | ||
170 | Author: Ferry Toth <fntoth@gmail.com> | ||
171 | """ | ||
172 | if get_bb_var('DISTRO') == 'poky-tiny': | ||
173 | self.skipTest('core-image-full-cmdline not buildable for poky-tiny') | ||
174 | |||
175 | features = 'INHERIT += "testimage"\n' | ||
176 | features += 'TEST_SUITES = "ping ssh apt.AptRepoTest.test_apt_install_from_repo"\n' | ||
177 | # We don't yet know what the server ip and port will be - they will be patched | ||
178 | # in at the start of the on-image test | ||
179 | features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n' | ||
180 | features += 'EXTRA_IMAGE_FEATURES += "package-management"\n' | ||
181 | features += 'PACKAGE_CLASSES = "package_deb"\n' | ||
182 | # We need gnupg on the target to install keys | ||
183 | features += 'IMAGE_INSTALL:append:pn-core-image-full-cmdline = " gnupg"\n' | ||
184 | |||
185 | bitbake('gnupg-native -c addto_recipe_sysroot') | ||
186 | |||
187 | # Enable package feed signing | ||
188 | self.gpg_home = tempfile.mkdtemp(prefix="oeqa-feed-sign-") | ||
189 | self.track_for_cleanup(self.gpg_home) | ||
190 | signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing') | ||
191 | runCmd('gpgconf --list-dirs --homedir %s; gpg -v --batch --homedir %s --import %s' % (self.gpg_home, self.gpg_home, os.path.join(signing_key_dir, 'key.secret')), native_sysroot=get_bb_var("RECIPE_SYSROOT_NATIVE", "gnupg-native"), shell=True) | ||
192 | features += 'INHERIT += "sign_package_feed"\n' | ||
193 | features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n' | ||
194 | features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase') | ||
195 | features += 'GPG_PATH = "%s"\n' % self.gpg_home | ||
196 | features += 'PSEUDO_IGNORE_PATHS .= ",%s"\n' % self.gpg_home | ||
197 | self.write_config(features) | ||
198 | |||
199 | # Build core-image-sato and testimage | ||
200 | bitbake('core-image-full-cmdline socat') | ||
201 | bitbake('-c testimage core-image-full-cmdline') | ||
202 | |||
165 | def test_testimage_virgl_gtk_sdl(self): | 203 | def test_testimage_virgl_gtk_sdl(self): |
166 | """ | 204 | """ |
167 | Summary: Check host-assisted accelerate OpenGL functionality in qemu with gtk and SDL frontends | 205 | Summary: Check host-assisted accelerate OpenGL functionality in qemu with gtk and SDL frontends |