Skip to content

Commit

Permalink
Merge pull request SatelliteQE#7452 from JacobCallahan/1669241
Browse files Browse the repository at this point in the history
Coverage for BZ 1669241
  • Loading branch information
rochacbruno authored Nov 7, 2019
2 parents 9815b9f + 761ef73 commit 72e544f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 26 deletions.
24 changes: 0 additions & 24 deletions tests/foreman/cli/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
50 changes: 48 additions & 2 deletions tests/foreman/ui/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 72e544f

Please sign in to comment.