Skip to content

Commit b2a6665

Browse files
committed
Merge audited release Python fixes into upstream sync
2 parents e7e39ba + c4fb8bf commit b2a6665

49 files changed

Lines changed: 3482 additions & 384 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ jobs:
1111
- run:
1212
name: Clone python-keepkey (current branch)
1313
command: |
14-
git clone --depth 1 -b "$CIRCLE_BRANCH" https://github.com/keepkey/python-keepkey.git .pykk
14+
# Fork-only PR branches do not exist in keepkey/python-keepkey.
15+
# Clone the repository that triggered this CircleCI project so the
16+
# exact CIRCLE_SHA1 under review is available and verifiable.
17+
git clone --depth 1 -b "$CIRCLE_BRANCH" \
18+
"https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git" .pykk
19+
test "$(git -C .pykk rev-parse HEAD)" = "$CIRCLE_SHA1"
1520
cd .pykk && git submodule update --init --recursive
1621
1722
# ────────────────────────────────────────────────────────────────
@@ -27,16 +32,38 @@ jobs:
2732
# Move python-keepkey out of the way
2833
mv .pykk ../
2934
30-
# Clone firmware repository (expects $FIRMWARE_REPO env var)
31-
git clone --depth 1 -b master "$FIRMWARE_REPO" .
35+
# Gate the immutable fork 7.15 candidate, then replace its pinned
36+
# Python submodule with the exact CIRCLE_SHA1 under review.
37+
git init .
38+
git remote add origin \
39+
https://github.com/BitHighlander/keepkey-firmware.git
40+
git fetch --depth 1 origin \
41+
d0a494a805533f02387f58d89dbb6f1fb09a621a
42+
git checkout --detach FETCH_HEAD
43+
test "$(git rev-parse HEAD)" = \
44+
d0a494a805533f02387f58d89dbb6f1fb09a621a
3245
33-
# Initialise firmware submodules
34-
git submodule update --init --recursive
46+
# Match firmware CI's build set. A recursive init reaches optional
47+
# trezor-firmware vendors that do not support shallow HTTPS clones.
48+
git submodule update --init --depth 1 deps/crypto/trezor-firmware
49+
git submodule update --init --depth 1 deps/device-protocol
50+
git submodule update --init --depth 1 deps/googletest
51+
git submodule update --init --depth 1 deps/qrenc/QR-Code-generator
52+
git submodule update --init --depth 1 deps/sca-hardening/SecAESSTM32
3553
3654
# Replace the vendor copy with our PR branch python-keepkey
3755
rm -rf deps/python-keepkey
3856
mv ../.pykk deps/python-keepkey
3957
58+
# This is python-keepkey's standalone compatibility lane. Release
59+
# OLED/PDF evidence is generated only by the exact-head firmware
60+
# workflow, where the firmware and Python SHAs are pinned together.
61+
# Do not inherit the firmware checkout's report/screenshot phase:
62+
# it can describe a different (published/master) emulator and is
63+
# therefore not release evidence for this Python PR.
64+
cp deps/python-keepkey/.circleci/standalone-emulator-tests.sh \
65+
scripts/emulator/python-keepkey-tests.sh
66+
4067
# ────────────────────────────────────────────────────────────────
4168
# 3) Build the Docker-based emulator tests
4269
# ────────────────────────────────────────────────────────────────
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# python-keepkey's own CI is a compatibility test against the emulator supplied
5+
# by the firmware checkout. It deliberately does not produce OLED/PDF release
6+
# evidence. Authoritative display evidence is generated by keepkey-firmware CI,
7+
# which pins both repositories to exact candidate SHAs.
8+
9+
mkdir -p /kkemu/test-reports/python-keepkey
10+
11+
echo "=== Waiting for emulator ==="
12+
for attempt in $(seq 1 20); do
13+
if echo -n "PINGPING" | nc -u -w1 kkemu 11044 2>/dev/null | grep -q PONG; then
14+
echo "Emulator ready (attempt $attempt)"
15+
break
16+
fi
17+
if [ "$attempt" -eq 20 ]; then
18+
echo "Emulator did not become ready"
19+
echo "1" > /kkemu/test-reports/python-keepkey/status
20+
exit 1
21+
fi
22+
sleep 2
23+
done
24+
25+
cd /kkemu/deps/python-keepkey/tests
26+
set +e
27+
KK_TRANSPORT_MAIN=kkemu:11044 \
28+
KK_TRANSPORT_DEBUG=kkemu:11045 \
29+
pytest -v --tb=short \
30+
--junitxml=/kkemu/test-reports/python-keepkey/junit.xml
31+
pytest_status=$?
32+
set -e
33+
34+
echo "$pytest_status" > /kkemu/test-reports/python-keepkey/status
35+
exit "$pytest_status"

0 commit comments

Comments
 (0)