summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/fetch.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/fetch.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/fetch.py b/meta/lib/oeqa/selftest/cases/fetch.py
new file mode 100644
index 0000000000..4acc8cdcc8
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/fetch.py
@@ -0,0 +1,49 @@
1import oe.path
2from oeqa.selftest.case import OESelftestTestCase
3from oeqa.utils.commands import bitbake
4from oeqa.core.decorator.oeid import OETestID
5
6class Fetch(OESelftestTestCase):
7 @OETestID(1058)
8 def test_git_mirrors(self):
9 """
10 Verify that the git fetcher will fall back to the HTTP mirrors. The
11 recipe needs to be one that we have on the Yocto Project source mirror
12 and is hosted in git.
13 """
14
15 # TODO: mktempd instead of hardcoding
16 dldir = os.path.join(self.builddir, "download-git-mirrors")
17 self.track_for_cleanup(dldir)
18
19 # No mirrors, should use git to fetch successfully
20 features = """
21DL_DIR = "%s"
22MIRRORS_forcevariable = ""
23PREMIRRORS_forcevariable = ""
24""" % dldir
25 self.write_config(features)
26 oe.path.remove(dldir, recurse=True)
27 bitbake("dbus-wait -c fetch -f")
28
29 # No mirrors and broken git, should fail
30 features = """
31DL_DIR = "%s"
32GIT_PROXY_COMMAND = "false"
33MIRRORS_forcevariable = ""
34PREMIRRORS_forcevariable = ""
35""" % dldir
36 self.write_config(features)
37 oe.path.remove(dldir, recurse=True)
38 with self.assertRaises(AssertionError):
39 bitbake("dbus-wait -c fetch -f")
40
41 # Broken git but a specific mirror
42 features = """
43DL_DIR = "%s"
44GIT_PROXY_COMMAND = "false"
45MIRRORS_forcevariable = "git://.*/.* http://downloads.yoctoproject.org/mirror/sources/"
46""" % dldir
47 self.write_config(features)
48 oe.path.remove(dldir, recurse=True)
49 bitbake("dbus-wait -c fetch -f")