You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
idm/tests/python-yubico/test_ipa_yubikey.py

29 lines
559 B

#!/usr/libexec/platform-python
"""Simple test for APIs used by IPA's otptoken plugin
"""
import logging
import yubico
import usb.core
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
def main():
try:
yk = yubico.find_yubikey()
except usb.core.USBError as e:
log.info(e)
except yubico.yubikey.YubiKeyError as e:
log.info(e)
else:
assert yk.version_num()
log.info(yk.status())
log.info(yk.status().valid_configs())
log.info("PASS")
if __name__ == "__main__":
main()