summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-20 13:15:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-21 10:20:13 +0000
commit453eb5432d3341a304c1ff5b94de7e567d321aa3 (patch)
tree197a62288534ea36da4c03c281d5fca236617aab /bitbake/lib/bb/tests
parent721d3d6e0a55c767001a32e9fbc9a999f5fd1a66 (diff)
downloadpoky-453eb5432d3341a304c1ff5b94de7e567d321aa3.tar.gz
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>
Diffstat (limited to 'bitbake/lib/bb/tests')
-rw-r--r--bitbake/lib/bb/tests/fetch.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index e134a31f12..deb1d3733b 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -382,6 +382,21 @@ class FetcherNetworkTest(FetcherTest):
382 url1 = url2 = "git://git.openembedded.org/bitbake" 382 url1 = url2 = "git://git.openembedded.org/bitbake"
383 self.gitfetcher(url1, url2) 383 self.gitfetcher(url1, url2)
384 384
385 def test_gitfetch_goodsrcrev(self):
386 # SRCREV is set but matches rev= parameter
387 url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
388 self.gitfetcher(url1, url2)
389
390 def test_gitfetch_badsrcrev(self):
391 # SRCREV is set but does not match rev= parameter
392 url1 = url2 = "git://git.openembedded.org/bitbake;rev=dead05b0b4ba0959fe0624d2a4885d7b70426da5"
393 self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
394
395 def test_gitfetch_tagandrev(self):
396 # SRCREV is set but does not match rev= parameter
397 url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5;tag=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
398 self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
399
385 def test_gitfetch_premirror(self): 400 def test_gitfetch_premirror(self):
386 url1 = "git://git.openembedded.org/bitbake" 401 url1 = "git://git.openembedded.org/bitbake"
387 url2 = "git://someserver.org/bitbake" 402 url2 = "git://someserver.org/bitbake"