From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/ebuild/
Date: Sat, 19 Oct 2019 01:38:13 +0000 (UTC) [thread overview]
Message-ID: <1571448975.ab481a27e3a672ec762140f9d7cc6be883665a7b.zmedico@gentoo> (raw)
commit: ab481a27e3a672ec762140f9d7cc6be883665a7b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 19 01:32:45 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 19 01:36:15 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab481a27
testEbuildFetch: add mirror support
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/portage/tests/ebuild/test_fetch.py | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/lib/portage/tests/ebuild/test_fetch.py b/lib/portage/tests/ebuild/test_fetch.py
index ac45f8720..c0a76b701 100644
--- a/lib/portage/tests/ebuild/test_fetch.py
+++ b/lib/portage/tests/ebuild/test_fetch.py
@@ -29,6 +29,13 @@ class EbuildFetchTestCase(TestCase):
def testEbuildFetch(self):
+ user_config = {
+ "make.conf":
+ (
+ 'GENTOO_MIRRORS="{scheme}://{host}:{port}"',
+ ),
+ }
+
distfiles = {
'bar': b'bar\n',
'foo': b'foo\n',
@@ -37,7 +44,6 @@ class EbuildFetchTestCase(TestCase):
ebuilds = {
'dev-libs/A-1': {
'EAPI': '7',
- 'RESTRICT': 'primaryuri',
'SRC_URI': '''{scheme}://{host}:{port}/distfiles/bar.txt -> bar
{scheme}://{host}:{port}/distfiles/foo.txt -> foo''',
},
@@ -47,7 +53,13 @@ class EbuildFetchTestCase(TestCase):
scheme = 'http'
host = '127.0.0.1'
content = {}
+
+ content['/distfiles/layout.conf'] = b'[structure]\n0=flat\n'
+
for k, v in distfiles.items():
+ # mirror path
+ content['/distfiles/{}'.format(k)] = v
+ # upstream path
content['/distfiles/{}.txt'.format(k)] = v
with AsyncHTTPServer(host, content, loop) as server:
@@ -58,7 +70,16 @@ class EbuildFetchTestCase(TestCase):
scheme=scheme, host=host, port=server.server_port)
ebuilds_subst[cpv] = metadata
- playground = ResolverPlayground(ebuilds=ebuilds_subst, distfiles=distfiles)
+ user_config_subst = user_config.copy()
+ for configname, configdata in user_config.items():
+
+ configdata_sub = []
+ for line in configdata:
+ configdata_sub.append(line.format(
+ scheme=scheme, host=host, port=server.server_port))
+ user_config_subst[configname] = tuple(configdata_sub)
+
+ playground = ResolverPlayground(ebuilds=ebuilds_subst, distfiles=distfiles, user_config=user_config_subst)
ro_distdir = tempfile.mkdtemp()
eubin = os.path.join(playground.eprefix, "usr", "bin")
try:
next reply other threads:[~2019-10-19 1:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-19 1:38 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-10-19 5:29 [gentoo-commits] proj/portage:master commit in: lib/portage/tests/ebuild/ Zac Medico
2019-10-19 23:15 Zac Medico
2020-03-22 1:12 Zac Medico
2020-07-19 21:55 Zac Medico
2020-08-03 23:28 Zac Medico
2021-02-21 8:33 Zac Medico
2021-05-24 6:20 Zac Medico
2023-10-30 5:09 Zac Medico
2023-12-05 6:11 Zac Medico
2023-12-31 0:01 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1571448975.ab481a27e3a672ec762140f9d7cc6be883665a7b.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox