diff --git a/tests/foreman/cli/test_subscription.py b/tests/foreman/cli/test_subscription.py index 93a8e93bb3f..f8278b53a84 100644 --- a/tests/foreman/cli/test_subscription.py +++ b/tests/foreman/cli/test_subscription.py @@ -18,7 +18,6 @@ import pytest from robottelo import manifests -from robottelo.cli.base import CLIReturnCodeError from robottelo.cli.factory import make_org from robottelo.cli.repository import Repository from robottelo.cli.repository_set import RepositorySet @@ -206,29 +205,6 @@ def test_positive_manifest_refresh(self): 'organization-id': self.org['id'], }) - @pytest.mark.skip_if_open("BZ:1226425") - @tier2 - def test_negative_manifest_refresh(self): - """Manifest refresh must fail with a cloned manifest - - :id: 7f40795f-7841-4063-8a43-de0325c92b1f - - :expectedresults: the refresh command returns a non-zero return code - - :BZ: 1226425 - - :CaseImportance: High - """ - self._upload_manifest(self.org['id']) - Subscription.list( - {'organization-id': self.org['id']}, - per_page=False, - ) - with self.assertRaises(CLIReturnCodeError): - Subscription.refresh_manifest({ - 'organization-id': self.org['id'], - }) - @pytest.mark.skip_if_open("BZ:1686916") @tier2 def test_positive_subscription_list(self): diff --git a/tests/foreman/ui/test_subscription.py b/tests/foreman/ui/test_subscription.py index 36673ff88cc..fbee15e9bc0 100644 --- a/tests/foreman/ui/test_subscription.py +++ b/tests/foreman/ui/test_subscription.py @@ -14,12 +14,12 @@ :Upstream: No """ +import pytest from tempfile import mkstemp from airgun.session import Session from fauxfactory import gen_string from nailgun import entities -from pytest import skip from robottelo import manifests from robottelo.api.utils import create_role_permissions @@ -49,7 +49,7 @@ pytestmark = [run_in_one_thread] if not setting_is_set('fake_manifest'): - skip('skipping tests due to missing fake_manifest settings', allow_module_level=True) + pytest.skip('skipping tests due to missing fake_manifest settings', allow_module_level=True) @tier2 @@ -190,6 +190,52 @@ def test_positive_access_with_non_admin_user_with_manifest(test_name): == DEFAULT_SUBSCRIPTION_NAME) +@tier2 +def test_positive_access_manifest_as_another_admin_user(test_name): + """Other admin users should be able to access and manage a manifest + uploaded by a different admin. + + :id: 02e319da-3b7a-4694-9164-475c2c71b9a8 + + :expectedresults: Other admin user should see/manage the manifest + + :BZ: 1669241 + + :customerscenario: true + + :CaseLevel: Integration + + :CaseImportance: High + """ + org = entities.Organization().create() + user1_password = gen_string('alphanumeric') + user1 = entities.User( + admin=True, + password=user1_password, + organization=[org], + default_organization=org, + ).create() + user2_password = gen_string('alphanumeric') + user2 = entities.User( + admin=True, + password=user2_password, + organization=[org], + default_organization=org, + ).create() + # use the first admin to upload a manifest + with Session(test_name, user=user1.login, password=user1_password) as session: + manifests.upload_manifest_locked(org.id) + assert session.subscription.has_manifest + # store subscriptions that have "Red Hat" in the name for later + rh_subs = session.subscription.search("Red Hat") + # try to view and delete the manifest with another admin + with Session(test_name, user=user2.login, password=user2_password) as session: + assert session.subscription.has_manifest + assert rh_subs == session.subscription.search("Red Hat") + session.subscription.delete_manifest(ignore_error_messages=['404 Not Found']) + assert not session.subscription.has_manifest + + @tier3 def test_positive_view_vdc_subscription_products(session): """Ensure that Virtual Datacenters subscription provided products is