Added gating.yaml and test for python-yubico

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
This commit is contained in:
Sudhir Menon 2024-06-26 16:05:54 +05:30
parent 350da02d79
commit 85bdbbecac
3 changed files with 49 additions and 0 deletions

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# recipients: abokovoy, frenaud, kaleem, ftrivino, cheimes
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

28
tests/test_ipa_yubikey.py Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/python3
"""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()

14
tests/tests.yml Normal file
View File

@ -0,0 +1,14 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-source
- role: standard-test-basic
required_packages:
- python3-yubico
tests:
- test_ipa_yubikey:
dir: "tests"
run: ./test_ipa_yubikey.py