mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Test error when yubikey hardware not present
In order to work with IPA and Yubikey, libyubikey is required. Before the fix, if yubikey added without having packages, it used to result in traceback. Now it the exception is handeled properly. It needs Yubikey hardware to make command successfull. This test just check of proper error thrown when hardware is not attached. related ticket : https://pagure.io/freeipa/issue/6979 Signed-off-by: Mohammad Rizwan Yusuf <myusuf@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
07e6d5148e
commit
e7581cc0d8
@ -410,6 +410,24 @@ class TestInstallMaster(IntegrationTest):
|
||||
wsgi_count = cmd.stdout_text.count('wsgi:ipa')
|
||||
assert constants.WSGI_PROCESSES == wsgi_count
|
||||
|
||||
def test_error_for_yubikey(self):
|
||||
""" Test error when yubikey hardware not present
|
||||
|
||||
In order to work with IPA and Yubikey, libyubikey is required.
|
||||
Before the fix, if yubikey added without having packages, it used to
|
||||
result in traceback. Now it the exception is handeled properly.
|
||||
It needs Yubikey hardware to make command successfull. This test
|
||||
just check of proper error thrown when hardware is not attached.
|
||||
|
||||
related ticket : https://pagure.io/freeipa/issue/6979
|
||||
"""
|
||||
# try to add yubikey to the user
|
||||
args = ['ipa', 'otptoken-add-yubikey', '--owner=admin']
|
||||
cmd = self.master.run_command(args, raiseonerr=False)
|
||||
assert cmd.returncode != 0
|
||||
exp_str = ("ipa: ERROR: No YubiKey found")
|
||||
assert exp_str in cmd.stderr_text
|
||||
|
||||
|
||||
class TestInstallMasterKRA(IntegrationTest):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user