Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
This patch bumps pynitrokey and fixes a typo in the basic tests so that
the test suite passes again when using latest trussed-usbip version, see
Nitrokey/nitrokey-3-firmware#350.
  • Loading branch information
robin-nitrokey committed Oct 5, 2023
1 parent adc6ced commit e18e428
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
6 changes: 1 addition & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@

fido2 >=1.1,<2
pexpect >=4,<5
pynitrokey ==0.4.38
pynitrokey ==0.4.40
pytest >=7,<8

# pyyaml is broken with cython 3
# see https://github.com/yaml/pyyaml/issues/724
pyyaml !=6.0.0,!=5.4.0,!=5.4.1
18 changes: 9 additions & 9 deletions tests/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def verify(self, fido2, credential):
fido2.authenticate([credential])


def test_fido2(touch_device):
TestFido2().run(touch_device)
def test_fido2(device):
TestFido2().run(device)


class TestFido2Resident(UpgradeTest):
Expand Down Expand Up @@ -85,8 +85,8 @@ def verify(self, device, credential):
p.expect("successfully deleted")


def test_fido2_resident(touch_device):
TestFido2Resident().run(touch_device)
def test_fido2_resident(device):
TestFido2Resident().run(device)


class TestSecrets(UpgradeTest):
Expand All @@ -98,7 +98,7 @@ def __init__(self):

def _spawn_with_pin(self, s):
p = spawn(s)
p.expect("Current Password")
p.expect("Current PIN")
p.sendline(self.pin)
return p

Expand Down Expand Up @@ -132,14 +132,14 @@ def prepare(self, device):
p.expect("Password set")

p = self._spawn_with_pin(
"nitropy nk3 secrets register --kind HOTP test_hotp "
"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ"
"nitropy nk3 secrets register --kind HOTP --protect-with-pin "
"test_hotp GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ"
)
p.expect(EOF)

p = self._spawn_with_pin(
"nitropy nk3 secrets register --kind TOTP test_totp "
"GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ"
"nitropy nk3 secrets register --kind TOTP --protect-with-pin "
"test_totp GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ"
)
p.expect(EOF)

Expand Down

0 comments on commit e18e428

Please sign in to comment.