Commit Graph

15 Commits

Author SHA1 Message Date
Martin Jansa e8dfafda71 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: 3c694e20df3b1d442603300786580e4b2f4bf5f3)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-17 14:44:30 +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
Richard Purdie 12ebec4c94 bitbake: Add start of bitbake regression/self testing
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>
2012-05-04 16:58:35 +01:00