Skip to content

Commit

Permalink
add hypervisor host and guest subscription status and mapping check m…
Browse files Browse the repository at this point in the history
…apping (#15064)

* add hypervisor host and guest subscripition status and mapping check on legacy ui

* update virt host mapping check

(cherry picked from commit 4b7e29b)
  • Loading branch information
yanpliu authored and web-flow committed May 29, 2024
1 parent b8760b9 commit ff284f4
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 10 deletions.
16 changes: 14 additions & 2 deletions tests/foreman/virtwho/ui/test_esx_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TestVirtwhoConfigforEsx:
@pytest.mark.upgrade
@pytest.mark.parametrize('deploy_type_ui', ['id', 'script'], indirect=True)
def test_positive_deploy_configure_by_id_script(
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui, default_location
):
"""Verify configure created and deployed with id.
Expand All @@ -50,12 +50,24 @@ def test_positive_deploy_configure_by_id_script(
1. Config can be created and deployed by command or script
2. No error msg in /var/log/rhsm/rhsm.log
3. Report is sent to satellite
4. Virtual sku can be generated and attached
4. Subscription Status set to 'Simple Content Access', and generate mapping in Legacy UI
5. Config can be deleted
:CaseImportance: High
"""
hypervisor_name, guest_name = deploy_type_ui
# Check virt-wh oconfig status
assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok'
# Check Hypervisor host subscription status and hypervisor host and virtual guest mapping in Legacy UI
org_session.location.select(default_location.name)
hypervisor_display_name = org_session.contenthost.search(hypervisor_name)[0]['Name']
hypervisorhost = org_session.contenthost.read_legacy_ui(hypervisor_display_name)
assert hypervisorhost['details']['subscription_status'] == 'Simple Content Access'
assert hypervisorhost['details']['virtual_guest'] == '1 Content Host'
# Check virtual guest subscription status and hypervisor host and virtual guest mapping in Legacy UI
virtualguest = org_session.contenthost.read_legacy_ui(guest_name)
assert virtualguest['details']['subscription_status'] == 'Simple Content Access'
assert virtualguest['details']['virtual_host'] == hypervisor_display_name

@pytest.mark.tier2
def test_positive_debug_option(
Expand Down
16 changes: 14 additions & 2 deletions tests/foreman/virtwho/ui/test_hyperv_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestVirtwhoConfigforHyperv:
@pytest.mark.tier2
@pytest.mark.parametrize('deploy_type_ui', ['id', 'script'], indirect=True)
def test_positive_deploy_configure_by_id_script(
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui, default_location
):
"""Verify configure created and deployed with id.
Expand All @@ -35,12 +35,24 @@ def test_positive_deploy_configure_by_id_script(
1. Config can be created and deployed by command or script
2. No error msg in /var/log/rhsm/rhsm.log
3. Report is sent to satellite
4. Virtual sku can be generated and attached
4. Subscription Status set to 'Simple Content Access', and generate mapping in Legacy UI
5. Config can be deleted
:CaseImportance: High
"""
hypervisor_name, guest_name = deploy_type_ui
# Check virt-wh oconfig status
assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok'
# Check Hypervisor host subscription status and hypervisor host and virtual guest mapping in Legacy UI
org_session.location.select(default_location.name)
hypervisor_display_name = org_session.contenthost.search(hypervisor_name)[0]['Name']
hypervisorhost = org_session.contenthost.read_legacy_ui(hypervisor_display_name)
assert hypervisorhost['details']['subscription_status'] == 'Simple Content Access'
assert hypervisorhost['details']['virtual_guest'] == '1 Content Host'
# Check virtual guest subscription status and hypervisor host and virtual guest mapping in Legacy UI
virtualguest = org_session.contenthost.read_legacy_ui(guest_name)
assert virtualguest['details']['subscription_status'] == 'Simple Content Access'
assert virtualguest['details']['virtual_host'] == hypervisor_display_name

@pytest.mark.tier2
def test_positive_hypervisor_id_option(
Expand Down
16 changes: 14 additions & 2 deletions tests/foreman/virtwho/ui/test_kubevirt_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestVirtwhoConfigforKubevirt:
@pytest.mark.tier2
@pytest.mark.parametrize('deploy_type_ui', ['id', 'script'], indirect=True)
def test_positive_deploy_configure_by_id_script(
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui, default_location
):
"""Verify configure created and deployed with id.
Expand All @@ -35,12 +35,24 @@ def test_positive_deploy_configure_by_id_script(
1. Config can be created and deployed by command or script
2. No error msg in /var/log/rhsm/rhsm.log
3. Report is sent to satellite
4. Virtual sku can be generated and attached
4. Subscription Status set to 'Simple Content Access', and generate mapping in Legacy UI
5. Config can be deleted
:CaseImportance: High
"""
hypervisor_name, guest_name = deploy_type_ui
# Check virt-wh oconfig status
assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok'
# Check Hypervisor host subscription status and hypervisor host and virtual guest mapping in Legacy UI
org_session.location.select(default_location.name)
hypervisor_display_name = org_session.contenthost.search(hypervisor_name)[0]['Name']
hypervisorhost = org_session.contenthost.read_legacy_ui(hypervisor_display_name)
assert hypervisorhost['details']['subscription_status'] == 'Simple Content Access'
assert hypervisorhost['details']['virtual_guest'] == '1 Content Host'
# Check virtual guest subscription status and hypervisor host and virtual guest mapping in Legacy UI
virtualguest = org_session.contenthost.read_legacy_ui(guest_name)
assert virtualguest['details']['subscription_status'] == 'Simple Content Access'
assert virtualguest['details']['virtual_host'] == hypervisor_display_name

@pytest.mark.tier2
def test_positive_hypervisor_id_option(
Expand Down
16 changes: 14 additions & 2 deletions tests/foreman/virtwho/ui/test_libvirt_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestVirtwhoConfigforLibvirt:
@pytest.mark.tier2
@pytest.mark.parametrize('deploy_type_ui', ['id', 'script'], indirect=True)
def test_positive_deploy_configure_by_id_script(
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui, default_location
):
"""Verify configure created and deployed with id.
Expand All @@ -35,12 +35,24 @@ def test_positive_deploy_configure_by_id_script(
1. Config can be created and deployed by command or script
2. No error msg in /var/log/rhsm/rhsm.log
3. Report is sent to satellite
4. Virtual sku can be generated and attached
4. Subscription Status set to 'Simple Content Access', and generate mapping in Legacy UI
5. Config can be deleted
:CaseImportance: High
"""
hypervisor_name, guest_name = deploy_type_ui
# Check virt-wh oconfig status
assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok'
# Check Hypervisor host subscription status and hypervisor host and virtual guest mapping in Legacy UI
org_session.location.select(default_location.name)
hypervisor_display_name = org_session.contenthost.search(hypervisor_name)[0]['Name']
hypervisorhost = org_session.contenthost.read_legacy_ui(hypervisor_display_name)
assert hypervisorhost['details']['subscription_status'] == 'Simple Content Access'
assert hypervisorhost['details']['virtual_guest'] == '1 Content Host'
# Check virtual guest subscription status and hypervisor host and virtual guest mapping in Legacy UI
virtualguest = org_session.contenthost.read_legacy_ui(guest_name)
assert virtualguest['details']['subscription_status'] == 'Simple Content Access'
assert virtualguest['details']['virtual_host'] == hypervisor_display_name

@pytest.mark.tier2
def test_positive_hypervisor_id_option(
Expand Down
17 changes: 15 additions & 2 deletions tests/foreman/virtwho/ui/test_nutanix_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TestVirtwhoConfigforNutanix:
@pytest.mark.tier2
@pytest.mark.parametrize('deploy_type_ui', ['id', 'script'], indirect=True)
def test_positive_deploy_configure_by_id_script(
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui
self, module_sca_manifest_org, org_session, form_data_ui, deploy_type_ui, default_location
):
"""Verify configure created and deployed with id.
Expand All @@ -39,11 +39,24 @@ def test_positive_deploy_configure_by_id_script(
1. Config can be created and deployed by command or script
2. No error msg in /var/log/rhsm/rhsm.log
3. Report is sent to satellite
4. Config can be deleted
4. Subscription Status set to 'Simple Content Access', and generate mapping in Legacy UI
5. Config can be deleted
:CaseImportance: High
"""
hypervisor_name, guest_name = deploy_type_ui
# Check virt-wh oconfig status
assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok'
# Check Hypervisor host subscription status and hypervisor host and virtual guest mapping in Legacy UI
org_session.location.select(default_location.name)
hypervisor_display_name = org_session.contenthost.search(hypervisor_name)[0]['Name']
hypervisorhost = org_session.contenthost.read_legacy_ui(hypervisor_display_name)
assert hypervisorhost['details']['subscription_status'] == 'Simple Content Access'
assert hypervisorhost['details']['virtual_guest'] == '1 Content Host'
# Check virtual guest subscription status and hypervisor host and virtual guest mapping in Legacy UI
virtualguest = org_session.contenthost.read_legacy_ui(guest_name)
assert virtualguest['details']['subscription_status'] == 'Simple Content Access'
assert virtualguest['details']['virtual_host'] == hypervisor_display_name

@pytest.mark.tier2
def test_positive_hypervisor_id_option(
Expand Down

0 comments on commit ff284f4

Please sign in to comment.