Skip to content

Commit

Permalink
Tests: add tests for unimplemented commands
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Oct 11, 2023
1 parent f3c555a commit 0dfb103
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/integration/nanos/test_unimplemented_commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
start_speculos "$seed"
sleep 0.2
expect_full_text "ready for" "safe signing"
send_apdu 8001000000
expect_apdu_return 6d00
send_apdu 8005000000
expect_apdu_return 6d00
send_apdu 8006000000
expect_apdu_return 6d00
send_apdu 8007000000
expect_apdu_return 6d00
send_apdu 8008000000
expect_apdu_return 6d00
send_apdu 800a000000
expect_apdu_return 6d00
send_apdu 800b000000
expect_apdu_return 6d00
send_apdu 800c000000
expect_apdu_return 6d00
send_apdu 800d000000
expect_apdu_return 6d00
send_apdu 800e000000
expect_apdu_return 6d00
press_button right
expect_full_text "Settings"
press_button right
expect_full_text "Quit?"
press_button both
expect_exited
29 changes: 29 additions & 0 deletions tests/integration/nanosp/test_unimplemented_commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
start_speculos "$seed"
sleep 0.2
expect_full_text "Tezos Wallet" "ready for" "safe signing"
send_apdu 8001000000
expect_apdu_return 6d00
send_apdu 8005000000
expect_apdu_return 6d00
send_apdu 8006000000
expect_apdu_return 6d00
send_apdu 8007000000
expect_apdu_return 6d00
send_apdu 8008000000
expect_apdu_return 6d00
send_apdu 800a000000
expect_apdu_return 6d00
send_apdu 800b000000
expect_apdu_return 6d00
send_apdu 800c000000
expect_apdu_return 6d00
send_apdu 800d000000
expect_apdu_return 6d00
send_apdu 800e000000
expect_apdu_return 6d00
press_button right
expect_full_text "Settings"
press_button right
expect_full_text "Quit?"
press_button both
expect_exited
29 changes: 29 additions & 0 deletions tests/integration/nanox/test_unimplemented_commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
start_speculos "$seed"
sleep 0.2
expect_full_text "Tezos Wallet" "ready for" "safe signing"
send_apdu 8001000000
expect_apdu_return 6d00
send_apdu 8005000000
expect_apdu_return 6d00
send_apdu 8006000000
expect_apdu_return 6d00
send_apdu 8007000000
expect_apdu_return 6d00
send_apdu 8008000000
expect_apdu_return 6d00
send_apdu 800a000000
expect_apdu_return 6d00
send_apdu 800b000000
expect_apdu_return 6d00
send_apdu 800c000000
expect_apdu_return 6d00
send_apdu 800d000000
expect_apdu_return 6d00
send_apdu 800e000000
expect_apdu_return 6d00
press_button right
expect_full_text "Settings"
press_button right
expect_full_text "Quit?"
press_button both
expect_exited
45 changes: 45 additions & 0 deletions tests/integration/stax/test_unimplemented_commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from utils import *

if __name__ == "__main__":
app = stax_app()

app.assert_screen(SCREEN_HOME_DEFAULT)

app.send_apdu("8001000000")
app.expect_apdu_failure("6d00")
app.send_apdu("8005000000")
app.expect_apdu_failure("6d00")
app.send_apdu("8006000000")
app.expect_apdu_failure("6d00")
app.send_apdu("8007000000")
app.expect_apdu_failure("6d00")
app.send_apdu("8008000000")
app.expect_apdu_failure("6d00")
app.send_apdu("800a000000")
app.expect_apdu_failure("6d00")
app.send_apdu("800b000000")
app.expect_apdu_failure("6d00")
app.send_apdu("800c000000")
app.expect_apdu_failure("6d00")
app.send_apdu("800d000000")
app.expect_apdu_failure("6d00")
app.send_apdu("800e000000")
app.expect_apdu_failure("6d00")

app.assert_screen(SCREEN_HOME_DEFAULT)
app.welcome.quit()

0 comments on commit 0dfb103

Please sign in to comment.