diff options
Diffstat (limited to 'support/testing/tests/download/test_git.py')
-rw-r--r-- | support/testing/tests/download/test_git.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/support/testing/tests/download/test_git.py b/support/testing/tests/download/test_git.py index 156784dc9c..64b060ba30 100644 --- a/support/testing/tests/download/test_git.py +++ b/support/testing/tests/download/test_git.py @@ -33,6 +33,15 @@ class GitTestBase(infra.basetest.BRTest): "{}-source".format(package)], env) + def check_download(self, package): + # store downloaded tarball inside the output dir so the test infra + # cleans it up at the end + env = {"BR2_DL_DIR": os.path.join(self.builddir, "dl"), + "GITREMOTE_PORT_NUMBER": str(self.gitremote.port)} + self.b.build(["{}-dirclean".format(package), + "{}-legal-info".format(package)], + env) + class TestGitHash(GitTestBase): br2_external = [infra.filepath("tests/download/br2-external/git-hash")] @@ -42,3 +51,13 @@ class TestGitHash(GitTestBase): self.check_hash("bad") self.check_hash("good") self.check_hash("nohash") + + +class TestGitRefs(GitTestBase): + br2_external = [infra.filepath("tests/download/br2-external/git-refs")] + + def test_run(self): + with self.assertRaises(SystemError): + self.check_download("git-wrong-content") + with self.assertRaises(SystemError): + self.check_download("git-wrong-sha1") |