diff options
author | Ross Burton <ross.burton@intel.com> | 2018-06-21 17:15:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-27 13:55:21 +0100 |
commit | ea4318b78e9b784c3f688cd8474f92704231d613 (patch) | |
tree | 6309401fb930de096f0570948e193f7111d9f1ca /meta/lib/oeqa/selftest | |
parent | c568e89c3d316e5c10369c6ff48e871828bad783 (diff) | |
download | poky-ea4318b78e9b784c3f688cd8474f92704231d613.tar.gz |
oeqa: add Git mirror test
Add an automated test to exercise that fetching a git: recipe...
1) works over git without mirrors
2) fails without git connectivity or mirrors
3) works without git connectivity but with a mirror
(2) is done by setting GIT_PROXY_COMMAND to 'false' which should break any git
network operations.
[ YOCTO #12805 ]
(From OE-Core rev: 13269dfbbc62faef32595343dc78250fdb2a2946)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/fetch.py | 49 |
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 @@ | |||
1 | import oe.path | ||
2 | from oeqa.selftest.case import OESelftestTestCase | ||
3 | from oeqa.utils.commands import bitbake | ||
4 | from oeqa.core.decorator.oeid import OETestID | ||
5 | |||
6 | class 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 = """ | ||
21 | DL_DIR = "%s" | ||
22 | MIRRORS_forcevariable = "" | ||
23 | PREMIRRORS_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 = """ | ||
31 | DL_DIR = "%s" | ||
32 | GIT_PROXY_COMMAND = "false" | ||
33 | MIRRORS_forcevariable = "" | ||
34 | PREMIRRORS_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 = """ | ||
43 | DL_DIR = "%s" | ||
44 | GIT_PROXY_COMMAND = "false" | ||
45 | MIRRORS_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") | ||