diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/package_manager.py | 12 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/runtime-test.py | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index d51609189d..b016bc32dc 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py @@ -533,10 +533,20 @@ class RpmPM(PackageManager): bb.utils.unlockfile(lf) def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs): + from urllib.parse import urlparse + if feed_uris == "": return - raise NotImplementedError("Adding remote dnf feeds not yet supported.") + bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d")) + remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split()) + for uri in remote_uris: + repo_name = "oe-remote-repo" + "-".join(urlparse(uri).path.split("/")) + if feed_archs is not None: + repo_uris = [uri + "/" + arch for arch in feed_archs] + else: + repo_uris = [uri] + open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_name + ".repo"), 'w').write("[%s]\nbaseurl=%s\n" % (repo_name, " ".join(repo_uris))) def _prepare_pkg_transaction(self): os.environ['D'] = self.target_rootfs diff --git a/meta/lib/oeqa/selftest/runtime-test.py b/meta/lib/oeqa/selftest/runtime-test.py index e8b483d7f8..171a37329f 100644 --- a/meta/lib/oeqa/selftest/runtime-test.py +++ b/meta/lib/oeqa/selftest/runtime-test.py @@ -108,14 +108,21 @@ class TestImage(oeSelfTest): Summary: Check install packages functionality for testimage/testexport. Expected: 1. Import tests from a directory other than meta. 2. Check install/uninstall of socat. + 3. Check that remote package feeds can be accessed Product: oe-core Author: Mariano Lopez <mariano.lopez@intel.com> + Author: Alexander Kanavin <alexander.kanavin@intel.com> """ if get_bb_var('DISTRO') == 'poky-tiny': self.skipTest('core-image-full-cmdline not buildable for poky-tiny') features = 'INHERIT += "testimage"\n' features += 'TEST_SUITES = "ping ssh selftest"\n' + # We don't yet know what the server ip and port will be - they will be patched + # in at the start of the on-image test + features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n' + features += 'EXTRA_IMAGE_FEATURES += "package-management"\n' + features += 'PACKAGE_CLASSES = "package_rpm"' self.write_config(features) # Build core-image-sato and testimage |