Commit Graph

51 Commits

Author SHA1 Message Date
Ross Burton 9351217eb7 bitbake: tests/fetch: handle network failures gracefully
If there is a network failure the return value from latest_versionstring() is
('','') which later causes an exception when comparing versions.

Improve this by checking the return value and failing the test early.

[ YOCTO #12053 ]

(Bitbake rev: 4284d918dc7451f6a4d00be065369e86bbaec4d2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:37:29 +00:00
Ross Burton 37d5307db0 bitbake: fetch2: handle absolute paths in subdir
Currently if you use the subdir parameter in a SRC_URI and pass an absolute path
then it gets appended to the unpack directory instead of being used directly.
This is inconvenient as it may be useful to use ${S} when you want to unpack a
file into the source tree.

Change this behaviour so that absolute paths are used directly instead of being
appended to the root directory.  To ensure that recipes cannot write files to an
arbitrary location enforce that the subdir starts with the unpack root.

(Bitbake rev: c3873346c6fa1021a1d63bddd9b898a77c618432)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:18:11 +01:00
Markus Lehtonen 0b409117c9 bitbake: tests: add unit tests for the usehead url parameter
[YOCTO #9351]

(Bitbake rev: 63031c0236ace10a9d52b9db9bbb892c1b4bf7db)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Markus Lehtonen 9cce855f47 bitbake: bitbake-selftest: introduce BB_TMPDIR_NOCLEAN
Set this env variable to 'yes' to preserve temporary directories used by
the fetcher tests. Useful for debugging tests.

(Bitbake rev: 04132b261df9def3a0cff14c93c29b26ff906e8b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20 16:08:59 +01:00
Ross Burton 407ba77fe2 bitbake: lib/bb/tests/fetch: remove URL that doesn't exist anymore
The CUPS ipptool URL we were checking now redirects to github where the tarball
isn't present, so remove it from the test suite.

(Bitbake rev: 4b50895fb3462b21e3874a2e99c363c8d05e89e6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17 10:22:58 +01:00
Richard Purdie ca824a976a bitbake: fetch: Use OrderedDict for url parameters
Without this, the dict can reorder causing sanity test failures.

(Bitbake rev: ca8c91acc9396385834b266d4e8b84d917e5e298)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Richard Purdie fce8da957f bitbake: daemonize/prserv/tests/fetch: Convert file() -> open()
Use python3 compatible functions.

(Bitbake rev: e6a0296ba29c3fbc8417d1df7a01d50562668a41)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:32 +01:00
Olof Johansson 2c722e227f bitbake: tests/fetch.py: Improve unit tests for trusted network check
The tests were skipped when running without network even though they
didn't require network. This commit also adds a test case for URLs with
ports in them (the ports should not be considered when doing trusted
network checks).

(Bitbake rev: 77747de6b20538063eef3b188489a35bef225359)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:53:44 +01:00
Richard Purdie 8037ba4d86 bitbake: bb/tests/fetch: Update cups url
Update the upstream url used for testing cups versions after upstream website
changes.

(Bitbake rev: 5f06041d4936fc22297945bbbad7020bfa9083c6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-21 12:43:12 +00:00
Alexander Shashkevich 865d2feff6 bitbake: fetch2: fixes copying of file://dir; subdir=foo, bug 6128 and bug 6129
When in SRC_URI appears file://dir;subdir=foo unpacker copies 'dir' to ${WORKDIR}, not
${WORKDIR}/foo as it should be.

These changes are fixing following bugs as well:
Bug 6128 - Incorrect wildcard unpack behaviour in fetcher
Bug 6129 - Local directories unpack to a different location than local files

(Bitbake rev: e659a3b0c2771679057ee3e13cd42e6c62383ff2)

Signed-off-by: Alexander Shashkevich <alex@stunpix.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 22:41:22 +00:00
Richard Purdie ab7b7bf94d bitbake: fetch2/__init__: Fix decodeurl to better handle urls without paths
If we specify urls such as npm://somehost;someparams the fetcher currently
does a poor job of handling mirrors of these urls due to deficiencies in the
way decodeurl works. This is because "somehost" is returned as a path, not
a host.

This tweaks the code so that unless its a file url, the host is returned
correctly.

This patch also adds test cases for these urls to the exist set of test
urls.

We need to tweak the URI() class since this thinks this is a relative url
which is clearly isn't. We also need to handle the fact that encodeurl will
error if passed a url of this form (it would want the path to be '/'.

(Bitbake rev: 83203cd2e677706e0111892a7843b83263cb8bd9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:34:38 +00:00
Ross Burton 9f22898e0f bitbake: fetch2/wget: fallback to GET if HEAD is rejected in checkstatus()
The core change here is to fall back to GET requests if HEAD is rejected in the
checkstatus() method, as you can't do a HEAD on Amazon S3 (used by Github
archives).  This meant removing the monkey patch that the default method was GET
and adding a fixed redirect handler that doesn't reset to GET.

Also, change the way the opener is constructed from an if/elif cluster to a
conditionally constructed list.

(Bitbake rev: 6ec70d5d2e330b41b932b0a655b838a5f37df01e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26 22:34:45 +00:00
Alexander Kanavin 3745479596 bitbake: bitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.
Rename REGEX to UPSTREAM_CHECK_REGEX, REGEX_URI to UPSTREAM_CHECK_URI, and
GITTAGREGEX to UPSTREAM_CHECK_GITTAGREGEX to better reflect their purpose
and to reflect a common namespace.

(Bitbake rev: f0a9e783f9969573fd74edfa241ef14f18ac684e)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-08 10:20:31 +00:00
Mark Hatle 2bb600a579 bitbake: tests/fetch.py: Fix recursion failure in url mapping
Instead of reproducessing the same line over and over and over, we remove the
current line from the mirror list.  This permits us to re-evaluate the list
while excluding all matches that have previousily occured.

Without this fix, adding this test results in a failure:

RuntimeError: maximum recursion depth exceeded in cmp

(Bitbake rev: 24a8e9a5b0ba145ae589178d74365c986ebca325)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:34 +01:00
Mark Hatle 4c3d4eceb1 bitbake: fetch2/__init__.py: uri_replace regex handling
We should only substitute one time.  If we do it without a max count, we can
end up matching over and over.

Before this change:

https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz

with a mirror of

https://.*/[^/]*    http://AAAA/A/A/A/

would end up either recursing indefinitely or result in:

http://AAAA/A/A/A/A/A/A/A/A/A/bitbake-1.0.tar.gz

(Bitbake rev: 4d254e02e2867dd9a6663508c8ca9f2733af71a8)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:34 +01:00
Aníbal Limón 205c39bf78 bitbake: tests/fetch.py: Updated test name FetchMethodTest -> FetchLatestVersionTest
Change the test name to be more specific on what is tested.

(Bitbake rev: 3e39156bc330c4c726058a5b9c13d33e2daad89f)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22 08:23:50 +01:00
Aníbal Limón 22d2f7b1ca bitbake: fetch2/wget.py: latest_versionstring now returns (version, revision)
Now latest_versionstring method returns (version, revision) for comply
the new return convention needed by SCM's like git get the current
revision.

bb/tests/fetch.py: Updated wget latest_versionstring test for comply new
convention.

[YOCTO #7605]

(Bitbake rev: 8d454646cbe1b04758ca178d8c6fcfd02b818b7b)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22 08:23:50 +01:00
Aníbal Limón bd5167d154 bitbake: fetch2/git.py: latest_versionstring now returns (version, revision)
We need to know the revision associated with the upstream version in
SCM like git, this change broke return convention, oe-core recipeutils
get_recipe_upstream_version need to be updated.

tests/fetch.py: Updated git latest_versionstring test for comply new
convention.

[YOCTO #7605]

(Bitbake rev: fd175dc90024c503134c11cbd83e77d88c406ac8)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22 08:23:49 +01:00
Aníbal Limón 73b9cd9764 bitbake: tests/fetch.py: FetchCheckStatusTest add cases for ftp and https.
(Bitbake rev: 36f2577d075f87090766877473f9030e44a941a2)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:50:43 +01:00
Aníbal Limón 913631c466 bitbake: tests/fetch.py: Add FetchCheckStatusTest tests.
Add tests for checkstatus method using http with/without
connection cache.

[YOCTO #7796]

(Bitbake rev: b1f2d3edefb7dd274174eb983666213b0f49c994)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:50:42 +01:00
Richard Purdie 71626c1b94 bitbake: tests/fetch: Add mirror of mirror tests
Add some tests of mirrors or mirrors to the fetcher unittests.

(Bitbake rev: e33d82bc10283d533f928836d56a6f0af80ea5c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00
Paul Eggleton c5316d4d57 bitbake: tests/fetch: ensure fetch tests preserve current dir
The fetcher calls os.chdir() in a number of places, which can affect
other tests (since the directory it changes into gets deleted) - let's
just put the current directory back to where it was when we're done.

(This fixes bb.tests.Path.test_unsafe_delete_path failing if it was run
as part of a full bitbake-selftest run, where the fetcher tests get to
run before it.)

(Bitbake rev: b1653855c74f86909c9f329ed6d2b10391c28395)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-15 17:45:00 +01:00
Liam R. Howlett 59ce7d02a5 bitbake: fetch2: Add BB_ALLOWED_NETWORKS support
BB_ALLOWED_NETWORKS is a list of hosts that the fetcher will be allowed
to use when BB_NO_NETWORK is not set.

If BB_NO_NETWORK is set, then networking is still disabled.

If BB_ALLOWED_NETWORKS is not set, the behaviour remains the same as
today.

If BB_NO_NETWORK is NOT set, and BB_ALLOWED_NETWORKS is configured, then
only the hosts in the list are usable by the fetcher.

eg:
BB_ALLOWED_NETWORKS="yoctoproject.org git.gnu.org"
The fetcher will be able to download from yoctoproject.org, git.gnu.org,
but not ftp.gnu.org or any other hostname that is not in the list.

There is also limited support for wildcards on the beginning of the
hosts, so BB_ALLOWED_NETWORKS="*.gnu.org" with match git.gnu.org and
ftp.gnu.org as well as foo.git.gnu.org

(Bitbake rev: c7263096ba31ba45daeeb9de90c1cb9ebef24a28)

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-12 12:17:13 +01:00
Aníbal Limón 6ae933b75c bitbake: tests/fetch.py: latest_versionstring add set of PN
Add set of PN in data because now latest_versionstring use it for
validate version directory searching.

(Bitbake rev: 2e4a03db967ac1459b2764108fc54c4566a7e371)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-16 09:13:06 +00:00
Richard Purdie 4d06fb7307 bitbake: tests/fetch: Add versionstring tests to network tests list, fix print()
The versionstring tests hit the network so should only run when
network tests are enabled.

Also remove the print statement which confuses the test output and
add it to the test failure message instead.

(Bitbake rev: 6c046660cfc4fb3792a42aeafff91a13f68a2e89)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-25 08:18:14 +00:00
Aníbal Limón 0ce833dfa2 bitbake: tests/fetch: Update wget latest_versionstring cups case
Update test case for cups is needed because match only 2.0.0
versions see VERSION=2\.0\.0 in the previous string.

(Bitbake rev: 148aba30155f4de17f6c6fb9b4c37f08a2db202b)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-28 14:03:02 +00:00
Aníbal Limón 6bb241a278 bitbake: fetch/wget: Add latest_versionstring method
Being able to query whether updated versions of a url are available
is useful, not least for the package reporting system. Since such code
is closely linked to the url type and the url itself, the fetcher
makes a locical place to contain this code.

For wget based urls this means taking upstream directory listings
and searching those for later versions, returning those that are
found.

The patch also adds unittests for this function so that if
improvements are made, the original test urls can be used
to evaulate the those changes.

This is based on code from Irina Patru <irina.patru@intel.com>.

(Bitbake rev: a8272e22b7819e0e8afd8e291d276f5f28fc0007)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-12 15:25:17 +00:00
Aníbal Limón 7587877e5d bitbake: fetch/git: Add latest_versionstring method
Being able to generate a version string representing the most recent git commit
given git is useful, not least for the package reporting system.

This adds in a latest_versionstring method to the git fetcher
which allows users to query the latest version using ls-remote
and filtering the responses.

The patch also adds unittests for this function so that if
improvements are made, the original test urls can be used
to evaulate the those changes.

This is based on code from Irina Patru <irina.patru@intel.com>.

(Bitbake rev: f71c8c0354e87fed80bc845db6728e6e18ce9c4d)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-12 15:25:17 +00:00
Richard Purdie 8e4e03c2a3 bitbake: fetch: Extend testing of subdir unpack parameter and fix
This fixes urls of the form file://some/path/file;subdir=b. It also
adds in a couple of tests so we now tests these corner cases.

(Bitbake rev: 46306912a96444790efa9418d934dfdd36773ba1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-29 12:08:48 +01:00
Paul Eggleton 70288db2e9 bitbake: bitbake-selftest: add tests for local fetching
Add some explicit tests for unpacking local files to the appropriate
location. Some of these tests are actually testing for broken behaviour;
these have been called out in the comments, and associated bugs have
been filed.

(Bitbake rev: ca921c773c52392a5a338b2f493ad38c8132f708)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-09 14:31:14 +01:00
Olof Johansson 7dd4bf6310 bitbake: fetch2.URI: Set username/password should not change the other
When setting the username after already having set the password, the password
was unexpectedly reset. This change fixes this issue and introduces unit tests
to make sure it doesn't happen again.

(Bitbake rev: 25faef3a047f9c7564089463d7c96f6910b640cb)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-24 17:54:46 +00:00
Olof Johansson 57484d68df bitbake: fetch2.URI: Support URIs with both query strings and params
There is a case in meta-intel where a SRC_URI contains both a query string and
URI parameter:

 https://edc.intel.com/Download.aspx?id=6190;downloadfilename=LIN_IEMGD_1_14_GOLD_2443.tgz

Python's urlparse thought the URI parameters were part of the query parameter
value, but in the bitbake context this is obviously not the case. As bitbake's
usage isn't really RFC compliant, we have to extract and remove the URI parameters
*before* urlparse sees the URI.

(Bitbake rev: c2f27ae4271985b48f957747b6ea372c8699cb49)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-24 17:54:46 +00:00
Olof Johansson aca2d14e93 bitbake: fetch2.URI: add support for query parameters
This change introduces the .query property of the URI class. It is a
read/write dict of the parameters supplied in the query string of the
URI. E.g.:

  http://example.com/?foo=bar => .query = {'foo': 'bar'}

(Bitbake rev: 1cb2b3c458c8c5521591d2c8f2e0058143fc77bb)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-24 17:54:46 +00:00
Olof Johansson 64fdd3abbb bitbake: tests.fetch: Remove debug assert
(Bitbake rev: f112660bca0ed8be061055b1e388deeb2d1980a7)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-24 17:54:46 +00:00
Paul Eggleton c2895edcdd bitbake: tests: add test for gitsm fetcher
Use a newly created "git-submodule-test" repo on git.yoctoproject.org
which currently contains one submodule (the bitbake repository).

(Bitbake rev: a750c57242928c546a5aace632543e956ee908eb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-28 14:50:43 +00:00
Richard Purdie 453eb5432d bitbake: fetch2: Sanity check SRCREV matches rev/tag parameter
Add a sanity check so that if some SRCREV is set and a rev parameter is given
to the url, the revision given should match.

Any tag parameter behaves the same as rev. If both are specified, error to
tell the user we're confused rather than do something which may or may not
be what they intended.

Also add some unittests for this.

(Bitbake rev: e82a4ab48991035866da9914c8b75a9bfbc9a7fc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-21 10:20:13 +00:00
Martin Jansa a99fa6ded1 bitbake: fetch2: Don't allow '/' in user:pass, fix branch containing '@'
* currently decode_url regexp parses branch=@foo as username so it ends like this:
  - ('git', '', 'foo', 'git.openembedded.org/bitbake;branch=', '', {})
  + ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'})
* http://hg.python.org/cpython/file/2.7/Lib/urlparse.py also assumes
  that there is at least one '/' as separator between netloc and path,
  params, so it looks reasonable to prevent including '/' in username

(Bitbake rev: 2c82742114091cb55055328b54223686816582f2)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-18 23:29:07 +00:00
Richard Purdie 350c36fcd9 bitbake: test/fetch: Allow the conditional network tests to work under python 2.6
The skipIf decorator is unavailable under python 2.6 and finding a syntax
works there is hard. This patch does allow network tests under 2.6.

(Bitbake rev: 565b3e31e0226c6e193ee0b031bd5e7bef25591e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Richard Purdie c8ab3b0810 bitbake: test/fetch: Split the network tests from the rest of the fetcher tests
(Bitbake rev: f32265bcc6b4fe5566aca16f6b05555ec6a96d01)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Richard Purdie 0a52bdfb9a bitbake: tests/fetch: Allow to work on python 2.6
Currently the fetch tests fail on python 2.6 since check_output
doesn't exist on this version of python. Use bb.process instead
to avoid this problem.

(Bitbake rev: a3637155e829e06bbfe50fb8753de3de7ee8c22e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-17 12:42:08 +03:00
Olof Johansson 911dbbd8ee bitbake: bb.tests.fetch: Opt-out for unittests that require network
With this change, you can opt-out to skip unit tests that require an
internet connection. To opt-out, you'll set the environment variable
BB_SKIP_NETTESTS to 'yes'.

(Bitbake rev: 9ff5f172096a4f51b6b085307506473405dc4f59)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29 10:45:17 +00:00
Olof Johansson 96f0a39e7c bitbake: fetch2: Add editor modelines for bb.tests.*
(Bitbake rev: 230e00948ba093958e8e89e9ee380444b3dad307)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17 22:32:05 +00:00
Olof Johansson f860059a4c bitbake: fetch2: unittests for bb.fetch2.URI class
(Bitbake rev: a71e7d4137d2c5268b406f69992d09c00772a040)

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-17 22:32:05 +00:00
Richard Purdie c525c131a6 bitbake: test/fetch: Switch the comparision order to make test failures slightly clearer
(Bitbake rev: 2b1311e21172847b6a86cfb21a84fd00e4ab1ac5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie b13951f96d bitbake: test/fetch: Ensure cwd is valud for the git clone
(Bitbake rev: 60b1a9f52dfec98e55a879a637f7142b0175b452)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie 9334b0d002 bitbake: fetch2: Add new mirror syntax to simplify mirror specifications
When writing mirror specifications, the current regexp syntax can be awkward
and hard to get it to do what you want. For example, extracting the 'basename'
of a repository:

PREMIRRORS = "git://.*/([^/]+/)*([^/]*) git://somewhere.org/somedir/\\2;protocol=file"

can now become:

PREMIRRORS = "git://.*/.* git://somewhere.org/somedir/BASENAME;protocol=file"

which is much clearer. A MIRRORNAME substitution is also added which contains
an encoded form of both host and path. One of the problems with the existing
regexp syntax is you couldn't access HOST information from PATH and vice-versa
which is an issue this patch also addresses.

Tests for the new syntax are also added.

(Bitbake rev: c6b1acbad7b3d2698530eb8b5249adb4ab95da21)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-25 14:57:16 +01:00
Richard Purdie dd249ebe67 bitbake: test/fetch: Add a couple of extra test cases
(From Poky rev: 01d8220ef8580ca980a14c05d500765ca2d37e2c)

(Bitbake rev: 0d0a12fa0e4dabf01c1c24370aff54d26690a6dc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:10:34 +01:00
Richard Purdie ad8d1d3a15 bitbake: test/fetch: Add in unit tests for uri_replace() and git premirrors
(From Poky rev: 4be81b5cadb7813d37152411c23764501f5869d3)

(Bitbake rev: f91b4c2e3a2b3029d653a18de7ae2b0ecd7e2536)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:10:34 +01:00
Richard Purdie 09b231deb1 bitbake/tests: Add test of the git fetcher
(Bitbake rev: 4dd2655caef1003b51c0600397a91f1c9526a67f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-13 20:09:53 +01:00
Richard Purdie b478649e49 bitbake/tests/fetch: Add simple http fetcher tests
(Bitbake rev: 27b89561781f19fd95308433bec06fa8b7b354e8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-07 11:03:00 +01:00