ci: use external servers in CI and scripts

pull/2187/head
matejcik 2 years ago committed by matejcik
parent 7f97ea4961
commit 82182ae078

@ -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.

@ -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-*

@ -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)

Loading…
Cancel
Save