diff --git a/support/testing/tests/download/br2-external/github/Config.in b/support/testing/tests/download/br2-external/github/Config.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/support/testing/tests/download/br2-external/github/external.desc b/support/testing/tests/download/br2-external/github/external.desc new file mode 100644 index 0000000000..b8beea8839 --- /dev/null +++ b/support/testing/tests/download/br2-external/github/external.desc @@ -0,0 +1 @@ +name: GITHUB diff --git a/support/testing/tests/download/br2-external/github/external.mk b/support/testing/tests/download/br2-external/github/external.mk new file mode 100644 index 0000000000..e4e5524ceb --- /dev/null +++ b/support/testing/tests/download/br2-external/github/external.mk @@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_GITHUB_PATH)/package/*/*.mk)) diff --git a/support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash b/support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash new file mode 100644 index 0000000000..a941060b31 --- /dev/null +++ b/support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 4064739881453831bceeae81af8947cbd6c1fe03e052ac17b82ae5b3360d83f8 github-helper-hash-e2fba6457bd9d9c720540332eaf0c1f8c29eab00.tar.gz +sha256 9755181e27175cb3510b4da8629caa406fb355a19aa8e7d55f06bf8ab33323c4 COPYING diff --git a/support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk b/support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk new file mode 100644 index 0000000000..e1fa5aabc2 --- /dev/null +++ b/support/testing/tests/download/br2-external/github/package/github-helper-hash/github-helper-hash.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# github-helper-hash +# +################################################################################ + +GITHUB_HELPER_HASH_VERSION = e2fba6457bd9d9c720540332eaf0c1f8c29eab00 +GITHUB_HELPER_HASH_SITE = $(call github,buildroot,buildroot,$(GITHUB_HELPER_HASH_VERSION)) +GITHUB_HELPER_HASH_LICENSE_FILES = COPYING + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash b/support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash new file mode 100644 index 0000000000..466d2ac401 --- /dev/null +++ b/support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 959a953bbd91e6ed6db8d63a45a986400878b6bb486455231b2976218301c3d2 github-helper-tag-2021.02.tar.gz +sha256 9755181e27175cb3510b4da8629caa406fb355a19aa8e7d55f06bf8ab33323c4 COPYING diff --git a/support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk b/support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk new file mode 100644 index 0000000000..b1ff66d817 --- /dev/null +++ b/support/testing/tests/download/br2-external/github/package/github-helper-tag/github-helper-tag.mk @@ -0,0 +1,11 @@ +################################################################################ +# +# github-helper-tag +# +################################################################################ + +GITHUB_HELPER_TAG_VERSION = 2021.02 +GITHUB_HELPER_TAG_SITE = $(call github,buildroot,buildroot,$(GITHUB_HELPER_TAG_VERSION)) +GITHUB_HELPER_TAG_LICENSE_FILES = COPYING + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/br2-external/github/package/github-release/github-release.hash b/support/testing/tests/download/br2-external/github/package/github-release/github-release.hash new file mode 100644 index 0000000000..78a25dd271 --- /dev/null +++ b/support/testing/tests/download/br2-external/github/package/github-release/github-release.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 f4cb17b21928e36ec27de5c5294dea6ec1de4acd7ee6c56d6ecc75319cbcaefa systemd-bootchart-233.tar.xz +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 LICENSE.LGPL2.1 diff --git a/support/testing/tests/download/br2-external/github/package/github-release/github-release.mk b/support/testing/tests/download/br2-external/github/package/github-release/github-release.mk new file mode 100644 index 0000000000..34409e1cad --- /dev/null +++ b/support/testing/tests/download/br2-external/github/package/github-release/github-release.mk @@ -0,0 +1,12 @@ +################################################################################ +# +# github-release +# +################################################################################ + +GITHUB_RELEASE_VERSION = 233 +GITHUB_RELEASE_SITE = https://github.com/systemd/systemd-bootchart/releases/download/v$(GITHUB_RELEASE_VERSION) +GITHUB_RELEASE_SOURCE = systemd-bootchart-$(GITHUB_RELEASE_VERSION).tar.xz +GITHUB_RELEASE_LICENSE_FILES = LICENSE.LGPL2.1 + +$(eval $(generic-package)) diff --git a/support/testing/tests/download/test_gitforge.py b/support/testing/tests/download/test_gitforge.py new file mode 100644 index 0000000000..c2d98d0853 --- /dev/null +++ b/support/testing/tests/download/test_gitforge.py @@ -0,0 +1,41 @@ +import os +import shutil + +import infra + + +class GitforgeTestBase(infra.basetest.BRConfigTest): + config = \ + """ + BR2_BACKUP_SITE="" + """ + + def setUp(self): + super(GitforgeTestBase, self).setUp() + + def tearDown(self): + self.show_msg("Cleaning up") + if self.b and not self.keepbuilds: + self.b.delete() + + def check_download(self, package): + # store downloaded tarball inside the output dir so the test infra + # cleans it up at the end + dl_dir = os.path.join(self.builddir, "dl") + # enforce we test the download + if os.path.exists(dl_dir): + shutil.rmtree(dl_dir) + env = {"BR2_DL_DIR": dl_dir} + self.b.build(["{}-dirclean".format(package), + "{}-legal-info".format(package)], + env) + + +class TestGitHub(GitforgeTestBase): + br2_external = [infra.filepath("tests/download/br2-external/github")] + + def test_run(self): + self.check_download("github-helper-tag") + self.check_download("github-helper-hash") + self.check_download("github-release") +