From 82182ae078fdd576601631529c4f9c56048fe22f Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 22 Mar 2022 12:12:11 +0100 Subject: [PATCH] ci: use external servers in CI and scripts --- docs/tests/index.md | 2 +- tests/download_emulators.sh | 13 +++++++++++-- tests/ui_tests/reporting/download.py | 14 +------------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/docs/tests/index.md b/docs/tests/index.md index e09c2f1d2..1343e2b65 100644 --- a/docs/tests/index.md +++ b/docs/tests/index.md @@ -31,7 +31,7 @@ Implement U2F/FIDO2 tests. ## Upgrade tests -These tests test upgrade from one firmware version to another. They initialize an emulator on some specific version and then pass its storage to another version to see if the firmware operates as expected. They use fixtures from https://firmware.corp.sldev.cz/upgrade_tests/ which can be downloaded using the `download_emulators.sh` script. +These tests test upgrade from one firmware version to another. They initialize an emulator on some specific version and then pass its storage to another version to see if the firmware operates as expected. They use fixtures from https://data.trezor.io/dev/firmware/releases/emulators/ which can be downloaded using the `download_emulators.sh` script. See the [upgrade-tests.md](upgrade-tests.md) for instructions how to run it. diff --git a/tests/download_emulators.sh b/tests/download_emulators.sh index 580172f6b..0c34e5289 100755 --- a/tests/download_emulators.sh +++ b/tests/download_emulators.sh @@ -1,11 +1,20 @@ #!/usr/bin/env bash set -e -SITE="https://firmware.corp.sldev.cz/releases/emulators/" +SITE="https://data.trezor.io/dev/firmware/releases/emulators/" cd "$(dirname "$0")" # download all emulators without index files, without directories and only if not present -wget -e robots=off --no-verbose --no-clobber --no-parent --cut-dirs=2 --no-host-directories --recursive --reject "index.html*" -P emulators/ $SITE +wget -e robots=off \ + --no-verbose \ + --no-clobber \ + --no-parent \ + --no-directories \ + --no-host-directories \ + --recursive \ + --reject "index.html*" \ + -P emulators/ \ + $SITE chmod u+x emulators/trezor-emu-* diff --git a/tests/ui_tests/reporting/download.py b/tests/ui_tests/reporting/download.py index 3ffbb4817..73484d135 100644 --- a/tests/ui_tests/reporting/download.py +++ b/tests/ui_tests/reporting/download.py @@ -7,19 +7,12 @@ from typing import Dict import requests -RECORDS_WEBSITE = "https://firmware.corp.sldev.cz/ui_tests/" +RECORDS_WEBSITE = "https://data.trezor.io/dev/firmware/ui_tests/" FIXTURES_MASTER = "https://raw.githubusercontent.com/trezor/trezor-firmware/master/tests/ui_tests/fixtures.json" FIXTURES_CURRENT = Path(__file__).resolve().parent.parent / "fixtures.json" -_dns_failed = False - def fetch_recorded(hash: str, path: Path) -> None: - global _dns_failed - - if _dns_failed: - raise RuntimeError("Not trying firmware.corp.sldev.cz again after DNS failure.") - zip_src = RECORDS_WEBSITE + hash + ".zip" zip_dest = path / "recorded.zip" @@ -27,11 +20,6 @@ def fetch_recorded(hash: str, path: Path) -> None: urllib.request.urlretrieve(zip_src, zip_dest) except urllib.error.HTTPError: raise RuntimeError(f"No such recorded collection was found on '{zip_src}'.") - except urllib.error.URLError: - _dns_failed = True - raise RuntimeError( - "Server firmware.corp.sldev.cz could not be found. Are you on VPN?" - ) with zipfile.ZipFile(zip_dest, "r") as z: z.extractall(path)