Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for client installation with empty keytab file #2333

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions ipatests/test_integration/test_forced_client_reenrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ def test_try_to_reenroll_with_incorrect_keytab(self, client):
self.clients[0].run_command(['touch', EMPTY_KEYTAB])
self.reenroll_client(keytab=EMPTY_KEYTAB, expect_fail=True)

def test_try_to_reenroll_with_empty_keytab(self, client):
"""
Client re-enrollment with invalid (empty) client keytab file
"""
self.restore_client()
self.check_client_host_entry()
try:
os.remove(CLIENT_KEYTAB)
except OSError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, once we have Python 3 only, we can use FileNotFoundError here.

pass
self.clients[0].run_command(['touch', CLIENT_KEYTAB])
self.reenroll_client(force_join=True)

def uninstall_client(self):
self.clients[0].run_command(
['ipa-client-install', '--uninstall', '-U'],
Expand Down