From f447f16cd8d34f8cd5e058ae7f9ba43384efeb0d Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Wed, 17 Jan 2024 09:44:15 -0600 Subject: [PATCH] Add test for BZ 2139834 (#13699) * Add test for BZ 2139834 * Update test setup to create a discrete LCE, and publish/promote to there * Update test setup to create a discrete LCE, and publish/promote to there * Remove unnecessary publish (cherry picked from commit ab204d0bbe90bfcf22b0d8aaadade8d3e7df6643) --- tests/foreman/cli/test_contentview.py | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/foreman/cli/test_contentview.py b/tests/foreman/cli/test_contentview.py index 6aeea931ff7..0b4ee4041ef 100644 --- a/tests/foreman/cli/test_contentview.py +++ b/tests/foreman/cli/test_contentview.py @@ -4023,6 +4023,48 @@ def test_positive_inc_update_no_lce(self, module_org, module_product, module_tar content_view = module_target_sat.cli.ContentView.info({'id': content_view['id']}) assert '1.1' in [cvv_['version'] for cvv_ in content_view['versions']] + @pytest.mark.tier2 + def test_version_info_by_lce(self, module_org, module_target_sat): + """Hammer version info can be passed the lce id/name argument without error + + :id: 6ab0c46c-c62a-488b-a30f-5500d6c7ec96 + + :steps: + 1. Lookup CV version info passing the lce id as an argument + + :expectedresults: LCE is able to be passed to version info command without error + + :BZ: 2139834 + + :customerscenario: true + """ + content_view = module_target_sat.cli_factory.make_content_view( + {'organization-id': module_org.id} + ) + module_target_sat.cli.ContentView.publish({'id': content_view['id']}) + lce = module_target_sat.cli_factory.make_lifecycle_environment( + {'organization-id': module_org.id} + ) + module_target_sat.cli.ContentView.version_promote( + {'id': content_view['id'], 'to-lifecycle-environment-id': lce['id']} + ) + content_view = module_target_sat.cli.ContentView.version_info( + { + 'id': content_view['id'], + 'lifecycle-environment-id': lce['id'], + 'organization-id': module_org.id, + } + ) + assert content_view['version'] == '1.0' + content_view = module_target_sat.cli.ContentView.version_info( + { + 'id': content_view['id'], + 'lifecycle-environment': lce['name'], + 'organization-id': module_org.id, + } + ) + assert content_view['version'] == '1.0' + class TestContentViewFileRepo: """Specific tests for Content Views with File Repositories containing