diff options
| author | Stefan Koch <stefan-koch@siemens.com> | 2025-03-03 14:49:13 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-06 11:16:46 +0000 |
| commit | 543b1e6ffb3c7cef822f0782afe72623dc1bde02 (patch) | |
| tree | 15947e4fd709923d65b56d9b895e3990e8ed9a8a /bitbake/lib/bb/tests | |
| parent | db267f2c94ec86e4a7c046c49d3a2260760ccbfa (diff) | |
| download | poky-543b1e6ffb3c7cef822f0782afe72623dc1bde02.tar.gz | |
bitbake: tests/fetch: Add an additional test case to check whether the fast fetch is shallow
(Bitbake rev: 16f1961e077c525ccfc12496a3deca944df89fc6)
Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests')
| -rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 4a5af71061..c19180aaf5 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
| @@ -2302,6 +2302,18 @@ class GitShallowTest(FetcherTest): | |||
| 2302 | self.assertIn("No up to date source found", context.exception.msg) | 2302 | self.assertIn("No up to date source found", context.exception.msg) |
| 2303 | self.assertIn("clone directory not available or not up to date", context.exception.msg) | 2303 | self.assertIn("clone directory not available or not up to date", context.exception.msg) |
| 2304 | 2304 | ||
| 2305 | def test_shallow_check_is_shallow(self): | ||
| 2306 | self.add_empty_file('a') | ||
| 2307 | self.add_empty_file('b') | ||
| 2308 | |||
| 2309 | # Fetch and unpack without the clonedir and *only* shallow tarball available | ||
| 2310 | bb.utils.remove(self.gitdir, recurse=True) | ||
| 2311 | fetcher, ud = self.fetch_and_unpack() | ||
| 2312 | |||
| 2313 | # The unpacked tree *should* be shallow | ||
| 2314 | self.assertRevCount(1) | ||
| 2315 | assert os.path.exists(os.path.join(self.gitdir, '.git', 'shallow')) | ||
| 2316 | |||
| 2305 | class GitLfsTest(FetcherTest): | 2317 | class GitLfsTest(FetcherTest): |
| 2306 | def skipIfNoGitLFS(): | 2318 | def skipIfNoGitLFS(): |
| 2307 | import shutil | 2319 | import shutil |
