コード例 #1
0
    def test_positive_ping(self):
        """Check if all services are running

        :id: b8ecc7ba-8007-4067-bf99-21a82c833de7

        :expectedresults: Overall and individual services status should be
            'ok'.

        """
        response = entities.Ping().search_json()
        self.assertEqual(response['status'], u'ok')  # overall status

        # Check that all services are OK. ['services'] is in this format:
        #
        # {u'services': {
        #    u'candlepin': {u'duration_ms': u'40', u'status': u'ok'},
        #    u'candlepin_auth': {u'duration_ms': u'41', u'status': u'ok'},
        #    …
        # }, u'status': u'ok'}
        services = response['services']
        if bz_bug_is_open('1325995'):
            services.pop('foreman_auth')
        self.assertTrue(
            all([service['status'] == u'ok' for service in services.values()]),
            u'Not all services seem to be up and running!')
コード例 #2
0
    def test_positive_candlepin_events_processed_by_STOMP(self):
        """Verify that Candlepin events are being read and processed by
           attaching subscriptions, validating host subscriptions status,
           and viewing processed and failed Candlepin events

        :id: efd20ffd-8f98-4536-abb6-d080f9d23169

        :steps:

            1. Add subscriptions to content host
            2. Verify subscription status is invalid at
               <your-satellite-url>/api/v2/hosts
            3. Import a Manifest
            4. Attach subs to content host
            5. Verify subscription status is valid
            6. Check ping api for processed and failed events
               /katello/api/v2/ping

        :expectedresults: Candlepin events are being read and processed
                          correctly without any failures
        :BZ: #1826515

        :CaseImportance: High
        """
        org = entities.Organization().create()
        repo = entities.Repository(product=entities.Product(
            organization=org).create()).create()
        repo.sync()
        ak = entities.ActivationKey(
            content_view=org.default_content_view,
            max_hosts=100,
            organization=org,
            environment=entities.LifecycleEnvironment(id=org.library.id),
            auto_attach=True,
        ).create()
        with VirtualMachine(distro=DISTRO_RHEL7) as vm:
            vm.install_katello_ca()
            vm.register_contenthost(org.name, ak.name)
            host = entities.Host().search(
                query={'search': f'name={vm.hostname}'})
            host_id = host[0].id
            host_content = entities.Host(id=host_id).read_json()
            assert host_content["subscription_status"] == 2
            with manifests.clone() as manifest:
                upload_manifest(org.id, manifest.content)
            subscription = entities.Subscription(organization=org).search(
                query={'search': f'name="{DEFAULT_SUBSCRIPTION_NAME}"'})[0]
            entities.HostSubscription(host=host_id).add_subscriptions(data={
                'subscriptions': [{
                    'id': subscription.cp_id,
                    'quantity': 1
                }]
            })
            host_content = entities.Host(id=host_id).read_json()
            assert host_content["subscription_status"] == 0
            response = entities.Ping().search_json(
            )["services"]["candlepin_events"]
            assert response["status"] == "ok"
            assert "0 Failed" in response["message"]
コード例 #3
0
ファイル: test_subscription.py プロジェクト: latran/robottelo
def test_positive_candlepin_events_processed_by_stomp(rhel7_contenthost,
                                                      function_org,
                                                      default_sat):
    """Verify that Candlepin events are being read and processed by
        attaching subscriptions, validating host subscriptions status,
        and viewing processed and failed Candlepin events

    :id: efd20ffd-8f98-4536-abb6-d080f9d23169

    :steps:

        1. Add subscriptions to content host
        2. Verify subscription status is invalid at
            <your-satellite-url>/api/v2/hosts
        3. Import a Manifest
        4. Attach subs to content host
        5. Verify subscription status is valid
        6. Check ping api for processed and failed events
            /katello/api/v2/ping

    :expectedresults: Candlepin events are being read and processed
                        correctly without any failures
    :BZ: 1826515

    :parametrized: yes

    :CaseImportance: High
    """
    repo = entities.Repository(product=entities.Product(
        organization=function_org).create()).create()
    repo.sync()
    ak = entities.ActivationKey(
        content_view=function_org.default_content_view,
        max_hosts=100,
        organization=function_org,
        environment=entities.LifecycleEnvironment(id=function_org.library.id),
        auto_attach=True,
    ).create()
    rhel7_contenthost.install_katello_ca(default_sat)
    rhel7_contenthost.register_contenthost(function_org.name, ak.name)
    host = entities.Host().search(
        query={'search': f'name={rhel7_contenthost.hostname}'})
    host_id = host[0].id
    host_content = entities.Host(id=host_id).read_json()
    assert host_content['subscription_status'] == 2
    with manifests.clone() as manifest:
        upload_manifest(function_org.id, manifest.content)
    subscription = entities.Subscription(organization=function_org).search(
        query={'search': f'name="{DEFAULT_SUBSCRIPTION_NAME}"'})[0]
    entities.HostSubscription(host=host_id).add_subscriptions(
        data={'subscriptions': [{
            'id': subscription.cp_id,
            'quantity': 1
        }]})
    host_content = entities.Host(id=host_id).read_json()
    assert host_content['subscription_status'] == 0
    response = entities.Ping().search_json()['services']['candlepin_events']
    assert response['status'] == 'ok'
    assert '0 Failed' in response['message']
コード例 #4
0
def test_positive_candlepin_events_processed_by_STOMP(session,
                                                      rhel7_contenthost,
                                                      target_sat):
    """Verify that Candlepin events are being read and processed by
       attaching subscriptions, validating host subscriptions status,
       and viewing processed and failed Candlepin events

    :id: 9510fd1c-2efb-4132-8665-9a72273cd1af

    :steps:

        1. Register Content Host without subscriptions attached
        2. Verify subscriptions status is red "invalid"
        3. Import a Manifest
        4. Attach subs to content host
        5. Verify subscription status is green "valid"
        6. Check for processed and failed Candlepin events

    :expectedresults: Candlepin events are being read and processed
                      correctly without any failures

    :BZ: 1826515

    :parametrized: yes

    :CaseImportance: High
    """
    org = entities.Organization().create()
    repo = entities.Repository(product=entities.Product(
        organization=org).create()).create()
    repo.sync()
    ak = entities.ActivationKey(
        content_view=org.default_content_view,
        max_hosts=100,
        organization=org,
        environment=entities.LifecycleEnvironment(id=org.library.id),
    ).create()
    rhel7_contenthost.install_katello_ca(target_sat)
    rhel7_contenthost.register_contenthost(org.name, ak.name)
    with session:
        session.organization.select(org_name=org.name)
        host = session.contenthost.read(rhel7_contenthost.hostname,
                                        widget_names='details')['details']
        assert 'Unentitled' in host['subscription_status']
        with manifests.clone() as manifest:
            upload_manifest(org.id, manifest.content)
        session.contenthost.add_subscription(rhel7_contenthost.hostname,
                                             DEFAULT_SUBSCRIPTION_NAME)
        session.browser.refresh()
        updated_sub_status = session.contenthost.read(
            rhel7_contenthost.hostname,
            widget_names='details')['details']['subscription_status']
        assert 'Fully entitled' in updated_sub_status
        response = entities.Ping().search_json(
        )['services']['candlepin_events']
        assert response['status'] == 'ok'
        assert '0 Failed' in response['message']
コード例 #5
0
ファイル: test_api_endtoend.py プロジェクト: latran/robottelo
    def test_positive_ping(self):
        """Check if all services are running

        :id: b8ecc7ba-8007-4067-bf99-21a82c833de7

        :expectedresults: Overall and individual services status should be
            'ok'.
        """
        response = entities.Ping().search_json()
        assert response['status'] == 'ok'  # overall status

        # Check that all services are OK. ['services'] is in this format:
        #
        # {'services': {
        #    'candlepin': {'duration_ms': '40', 'status': 'ok'},
        #    'candlepin_auth': {'duration_ms': '41', 'status': 'ok'},
        #    …
        # }, 'status': 'ok'}
        services = response['services']
        assert all([
            service['status'] == 'ok' for service in services.values()
        ]), 'Not all services seem to be up and running!'
コード例 #6
0
    def test_positive_ping(self):
        """Check if all services are running

        @Feature: Smoke Test

        @Assert: Overall and individual services status should be 'ok'.

        """
        response = entities.Ping().search_json()
        self.assertEqual(response['status'], u'ok')  # overall status

        # Check that all services are OK. ['services'] is in this format:
        #
        # {u'services': {
        #    u'candlepin': {u'duration_ms': u'40', u'status': u'ok'},
        #    u'candlepin_auth': {u'duration_ms': u'41', u'status': u'ok'},
        #    …
        # }, u'status': u'ok'}
        services = response['services']
        self.assertTrue(
            all([service['status'] == u'ok' for service in services.values()]),
            u'Not all services seem to be up and running!')