Skip to content

Instantly share code, notes, and snippets.

@rplevka
Created February 3, 2022 13:25
Show Gist options
  • Save rplevka/acb3df812b2ec0f950ef4eec81a0378f to your computer and use it in GitHub Desktop.
Save rplevka/acb3df812b2ec0f950ef4eec81a0378f to your computer and use it in GitHub Desktop.

Revisions

  1. rplevka created this gist Feb 3, 2022.
    51 changes: 51 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    @pytest.fixture(scope='function')
    def rh_repo(module_manifest_org, rhel_contenthost):
    # rh_major = rhel_contenthost.os_version.major
    rh_major = 8
    # the rhel version of the enabled reposet does not matter to us
    rh_repo_id = enable_rhrepo_and_fetchid(
    basearch='x86_64',
    org_id=module_manifest_org.id,
    product=PRDS[f'rhel{rh_major if rh_major > 7 else ""}'],
    repo=REPOS['rhst7']['name'],
    reposet=REPOSET[f'rhst{rh_major}'],
    releasever=None,
    )
    rh_repo = entities.Repository(id=rh_repo_id).read()
    rh_repo.sync()
    return rh_repo


    @pytest.fixture(scope='function')
    def ak(module_manifest_org, rh_repo, custom_repo):
    """rh_repo and custom_repo are included here to ensure their execution before the AK"""
    ak = entities.ActivationKey(
    content_view=module_manifest_org.default_content_view,
    max_hosts=100,
    organization=module_manifest_org,
    environment=entities.LifecycleEnvironment(id=module_manifest_org.library.id),
    auto_attach=True,
    ).create()
    return ak

    # test:

    @pytest.mark.tier2
    @pytest.mark.pit_client
    @pytest.mark.pit_server
    @pytest.mark.rhel_ver_list([8])
    def test_sca_end_to_end(ak, rhel_contenthost, module_manifest_org, rh_repo, custom_repo, default_sat):
    """Perform end to end testing for Simple Content Access Mode

    :id: c6c4b68c-a506-46c9-bd1d-22e4c1926ef8

    :BZ: 1890643, 1890661, 1890664

    :expectedresults: All tests pass and clients have access
    to repos without needing to add subscriptions

    :parametrized: yes

    :CaseImportance: Critical
    """
    ...