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

ipatests: test_installation: add install test scenarios #5610

Closed
wants to merge 1 commit into from

Conversation

miskopo
Copy link
Member

@miskopo miskopo commented Mar 5, 2021

test_hostname_parameter: Test for issue 2692 ipa-server-install ignores --hostname:
check whether hostname provided in --hostname parameter is being taken into account and set as new hostname without prompting for it again

test_ad_subpackage_dependency: Test for issue 4011 ipa-server-install crashes when AD subpackage is not installed:
test if ipa-server installation succeeds without freeipa-ipa-server-trust-ad installed

test_backup_of_cs_cfg_should_be_created: Test for issue 4166 Backup CS.cfg before modifying it:
test if ipa-server installer backs up CS.cfg before modifying it

test_installer_wizard_should_prompt_for_DNS: Test for issue 2575 [RFE] Installer wizard should prompt for DNS:
test if installer is asking for DNS setup details if not provided as parameter

Related: https://pagure.io/freeipa/issue/2692
Related: https://pagure.io/freeipa/issue/4011
Related: https://pagure.io/freeipa/issue/4166
Related: https://pagure.io/freeipa/issue/2575

Signed-off-by: Michal Polovka mpolovka@redhat.com

@miskopo miskopo added the needs review Pull Request is waiting for a review label Mar 5, 2021
@miskopo miskopo self-assigned this Mar 5, 2021
@miskopo miskopo requested a review from fcami March 5, 2021 10:41
@miskopo miskopo removed the request for review from fcami March 6, 2021 16:11
@miskopo miskopo force-pushed the install-server-cli branch 7 times, most recently from c0d4967 to 1d1901c Compare March 7, 2021 16:35
@miskopo

This comment has been minimized.

@miskopo miskopo force-pushed the install-server-cli branch 2 times, most recently from b5ad884 to a7d789c Compare March 8, 2021 10:36
@miskopo
Copy link
Member Author

miskopo commented Mar 8, 2021

I've noticed an error in test_installer_wizard_should_prompt_for_DNS, I'll resolve with newest update

Copy link

@wladich wladich left a comment

Choose a reason for hiding this comment

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

Two new test cases do not deal with the installation process but rather check the rusult: test_update_krb5_conf_template_with_keyring_default_ccache_name and
test_backup_of_cs_cfg_should_be_created. Do you think those could be integrated to some other tests to save two ipa-server installations? This could save about 20 for of test execution.

ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
@miskopo
Copy link
Member Author

miskopo commented Mar 30, 2021

Two new test cases do not deal with the installation process but rather check the rusult: test_update_krb5_conf_template_with_keyring_default_ccache_name and
test_backup_of_cs_cfg_should_be_created. Do you think those could be integrated to some other tests to save two ipa-server installations? This could save about 20 for of test execution.

That's true, however, each test should test one thing and not be dependent on other test - if I merged these two test case into, e.g. test_install_master, I could obfuscate failures in one of the test cases, depending on which is going to be first.

@miskopo miskopo force-pushed the install-server-cli branch 5 times, most recently from 79988ab to 8b07b59 Compare March 31, 2021 09:25
Copy link

@wladich wladich left a comment

Choose a reason for hiding this comment

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

In added code you are using both types of quotes - single and double. According to PEP 8 it is advisable to stick to one type of quotes. This does not apply do docstrings, they should always use double quotes.

ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
ipatests/test_integration/test_installation.py Outdated Show resolved Hide resolved
tasks.install_master(self.master)
tasks.kinit_admin(self.master)
klist = self.master.run_command(['klist']).stdout_text
assert '/tmp/' not in klist
Copy link

Choose a reason for hiding this comment

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

You are checking two conditions:

  1. template is updated to use cache
  2. cache is used poperly

Second condition can be checked with test cases:

  1. Proper cache is used
  2. Improper cache is not used.

You test only TC2. I suggest that TC1 should be checked as well,

@miskopo miskopo force-pushed the install-server-cli branch 2 times, most recently from efacd04 to b8ca378 Compare April 28, 2021 09:44
@miskopo
Copy link
Member Author

miskopo commented Apr 28, 2021

@wladich I am really sorry, but I am once again asking you for a review. I am, however, eternally grateful for what you do.

@miskopo
Copy link
Member Author

miskopo commented Apr 29, 2021

as seen in failed temp commit, klist doesn't use KEYRING, but KCM in this particular situation.

@miskopo miskopo force-pushed the install-server-cli branch 2 times, most recently from 4ca4871 to 19f21d8 Compare May 3, 2021 13:53
@miskopo miskopo added the re-run Trigger a new run of PR-CI label May 3, 2021
@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label May 3, 2021
@wladich
Copy link

wladich commented May 6, 2021

@miskopo Please do check if timeouts in prci definitions need to be adjusted.

@miskopo
Copy link
Member Author

miskopo commented May 6, 2021

@miskopo Please do check if timeouts in prci definitions need to be adjusted.

Both TestInstallMaster and TestInstallMasterDNS have plenty of extra time, more than 16 minutes in gating and more than 2 hours in nightlies.

Copy link

@wladich wladich left a comment

Choose a reason for hiding this comment

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

Please rewrite commit message to avoid GitHub from interpretting Pagure issues as GH PRs
Please see few minor issues in inline comments. Otherwise LGTM

['ipa', 'dnszone-show', self.master.domain.name]
).stdout_text

assert "Active zone: TRUE" in result
Copy link

Choose a reason for hiding this comment

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

Inconsistent usage of double quotes

'hostname', '-f']).stdout_text.strip()
assert hostname == new_hostname
finally:
# no need to restore the hostane as the installer
Copy link

Choose a reason for hiding this comment

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

Typo: "hostane" -> "hostname"

if reinstall:
tasks.install_packages(self.master, [package_name])

def test_backup_of_cs_cfg_should_be_created(self, server_cleanup):
Copy link

Choose a reason for hiding this comment

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

Same as with test_installer_wizard_prompts_for_DNS: proper form of the phrase is "test backup is created" or "test creates backup"

Copy link

@wladich wladich left a comment

Choose a reason for hiding this comment

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

Removing "LGTM". Looking through the logs I found the incorrect invocation of rpm

"""
package_name = '*ipa-server-trust-ad'
reinstall = False
if tasks.is_package_installed(self.master, package_name):
Copy link

Choose a reason for hiding this comment

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

This internaly calls 'rpm' '-q' '*ipa-server-trust-ad'. Unlike dnf the rpm does not expand wildcards and this check will allways return False

test_hostname_parameter: Test for issue 2692 ipa-server-install ignores --hostname:
check whether hostname provided in `--hostname` parameter is being taken into account and set as new hostname without prompting for it again

test_ad_subpackage_dependency: Test for issue 4011 ipa-server-install crashes when AD subpackage is not installed:
test if ipa-server installation succeeds without `freeipa-ipa-server-trust-ad` installed

test_backup_of_cs_cfg_should_be_created: Test for issue 4166 Backup CS.cfg before modifying it:
test if ipa-server installer backs up CS.cfg before modifying it

test_installer_wizard_should_prompt_for_DNS: Test for issue 2575 [RFE] Installer wizard should prompt for DNS:
test if installer is asking for DNS setup details if not provided as parameter

Related: https://pagure.io/freeipa/issue/2692
Related: https://pagure.io/freeipa/issue/4011
Related: https://pagure.io/freeipa/issue/4166
Related: https://pagure.io/freeipa/issue/2575

Signed-off-by: Michal Polovka <mpolovka@redhat.com>
@miskopo
Copy link
Member Author

miskopo commented May 6, 2021

@wladich
Copy link

wladich commented May 6, 2021

LGTM #2
Please remove the temp commit and I will ACk

@wladich wladich added ack Pull Request approved, can be merged and removed needs review Pull Request is waiting for a review labels May 6, 2021
@miskopo miskopo added ipa-4-8 Mark for backport to ipa 4.8 ipa-4-9 Mark for backport to ipa 4.9 pushed Pull Request has already been pushed labels May 6, 2021
@miskopo
Copy link
Member Author

miskopo commented May 6, 2021

master:

  • b8ebce7 ipatests: test_installation: add install test scenarios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged ipa-4-9 Mark for backport to ipa 4.9 pushed Pull Request has already been pushed
Projects
None yet
4 participants