Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions conf/manifest.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ MANIFEST:
# Value of SAT_VERSION setting should be in the form "sat-X.Y", e.g. "sat-6.11"
SAT_VERSION: ""
OFFLINE_TOKEN: ""
# Manifests with simple content access enabled should not use a quantity higher than 1 for any subscription
# unless doing so is required for a test.
SUBSCRIPTION_DATA:
# NAME should be an exact match of the subscription name as listed on the Customer Portal
- NAME: ""
QUANTITY:
- NAME: ""
QUANTITY:
SIMPLE_CONTENT_ACCESS: "enabled"
URL:
TOKEN_REQUEST: "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token"
ALLOCATIONS: "https://api.access.redhat.com/management/v1/allocations"
Expand All @@ -24,7 +21,6 @@ MANIFEST:
QUANTITY:
- NAME: ""
QUANTITY:
SIMPLE_CONTENT_ACCESS: "disabled"
URL:
TOKEN_REQUEST: "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token"
ALLOCATIONS: "https://api.access.redhat.com/management/v1/allocations/"
1 change: 0 additions & 1 deletion pytest_fixtures/component/activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@ def module_ak_with_synced_repo(module_sca_manifest_org, module_target_sat):
'lifecycle-environment': 'Library',
'content-view': 'Default Organization View',
'organization-id': module_sca_manifest_org.id,
'auto-attach': False,
}
)
2 changes: 1 addition & 1 deletion pytest_fixtures/component/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def setup_content(module_target_sat, module_org):
cvv = cv.read().version[0].read()
cvv.promote(data={'environment_ids': lce.id, 'force': False})
ak = module_target_sat.api.ActivationKey(
content_view=cv, max_hosts=100, organization=org, environment=lce, auto_attach=True
content_view=cv, max_hosts=100, organization=org, environment=lce
).create()
return ak, org, custom_repo

Expand Down
1 change: 0 additions & 1 deletion pytest_fixtures/component/rh_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def rhcloud_activation_key(module_target_sat_insights, rhcloud_manifest_org):
service_level='Self-Support',
purpose_usage='test-usage',
purpose_role='test-role',
auto_attach=False,
).create()


Expand Down
4 changes: 1 addition & 3 deletions pytest_fixtures/component/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ def session_sca_manifest():
def module_extra_rhel_sca_manifest():
"""Yields a manifest in sca mode with subscriptions determined by the
'manifest_category.extra_rhel_entitlement` setting in conf/manifest.yaml."""
with Manifester(
manifest_category=settings.manifest.extra_rhel_entitlement, simple_content_access="enabled"
) as manifest:
with Manifester(manifest_category=settings.manifest.extra_rhel_entitlement) as manifest:
yield manifest


Expand Down
1 change: 0 additions & 1 deletion pytest_fixtures/core/contenthosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def katello_host_tools_host(target_sat, module_org, rhel_contenthost):
max_hosts=100,
organization=module_org,
environment=target_sat.api.LifecycleEnvironment(id=module_org.library.id),
auto_attach=True,
).create()
rhel_contenthost.register(module_org, None, ak.name, target_sat, repo_data=f'repo={repo}')
rhel_contenthost.install_katello_host_tools()
Expand Down
17 changes: 0 additions & 17 deletions robottelo/cli/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,23 +446,6 @@ def subscription_remove(cls, options=None):
cls.command_sub = 'subscription remove'
return cls.execute(cls._construct_command(options))

@classmethod
def subscription_auto_attach(cls, options=None):
"""Auto attach subscription to host
Usage::
hammer host subscription auto-attach [OPTIONS]
Options::
--host HOST_NAME Name to search by
--host-id HOST_ID
-h, --help print help
"""
cls.command_sub = 'subscription auto-attach'
return cls.execute(cls._construct_command(options))

@classmethod
def sc_params(cls, options=None):
"""List all smart class parameters
Expand Down
46 changes: 0 additions & 46 deletions robottelo/cli/simple_content_access.py

This file was deleted.

10 changes: 0 additions & 10 deletions robottelo/host_helpers/satellite_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,6 @@ def upload_manifest(self, org_id, manifest=None, interface='API', timeout=None):
)
return result

def is_sca_mode_enabled(self, org_id):
"""This method checks whether Simple Content Access (SCA) mode is enabled for a
given organization.
:param str org_id: The unique identifier of the organization to check for SCA mode.
:return: A boolean value indicating whether SCA mode is enabled or not.
:rtype: bool
"""
return self.api.Organization(id=org_id).read().simple_content_access

def publish_content_view(self, org, repo_list, name=None):
"""This method publishes the content view for a given organization and repository list.
Expand Down
5 changes: 0 additions & 5 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ def register_contenthost(
name=None,
username=settings.server.admin_username,
password=settings.server.admin_password,
auto_attach=False,
serverurl=None,
baseurl=None,
):
Expand All @@ -760,8 +759,6 @@ def register_contenthost(
:param releasever: Set a release version
:param username: a user name to register the content host with
:param password: the user password
:param auto_attach: automatically attach compatible subscriptions to
this system.
:param name: name of the system to register, defaults to the hostname
:param serverurl: name of the subscription service with which to
register the system
Expand Down Expand Up @@ -789,8 +786,6 @@ def register_contenthost(
# if no other methods are provided, we can still try user/pass
cmd += userpass
# Additional registration modifiers
if auto_attach:
cmd += ' --auto-attach'
if releasever:
cmd += f' --release {releasever}'
if force:
Expand Down
17 changes: 0 additions & 17 deletions tests/foreman/api/test_activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,23 +350,6 @@ def test_positive_remove_host_collection(module_org, module_target_sat):
assert len(act_key.read().host_collection) == 0


def test_positive_update_auto_attach(target_sat, module_org):
"""Create an activation key, then update the auto_attach
field with the inverse boolean value.
:id: ec225dad-2d27-4b37-989d-1ba2c7f74ac4
:expectedresults: The value is changed.
:CaseImportance: Critical
"""
act_key = target_sat.api.ActivationKey(organization=module_org).create()
act_key_2 = target_sat.api.ActivationKey(
id=act_key.id, organization=module_org, auto_attach=(not act_key.auto_attach)
).update(['auto_attach'])
assert act_key.auto_attach != act_key_2.auto_attach


@pytest.mark.upgrade
@pytest.mark.parametrize('name', **parametrized(valid_data_list()))
def test_positive_delete(name, target_sat):
Expand Down
61 changes: 53 additions & 8 deletions tests/foreman/api/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,19 +1075,64 @@ def test_positive_add_future_subscription_with_ak():


@pytest.mark.stubbed
def test_negative_auto_attach_future_subscription():
"""Run auto-attach on a content host, with a current and future-dated
subscription.
def test_positive_verify_files_with_pxegrub_uefi():
"""Provision a new Host and verify the tftp and dhcpd file
structure is correct
:id: 0c51c8ad-858c-44e1-8b14-8e0c52c29da1
:steps:
1. Associate a pxegrub-type provisioning template with the os
2. Create new host (can be fictive bare metal) with the above OS
and PXE loader set to Grub UEFI
3. Build the host
:expectedresults: Verify [/var/lib/tftpboot/] contains the following
dir/file structure:
grub/bootia32.efi
grtest_positive_verify_files_with_pxegrub_uefiub/bootx64.efi
grub/01-AA-BB-CC-DD-EE-FF
grub/efidefault
grub/shim.efi
And record in /var/lib/dhcpd/dhcpd.leases points to the bootloader
:CaseAutomation: NotAutomated
"""

:id: f4a6feec-baf8-40c6-acb3-474b34419a62

@pytest.mark.stubbed
def test_positive_verify_files_with_pxegrub_uefi_secureboot():
"""Provision a new Host and verify the tftp and dhcpd file structure is
correct
:id: ac4d535f-09bb-49db-b38b-90f9bad5fa19
:steps:
1. Import a manifest with a future-dated and current subscription
2. Register a content host to the organization
3. Run auto-attach on the content host
1. Associate a pxegrub-type provisioning template with the os
2. Create new host (can be fictive bare metal) with the above OS
and PXE loader set to Grub UEFI SecureBoot
3. Build the host
:expectedresults: Verify [/var/lib/tftpboot/] contains the following
dir/file structure:
grub/bootia32.efi
grub/bootx64.efi
grub/01-AA-BB-CC-DD-EE-FF
grub/efidefault
grub/shim.efi
:expectedresults: Only the current subscription was added to the host
And record in /var/lib/dhcpd/dhcpd.leases points to the bootloader
:CaseAutomation: NotAutomated
:CaseComponent: Provisioning
:Team: Rocket
"""


Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/api/test_reporttemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def setup_content(module_sca_manifest_org, module_target_sat):
cvv = cv.read().version[0].read()
cvv.promote(data={'environment_ids': lce.id, 'force': False})
ak = module_target_sat.api.ActivationKey(
content_view=cv, max_hosts=100, organization=org, environment=lce, auto_attach=True
content_view=cv, max_hosts=100, organization=org, environment=lce
).create()
all_content = ak.product_content(data={'content_access_mode_all': '1'})['results']
content_label = [repo['label'] for repo in all_content if repo['name'] == custom_repo.name][0]
Expand Down
7 changes: 0 additions & 7 deletions tests/foreman/api/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def module_ak(module_sca_manifest_org, rh_repo, custom_repo, module_target_sat):
environment=module_target_sat.api.LifecycleEnvironment(
id=module_sca_manifest_org.library.id
),
auto_attach=True,
).create()


Expand Down Expand Up @@ -227,11 +226,6 @@ def test_sca_end_to_end(
)
assert result.status == 0, f'Failed to register host: {result.stderr}'
assert rhel_contenthost.subscribed
# Check to see if Organization is in SCA Mode
assert (
target_sat.api.Organization(id=module_sca_manifest_org.id).read().simple_content_access
is True
)
# Verify that you cannot attach a subscription to an activation key in SCA Mode
subscription = target_sat.api.Subscription(organization=module_sca_manifest_org).search(
query={'search': f'name="{DEFAULT_SUBSCRIPTION_NAME}"'}
Expand Down Expand Up @@ -347,7 +341,6 @@ def test_positive_expired_SCA_cert_handling(module_sca_manifest_org, rhel_conten
max_hosts=100,
organization=module_sca_manifest_org,
environment=target_sat.api.LifecycleEnvironment(id=module_sca_manifest_org.library.id),
auto_attach=True,
).create()
# registering the content host with no content enabled/synced in the org
# should create a client SCA cert with no content
Expand Down
72 changes: 0 additions & 72 deletions tests/foreman/cli/test_activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,78 +1276,6 @@ def test_positive_copy_activationkey_and_check_content(
assert new_content[0]['name'] == REPOSET['rhst7']


def test_positive_update_autoattach_toggle(module_org, module_target_sat):
"""Update Activation key with inverse auto-attach value
:id: de3b5fb7-7963-420a-b4c9-c66e78a111dc
:steps:
1. Get the key's current auto attach value.
2. Update the key with the value's inverse.
3. Verify key was updated.
:expectedresults: Activation key is successfully copied
:CaseImportance: Critical
"""
new_ak = module_target_sat.cli_factory.make_activation_key({'organization-id': module_org.id})
current_ak_auto_attach = module_target_sat.api.ActivationKey(id=new_ak['id']).read().auto_attach
module_target_sat.cli.ActivationKey.update(
{
'auto-attach': str(not current_ak_auto_attach),
'id': new_ak['id'],
'organization-id': module_org.id,
}
)
updated_ak_auto_attach = module_target_sat.api.ActivationKey(id=new_ak['id']).read().auto_attach
assert updated_ak_auto_attach == (not current_ak_auto_attach)


def test_positive_update_autoattach(module_org, module_target_sat):
"""Update Activation key with valid auto-attach values
:id: 9e18b950-6f0f-4f82-a3ac-ef6aba950a78
:expectedresults: Activation key is successfully updated
:CaseImportance: Critical
"""
new_ak = module_target_sat.cli_factory.make_activation_key({'organization-id': module_org.id})
for new_value in ('1', '0', 'true', 'false', 'yes', 'no'):
result = module_target_sat.cli.ActivationKey.update(
{'auto-attach': new_value, 'id': new_ak['id'], 'organization-id': module_org.id}
)
assert result[0]['message'] == 'Activation key updated.'


def test_negative_update_autoattach(module_org, module_target_sat):
"""Attempt to update Activation key with bad auto-attach value
:id: 54b6f808-ff54-4e69-a54d-e1f99a4652f9
:steps:
1. Attempt to update a key with incorrect auto-attach value
2. Verify that an appropriate error message was returned
:expectedresults: Activation key is not updated. Appropriate error
shown.
:CaseImportance: Low
"""
new_ak = module_target_sat.cli_factory.make_activation_key({'organization-id': module_org.id})
with pytest.raises(CLIReturnCodeError) as exe:
module_target_sat.cli.ActivationKey.update(
{
'auto-attach': gen_string('utf8'),
'id': new_ak['id'],
'organization-id': module_org.id,
}
)
assert "'--auto-attach': value must be one of" in exe.value.stderr.lower()


@pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url')
def test_positive_content_override(module_org, module_target_sat):
"""Positive content override
Expand Down
Loading