From 5ced41e6a56d101feec2f38e68b641d8fb742807 Mon Sep 17 00:00:00 2001 From: yanpliu Date: Thu, 7 Mar 2024 04:18:15 -0500 Subject: [PATCH] add verify virt-who data is uploaded on satellite post satellite upgrade (#14260) (cherry picked from commit d7b6d8b11e74d7cf1b3341d8046202f960ce46f0) --- tests/upgrades/test_virtwho.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/upgrades/test_virtwho.py b/tests/upgrades/test_virtwho.py index ca785ab0149..3691e3a8d70 100644 --- a/tests/upgrades/test_virtwho.py +++ b/tests/upgrades/test_virtwho.py @@ -118,6 +118,8 @@ def test_pre_create_virt_who_configuration( 'hypervisor_name': hypervisor_name, 'guest_name': guest_name, 'org_id': org.id, + 'org_name': org.name, + 'org_label': org.label, } ) @@ -131,15 +133,19 @@ def test_post_crud_virt_who_configuration(self, form_data, pre_upgrade_data, tar 1. Post upgrade, Verify virt-who exists and has same status. 2. Verify the connection of the guest on Content host. 3. Verify the virt-who config-file exists. - 4. Update virt-who config with new name. - 5. Delete virt-who config. + 4. Verify Report is sent to satellite. + 5. Update virt-who config with new name. + 6. Delete virt-who config. :expectedresults: 1. virt-who config is intact post upgrade. 2. the config and guest connection have the same status. - 3. virt-who config should update and delete successfully. + 3. Report is sent to satellite. + 4. virt-who config should update and delete successfully. """ org_id = pre_upgrade_data.get('org_id') + org_name = pre_upgrade_data.get('org_name') + org_label = pre_upgrade_data.get('org_label') # Post upgrade, Verify virt-who exists and has same status. vhd = target_sat.api.VirtWhoConfig(organization_id=org_id).search( @@ -172,6 +178,18 @@ def test_post_crud_virt_who_configuration(self, form_data, pre_upgrade_data, tar config_file = get_configure_file(vhd.id) get_configure_option('hypervisor_id', config_file), + # Verify Report is sent to satellite. + command = get_configure_command(vhd.id, org=org_name) + deploy_configure_by_command( + command, form_data['hypervisor_type'], debug=True, org=org_label + ) + virt_who_instance = ( + target_sat.api.VirtWhoConfig(organization_id=org_id) + .search(query={'search': f'name={form_data["name"]}'})[0] + .status + ) + assert virt_who_instance == 'ok' + # Update virt-who config modify_name = gen_string('alpha') vhd.name = modify_name