Skip to content

Commit

Permalink
Coverage:Bug 2158702 (#13735)
Browse files Browse the repository at this point in the history
* Coverage:Bug 2158702

* Update test_esx_sca.py

Update the password to use gen_string('alpha')

(cherry picked from commit 1c4a1a7)
  • Loading branch information
yanpliu authored and web-flow committed Feb 8, 2024
1 parent 1364cd6 commit 3be071b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/foreman/virtwho/ui/test_esx_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,3 +619,34 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters(
)
org_session.virtwho_configure.delete(name)
assert not org_session.virtwho_configure.search(name)

@pytest.mark.tier2
def test_positive_hypervisor_password_option(
self, module_sca_manifest_org, virtwho_config_ui, org_session, form_data_ui
):
"""Verify Hypervisor password.
:id: 8362955a-4daa-4332-9559-b526d9095a61
:expectedresults:
hypervisor_password has been set in virt-who-config-{}.conf
hypervisor_password has been encrypted in satellite WEB UI Edit page
hypervisor_password has been encrypted in satellite WEB UI Details page
:CaseImportance: Medium
:BZ: 2256927
"""
name = form_data_ui['name']
config_id = get_configure_id(name)
config_command = get_configure_command(config_id, module_sca_manifest_org.name)
deploy_configure_by_command(
config_command, form_data_ui['hypervisor_type'], org=module_sca_manifest_org.label
)
config_file = get_configure_file(config_id)
assert get_configure_option('encrypted_password', config_file)
res = org_session.virtwho_configure.read_edit(name)
assert 'encrypted-' in res['hypervisor_content']['password']
org_session.virtwho_configure.edit(name, {'hypervisor_password': gen_string('alpha')})
results = org_session.virtwho_configure.read(name)
assert 'encrypted_password=$cr_password' in results['deploy']['script']

0 comments on commit 3be071b

Please sign in to comment.