diff options
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index fc94f4c02f..522d89de65 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -1108,6 +1108,25 @@ class FetcherNetworkTest(FetcherTest): | |||
1108 | self.assertTrue(os.path.exists(os.path.join(repo_path, 'bitbake-gitsm-test1', 'bitbake')), msg='submodule of submodule missing') | 1108 | self.assertTrue(os.path.exists(os.path.join(repo_path, 'bitbake-gitsm-test1', 'bitbake')), msg='submodule of submodule missing') |
1109 | 1109 | ||
1110 | @skipIfNoNetwork() | 1110 | @skipIfNoNetwork() |
1111 | def test_git_submodule_restricted_network_premirrors(self): | ||
1112 | # this test is to ensure that premirrors will be tried in restricted network | ||
1113 | # that is, BB_ALLOWED_NETWORKS does not contain the domain the url uses | ||
1114 | url = "gitsm://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=v1.60.x;rev=0ef13a7555dbaadd4633399242524129eef5e231" | ||
1115 | # create a download directory to be used as premirror later | ||
1116 | tempdir = tempfile.mkdtemp(prefix="bitbake-fetch-") | ||
1117 | dl_premirror = os.path.join(tempdir, "download-premirror") | ||
1118 | os.mkdir(dl_premirror) | ||
1119 | self.d.setVar("DL_DIR", dl_premirror) | ||
1120 | fetcher = bb.fetch.Fetch([url], self.d) | ||
1121 | fetcher.download() | ||
1122 | # now use the premirror in restricted network | ||
1123 | self.d.setVar("DL_DIR", self.dldir) | ||
1124 | self.d.setVar("PREMIRRORS", "gitsm://.*/.* gitsm://%s/git2/MIRRORNAME;protocol=file" % dl_premirror) | ||
1125 | self.d.setVar("BB_ALLOWED_NETWORKS", "*.some.domain") | ||
1126 | fetcher = bb.fetch.Fetch([url], self.d) | ||
1127 | fetcher.download() | ||
1128 | |||
1129 | @skipIfNoNetwork() | ||
1111 | def test_git_submodule_dbus_broker(self): | 1130 | def test_git_submodule_dbus_broker(self): |
1112 | # The following external repositories have show failures in fetch and unpack operations | 1131 | # The following external repositories have show failures in fetch and unpack operations |
1113 | # We want to avoid regressions! | 1132 | # We want to avoid regressions! |