diff --git a/tests/test-latest b/tests/test-latest index 878ef3ed1f1cc96ac5b3f060bb1419da1f9fe06b..57f7df8dea1941bf3af48650e9f5aeb2f95781ec 100755 --- a/tests/test-latest +++ b/tests/test-latest @@ -18,15 +18,16 @@ from test_util import BASE_TAG, BASE_ARCHIVE, BASE_CONFIG, \ SYSROOTS, LATEST_SYSROOTS, \ CONFIG_FILES, BAD_VERSION_URLS -# Utility functions -def check_version(result, sysroot): - expected = BASE_TAG.format(*sysroot) - return result['LatestVersion'] == expected - # Setup server = SysrootServer() server.start() +# Utility functions +def check_version(result, sysroot): + expected_tag = BASE_TAG.format(*sysroot) + expected_url = server.base_archive_url().format(*sysroot) + return result['LatestVersion'] == expected_tag and result['LatestURL'] == expected_url + # Test "ade sysroot latest --url" usage for sysroot in SYSROOTS: params = ['--url', server.base_url().format(*sysroot), '--distro', sysroot[0], diff --git a/tests/test_util.py b/tests/test_util.py index 76dafccb8c8f21be8a7cc3bfe40912460243aa06..a1f8fbab4b5b27ce6197218f91c678f200aea9e0 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -184,6 +184,10 @@ class SysrootServer(http.server.HTTPServer): url = "http://{}/versions/{}" return url.format(self.host(), BASE_TAG) + def base_archive_url(self): + url = "http://{}/archives/{}.tar.gz" + return url.format(self.host(), BASE_TAG) + @contextmanager def templatedconfig(server, config_file): config = os.path.join(os.getcwd(), "configs", config_file) diff --git a/tools/ade b/tools/ade index 09ee6d746c10da47685dbf54f0ff9d6393a20b78..91b5e5571aa6663dc2e4c9f119dc18958043523c 100755 --- a/tools/ade +++ b/tools/ade @@ -377,6 +377,7 @@ class Ade: self.info("* Retrieved latest version: {0}{1}{2}" \ .format(Colors.OKGREEN, version, Colors.ENDC)) + self.info("* Download URL: {0}".format(version.url)) return version except URLError as e: @@ -510,6 +511,7 @@ class Ade: version = self.get_latest_version() if self.format == 'parseable': print('LatestVersion:' + version.get_tag()) + print('LatestURL:' + version.url) def do_sysroot_download(self): self.validate_sysroot_id()