summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: tests/fetch: ensure fetch tests preserve current dirPaul Eggleton2016-05-091-0/+2
| | | | | | | | | | | | | | | 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: fdb6c123593fd2255b9b09e6bdf7306d64a82892) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb/tests/fetch: Update cups urlRichard Purdie2016-05-091-2/+2
| | | | | | | | | Update the upstream url used for testing cups versions after upstream website changes. (Bitbake rev: 27ae1b39c400cf7edbd6902ff050a39147d64217) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch.py: latest_versionstring add set of PNAníbal Limón2015-02-161-0/+2
| | | | | | | | | | 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>
* bitbake: tests/fetch: Add versionstring tests to network tests list, fix print()Richard Purdie2014-12-251-20/+20
| | | | | | | | | | | | 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>
* bitbake: tests/fetch: Update wget latest_versionstring cups caseAníbal Limón2014-11-281-1/+1
| | | | | | | | | | 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>
* bitbake: fetch/wget: Add latest_versionstring methodAníbal Limón2014-11-121-0/+35
| | | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: fetch/git: Add latest_versionstring methodAníbal Limón2014-11-121-1/+43
| | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: fetch: Extend testing of subdir unpack parameter and fixRichard Purdie2014-09-291-0/+7
| | | | | | | | | 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>
* bitbake: bitbake-selftest: add tests for local fetchingPaul Eggleton2014-04-091-0/+55
| | | | | | | | | | | | 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>
* bitbake: fetch2.URI: Set username/password should not change the otherOlof Johansson2014-03-241-0/+14
| | | | | | | | | | | 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>
* bitbake: fetch2.URI: Support URIs with both query strings and paramsOlof Johansson2014-03-241-0/+18
| | | | | | | | | | | | | | | | | 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>
* bitbake: fetch2.URI: add support for query parametersOlof Johansson2014-03-241-0/+30
| | | | | | | | | | | | | 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>
* bitbake: tests.fetch: Remove debug assertOlof Johansson2014-03-241-2/+0
| | | | | | | (Bitbake rev: f112660bca0ed8be061055b1e388deeb2d1980a7) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests: add test for gitsm fetcherPaul Eggleton2014-02-281-0/+7
| | | | | | | | | | 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>
* bitbake: fetch2: Sanity check SRCREV matches rev/tag parameterRichard Purdie2014-01-211-0/+15
| | | | | | | | | | | | | | | 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>
* bitbake: fetch2: Don't allow '/' in user:pass, fix branch containing '@'Martin Jansa2014-01-181-1/+2
| | | | | | | | | | | | | | * 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>
* bitbake: test/fetch: Allow the conditional network tests to work under ↵Richard Purdie2013-05-171-96/+86
| | | | | | | | | | | 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>
* bitbake: test/fetch: Split the network tests from the rest of the fetcher testsRichard Purdie2013-05-171-23/+24
| | | | | | (Bitbake rev: f32265bcc6b4fe5566aca16f6b05555ec6a96d01) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Allow to work on python 2.6Richard Purdie2013-05-171-2/+2
| | | | | | | | | | 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>
* bitbake: bb.tests.fetch: Opt-out for unittests that require networkOlof Johansson2013-03-291-0/+14
| | | | | | | | | | | 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>
* bitbake: fetch2: Add editor modelines for bb.tests.*Olof Johansson2013-02-171-0/+2
| | | | | | | (Bitbake rev: 230e00948ba093958e8e89e9ee380444b3dad307) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: unittests for bb.fetch2.URI classOlof Johansson2013-02-171-0/+226
| | | | | | | (Bitbake rev: a71e7d4137d2c5268b406f69992d09c00772a040) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: test/fetch: Switch the comparision order to make test failures ↵Richard Purdie2012-06-281-1/+1
| | | | | | | | slightly clearer (Bitbake rev: 2b1311e21172847b6a86cfb21a84fd00e4ab1ac5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: test/fetch: Ensure cwd is valud for the git cloneRichard Purdie2012-06-281-0/+1
| | | | | | (Bitbake rev: 60b1a9f52dfec98e55a879a637f7142b0175b452) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Add new mirror syntax to simplify mirror specificationsRichard Purdie2012-06-251-3/+11
| | | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: test/fetch: Add a couple of extra test casesRichard Purdie2012-06-211-1/+29
| | | | | | | | (From Poky rev: 01d8220ef8580ca980a14c05d500765ca2d37e2c) (Bitbake rev: 0d0a12fa0e4dabf01c1c24370aff54d26690a6dc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: test/fetch: Add in unit tests for uri_replace() and git premirrorsRichard Purdie2012-06-211-3/+52
| | | | | | | | (From Poky rev: 4be81b5cadb7813d37152411c23764501f5869d3) (Bitbake rev: f91b4c2e3a2b3029d653a18de7ae2b0ecd7e2536) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/tests: Add test of the git fetcherRichard Purdie2012-05-131-0/+21
| | | | | | (Bitbake rev: 4dd2655caef1003b51c0600397a91f1c9526a67f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/tests/fetch: Add simple http fetcher testsRichard Purdie2012-05-071-0/+42
| | | | | | (Bitbake rev: 27b89561781f19fd95308433bec06fa8b7b354e8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Add start of bitbake regression/self testingRichard Purdie2012-05-041-0/+42
This adds some basic unit testing for the codeparser and data store code. Many of the actual test cases were taken from work by Chris Larson's OE-Signatures work but with changes to adapt to the current bitbake APIs we need to test. I also imported CoW tests written by Holger Freyther from the original bitbake-test codebase: http://svn.berlios.de/wsvn/bitbake/trunk/bitbake-tests/tests/ and some tests from the doctests that were removed in commit: http://git.openembedded.org/bitbake/commit?id=3a11c2807972bbbddffde2fa67fc380d159da467 (Bitbake rev: ae4a95780e3e08cf73c854efa8cd93379e00c4e5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>