Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: allow dumping protocol packets via -vvv #4561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romanz
Copy link
Contributor

@romanz romanz commented Jan 30, 2025

For example:

$ pytest -vvvs tests/device_tests/misc/test_msg_getecdhsessionkey.py
<...>
[2025-01-30 20:44:51,407] trezorlib.client DEBUG: sending message: GetECDHSessionKey
GetECDHSessionKey (102 bytes) {
    ecdsa_curve_name: 'curve25519',
    identity: IdentityType (53 bytes) {
        host: 'Satoshi Nakamoto <[email protected]>',
        index: 0,
        path: '',
        port: '',
        proto: 'gpg',
        user: '',
    },
    peer_public_key: 33 bytes 0x40a8cf4b6a64c4314e80f15a8ea55812bd735fbb365936a48b2d78807b575fa17a,
}
[2025-01-30 20:44:51,407] trezorlib.client BYTES: encoded as type 61 (102 bytes): 0a350a0367706712001a265361746f736869204e616b616d6f746f203c7361746f73686940626974636f696e2e6f72673e22002a003000122140a8cf4b6a64c4314e80f15a8ea55812bd735fbb365936a48b2d78807b575fa17a1a0a63757276653235353139
[2025-01-30 20:44:51,407] trezorlib.transport.udp PACKETS: sending packet: 3f2323003d000000660a350a0367706712001a265361746f736869204e616b616d6f746f203c7361746f73686940626974636f696e2e6f72673e22002a003000
[2025-01-30 20:44:51,407] trezorlib.transport.udp PACKETS: sending packet: 3f122140a8cf4b6a64c4314e80f15a8ea55812bd735fbb365936a48b2d78807b575fa17a1a0a6375727665323535313900000000000000000000000000000000
[2025-01-30 20:44:51,505] trezorlib.transport.udp PACKETS: received packet: 3f2323001a0000001508011001220f636f6e6669726d5f6164647265737300000000000000000000000000000000000000000000000000000000000000000000
[2025-01-30 20:44:51,505] trezorlib.client BYTES: received type 26 (21 bytes): 08011001220f636f6e6669726d5f61646472657373
[2025-01-30 20:44:51,506] trezorlib.client DEBUG: received message: ButtonRequest
ButtonRequest (21 bytes) {
    code: Other (1),
    name: 'confirm_address',
    pages: 1,
}
[2025-01-30 20:44:51,506] trezorlib.client DEBUG: sending message: ButtonAck
ButtonAck (0 bytes) {
}
[2025-01-30 20:44:51,506] trezorlib.client BYTES: encoded as type 27 (0 bytes): 
[2025-01-30 20:44:51,506] trezorlib.transport.udp PACKETS: sending packet: 3f2323001b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
[2025-01-30 20:44:51,506] trezorlib.debuglink DEBUG: sending message: DebugLinkDecision
DebugLinkDecision (2 bytes) {
    button: YES (1),
}
[2025-01-30 20:44:51,506] trezorlib.debuglink BYTES: encoded as type 100 (2 bytes): 0801
[2025-01-30 20:44:51,506] trezorlib.transport.udp PACKETS: sending packet: 3f232300640000000208010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
[2025-01-30 20:44:51,506] trezorlib.debuglink DEBUG: sending message: DebugLinkGetState
DebugLinkGetState (2 bytes) {
    wait_layout: IMMEDIATE (0),
}
[2025-01-30 20:44:51,506] trezorlib.debuglink BYTES: encoded as type 101 (2 bytes): 1800
[2025-01-30 20:44:51,506] trezorlib.transport.udp PACKETS: sending packet: 3f232300650000000218000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
[2025-01-30 20:44:51,508] trezorlib.transport.udp PACKETS: received packet: 3f2323006600000054224c616c636f686f6c20776f6d616e206162757365206d75737420647572696e67206d6f6e69746f72206e6f626c652061637475616c20
[2025-01-30 20:44:51,508] trezorlib.transport.udp PACKETS: received packet: 3f6d6978656420747261646520616e676572206169736c65300042006000206d75737420647572696e67206d6f6e69746f72206e6f626c652061637475616c20
[2025-01-30 20:44:51,508] trezorlib.debuglink BYTES: received type 102 (84 bytes): 224c616c636f686f6c20776f6d616e206162757365206d75737420647572696e67206d6f6e69746f72206e6f626c652061637475616c206d6978656420747261646520616e676572206169736c65300042006000
[2025-01-30 20:44:51,508] trezorlib.debuglink DEBUG: received message: DebugLinkState
DebugLinkState (86 bytes) {
    mnemonic_secret: 76 bytes b'alcohol woman abuse must during monitor noble actual mixed trade anger aisle',
    mnemonic_type: Bip39 (0),
    passphrase_protection: False,
    reset_entropy: 0 bytes b'',
    tokens: ,
}
[2025-01-30 20:44:51,508] trezorlib.transport.udp PACKETS: received packet: 3f2323003e000000460a2104e24516669e0b7d3d72e5129fddd07b6644c30915f5c8b7f1f62324afb36243111221009753a0738c55c7ba7c17dd4a9a975ce9b0
[2025-01-30 20:44:51,508] trezorlib.transport.udp PACKETS: received packet: 3fd2b62e8a1ecef4a76767fad99d3c719e0b7d3d72e5129fddd07b6644c30915f5c8b7f1f62324afb36243111221009753a0738c55c7ba7c17dd4a9a975ce9b0
[2025-01-30 20:44:51,508] trezorlib.client BYTES: received type 62 (70 bytes): 0a2104e24516669e0b7d3d72e5129fddd07b6644c30915f5c8b7f1f62324afb36243111221009753a0738c55c7ba7c17dd4a9a975ce9b0d2b62e8a1ecef4a76767fad99d3c71
[2025-01-30 20:44:51,509] trezorlib.client DEBUG: received message: ECDHSessionKey
ECDHSessionKey (70 bytes) {
    public_key: 33 bytes 0x009753a0738c55c7ba7c17dd4a9a975ce9b0d2b62e8a1ecef4a76767fad99d3c71,
    session_key: 33 bytes 0x04e24516669e0b7d3d72e5129fddd07b6644c30915f5c8b7f1f62324afb3624311,
}
<...>

@romanz romanz self-assigned this Jan 30, 2025
Copy link

github-actions bot commented Jan 30, 2025

core UI changes device test click test persistence test
T2T1 Model T test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3B1 Safe 3 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
T3T1 Safe 5 test(screens) main(screens) test(screens) main(screens) test(screens) main(screens)
All main(screens)

@romanz romanz force-pushed the romanz/pytest-verbose-log branch from 429a373 to 89b6990 Compare January 30, 2025 18:56
@romanz romanz marked this pull request as ready for review January 30, 2025 19:18
@romanz romanz requested a review from matejcik as a code owner January 30, 2025 19:18
@romanz romanz added the tests Automated integration tests label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Automated integration tests
Projects
Status: 🔎 Needs review
Development

Successfully merging this pull request may close these issues.

1 participant