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
ipatests: client install - add tests scenarios #6759
base: master
Are you sure you want to change the base?
Conversation
0e3b40f
to
a409ec6
Compare
'ntpd']) | ||
assert result.returncode == 4 # service not found | ||
finally: | ||
tasks.uninstall_client(client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't the IntegrationTest uninstall classmethod handle calling tasks.uninstall_client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @rcritten, thank you for your question. Yes, it should. However, when I omit manual clean-up, subsequent tests fail with "already configured". I'll investigate further. Stay tuned!
2581440
to
c7490e9
Compare
f919c82
to
28b67ad
Compare
authconf = client.get_file_contents('/etc/pam.d/system-auth', | ||
encoding='utf-8') | ||
exp_val_mkhomedir = "mkhomedir.so" | ||
assert exp_val_mkhomedir in authconf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question: would it be more robust to call authselect current
and parse that output so the test doesn't rely on a setting in a specific file?
user=non_admin_user, | ||
raiseonerr=False | ||
) | ||
exp_msg = "Password incorrect while getting initial credentials" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error is unexpected. I'd expect something more like:
Joining realm failed: No permission to join this host to the IPA domain.
The password should have been properly set when the user was created so I think that that password isn't being passed into the installer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this one.
The non-admin user is created as an active one. So the password for them are set.
The client installation uses default admin password, if not provided with one explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rcritten do you happen to have any insight as what is happening here, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You create a test user with the password of RandomPassword123. The user password is made valid by tasks.create_active_user()
You then run the client install task as non_admin_user but you don't pass in the password. tasks.install_client() defaults to the admin password if you don't provide one. It doesn't match which is why this test passes with the expected error. I suppose it might be nicer to be explicit about passing in a different password, though you don't really need a non-admin user for that I suppose.
""" | ||
Second installation should fail except when --force | ||
parameter is provided | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--force does not apply to uninstall
|
||
try: | ||
modify_local_hostname('localhost.localdomain') | ||
# client_install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment why tasks.install_client() isn't used in this case because it will automatically fix hostnames.
assert result.returncode == 0 | ||
|
||
# now uninstall | ||
tasks.uninstall_client(self.clients[0], raiseonerr=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want a try/finally here on the off-chance the installation fails?
tasks.uninstall_client(self.clients[0], raiseonerr=True) | ||
|
||
def tests_client_install_replica_with_master_down(self): | ||
self.master.run_command(['ipactl', 'stop'], raiseonerr=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't appear in the report as far as I can tell.
28b67ad
to
8b511f7
Compare
8b511f7
to
3e5ea5a
Compare
Hello @rcritten , all issues seem to be resolved, could you please review? Thank you! |
3e5ea5a
to
b830962
Compare
assert exp_msg.lower() in result.stderr_text.lower() | ||
|
||
tasks.uninstall_client(self.clients[0], raiseonerr=True) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing because the variable result contains the output from the last failed install. But even if you instead use result = tasks.uninstall_client() the message will still not match because the result will be successful. Did you want to run the uninstaller twice to check this message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was a overlook from my side
Add negative tests scenarios, parameter testing, replica joining tests, and other scenarios from downstream. Signed-off-by: Michal Polovka <mpolovka@redhat.com>
Signed-off-by: Michal Polovka <mpolovka@redhat.com>
b830962
to
e6045b9
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Add negative tests scenarios, parameter testing, replica joining tests, and other scenarios from downstream.