tests: remove pin files for new tests, remove nolegacy from old tests
What changed, and why it matters
This commit is purely a testing infrastructure cleanup. It removes leftover command-line options and test files related to an older transaction-signing workflow, and makes sure temporary PIN files created during automated tests are cleaned up. There is no change to the actual Jade wallet firmware or its security behavior.
No security action needed; this is a routine test-maintenance change. Reviewers may verify that the new test selection still covers both legacy and non-legacy transaction signing as intended.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies CI scripts and pytest configuration only. It drops the –nolegacyflow flag from test_jade.py and updates GitLab CI to run the newer anti-exfil (AE) signing flow tests directly. It also adds a helper _remove_pin_files() in tests/conftest.py to delete *.pin artifacts before and after pytest runs, and adjusts file ownership in a Docker environment via ci_flash.sh. No production code is touched.
Changed components
test_jade.pytests/conftest.pytests/__init__.pytests/rpc/test_bip85.pytests/rpc/test_ping.pyci_flash.shgitlab/test_libjade.ymlInspect captured patch +21 / −11
### ci_flash.sh
@@ -49,6 +49,15 @@ python jade_ota.py --push-mnemonic --log=INFO --serialport=${JADESERIALPORT} --f
sleep 5
python -c "from jadepy import JadeAPI; jade = JadeAPI.create_serial(device=\"${JADESERIALPORT}\", timeout=5) ; jade.connect(); jade.drain(); jade.disconnect()"
+function reset_permissions {
+ if [ -f /.dockerenv ]; then
+ # Ensure test reports/pin files are owned by the user outside
+ # the container when we are run under docker compose.
+ chown -f $(stat -c "%u:%g" jade_ota.py) *.xml *.pin || true
+ fi
+}
+trap reset_permissions EXIT
+
python test_jade.py --log=INFO --serialport=${JADESERIALPORT} ${SKIP_ARGS}
pytest -v --no-legacy-flow --device ${JADESERIALPORT} tests/
if [ -x /usr/bin/bt-agent ]; then
### gitlab/test_libjade.yml
@@ -45,13 +45,12 @@ test_libjade_sanitize:
- LD_PRELOAD=$ASAN_SO python ./test_jade.py --log CRITICAL --libjade
- LD_PRELOAD=$ASAN_SO pytest -v --libjade tests/
- echo "----------------------- NON-LEGACY TESTS ----------------------"
- - LD_PRELOAD=$ASAN_SO python ./test_jade.py --log CRITICAL --libjade --nolegacyflow
- - LD_PRELOAD=$ASAN_SO pytest -v --libjade --no-legacy-flow tests/rpc/test_sign_tx.py
+ - LD_PRELOAD=$ASAN_SO pytest -v --libjade --no-legacy-flow tests/rpc/test_sign_tx.py tests/rpc/test_multisig.py
- echo "----------------------- SERIAL TESTS ----------------------"
- LD_PRELOAD=$ASAN_SO setsid $PWD/build_linux/libjade/libjade_daemon --serialport $SOCKET_LINK >daemon.log 2>&1 &
- DAEMON_PID=$!
- - LD_PRELOAD=$ASAN_SO python ./test_jade.py --log CRITICAL --nolegacyflow --serialport $SOCKET_LINK --serialtimeout 30
- - LD_PRELOAD=$ASAN_SO pytest -v --libjade --no-legacy-flow --device $SOCKET_LINK --timeout 30 tests/
+ - LD_PRELOAD=$ASAN_SO python ./test_jade.py --log CRITICAL --serialport $SOCKET_LINK --serialtimeout 30
+ - LD_PRELOAD=$ASAN_SO pytest -v --device $SOCKET_LINK tests/
- kill -- -$DAEMON_PID
artifacts:
expire_in: 2 days
### test_jade.py
@@ -3209,11 +3209,6 @@ def kill_agent(btagent):
dest='qemu',
help='Skip tests which appear problematic on qemu hw emulator',
default=False)
- parser.add_argument('--nolegacyflow',
- action='store_true',
- dest='no_legacy_flow',
- help='Do not use the legacy sign_tx flow (use the AE flow instead)',
- default=False)
parser.add_argument("--sample-percent",
action="store",
dest="sample_percent",
### tests/__init__.py
@@ -3,6 +3,7 @@
import glob
import json
import logging
+import os
import pytest
import subprocess
import time
### tests/conftest.py
@@ -134,17 +134,25 @@ def pytest_addoption(parser):
)
+def _remove_pin_files():
+ """Helper to remove pinserver .pin files from testing"""
+ for f in glob.glob("./*.pin"):
+ os.remove(f)
+
+
def pytest_configure(config):
# pytest: global test initialization
config.addinivalue_line('markers',
'mnemonic(value): set a custom Jade mnemonic before the test')
set_jade_config(JadeConfig(config))
+ _remove_pin_files()
def pytest_unconfigure(config):
# pytest: global test teardown
if get_jade_config():
get_jade_config().disconnect()
+ _remove_pin_files()
def _get_test_mnemonic(item):
### tests/rpc/test_bip85.py
@@ -1,4 +1,3 @@
-import os
from . import *
### tests/rpc/test_ping.py
@@ -1,4 +1,3 @@
-import os
from . import *
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.