Beispiel #1
0
def test_positive_add_host_collections(module_org):
    """Associate an activation key with several host collections.

    :id: 1538808c-621e-4cf9-9b9b-840c5dd54644

    :expectedresults:

        1. By default, an activation key is associated with no host
           collections.
        2. After associating an activation key with some set of host
           collections and reading that activation key, the correct host
           collections are listed.

    :CaseLevel: Integration

    :CaseImportance: Critical
    """
    # An activation key has no host collections by default.
    act_key = entities.ActivationKey(organization=module_org).create()
    assert len(act_key.host_collection) == 0

    # Give activation key one host collection.
    act_key.host_collection.append(
        entities.HostCollection(organization=module_org).create())
    act_key = act_key.update(['host_collection'])
    assert len(act_key.host_collection) == 1

    # Give activation key second host collection.
    act_key.host_collection.append(
        entities.HostCollection(organization=module_org).create())
    act_key = act_key.update(['host_collection'])
    assert len(act_key.host_collection) == 2
Beispiel #2
0
    def test_positive_add_host_collections(self):
        """Associate an activation key with several host collections.

        :id: 1538808c-621e-4cf9-9b9b-840c5dd54644

        :expectedresults:

            1. By default, an activation key is associated with no host
               collections.
            2. After associating an activation key with some set of host
               collections and reading that activation key, the correct host
               collections are listed.

        :CaseLevel: Integration

        :CaseImportance: Critical
        """
        org = entities.Organization().create()  # re-use this to speed up test

        # An activation key has no host collections by default.
        act_key = entities.ActivationKey(organization=org).create()
        self.assertEqual(len(act_key.host_collection), 0)

        # Give activation key one host collection.
        act_key.host_collection.append(
            entities.HostCollection(organization=org).create())
        act_key = act_key.update(['host_collection'])
        self.assertEqual(len(act_key.host_collection), 1)

        # Give activation key second host collection.
        act_key.host_collection.append(
            entities.HostCollection(organization=org).create())
        act_key = act_key.update(['host_collection'])
        self.assertEqual(len(act_key.host_collection), 2)
Beispiel #3
0
    def test_pre_create_activation_key(self, activation_key_setup):
        """Before Upgrade, Creates the activation key with different entities and update their
        contents.

        :id: preupgrade-a7443b54-eb2e-497b-8a50-92abeae01496

        :steps:
            1. Create the activation key.
            2. Add subscription in the activation key.
            3: Check the subscription id of the activation key and compare it with custom_repos
            product id.
            4. Update the host collection in the activation key.

        :parametrized: yes

        :expectedresults: Activation key should be created successfully and it's subscription id
        should be same with custom repos product id.
        """
        ak = activation_key_setup['ak']
        org_subscriptions = entities.Subscription(
            organization=activation_key_setup['org']).search()
        for subscription in org_subscriptions:
            ak.add_subscriptions(data={
                'quantity': 1,
                'subscription_id': subscription.id
            })
        ak_subscriptions = ak.product_content()['results']
        subscr_id = {subscr['product']['id'] for subscr in ak_subscriptions}
        assert subscr_id == {activation_key_setup['custom_repo'].product.id}
        ak.host_collection.append(entities.HostCollection().create())
        ak.update(['host_collection'])
        assert len(ak.host_collection) == 1
Beispiel #4
0
def test_negative_install_via_custom_remote_execution(session, module_org, module_loc):
    """Test basic functionality of the Hosts collection UI install package via
    remote execution - customize first.

    :id: 5aa7f084-bab7-4e62-9bf3-a37fd4aa71fa

    :setup: Create a host collection with two fake hosts assigned.

    :expectedresults: The package is not installed, and the job invocation
        status contains some expected values: hosts information, jos status.

    :CaseLevel: Integration
    """
    hosts = []
    for _ in range(2):
        hosts.append(entities.Host(
            organization=module_org, location=module_loc).create())
    host_collection = entities.HostCollection(
        host=[host.id for host in hosts],
        organization=module_org,
    ).create()
    with session:
        job_values = session.hostcollection.manage_packages(
            host_collection.name,
            packages=FAKE_0_CUSTOM_PACKAGE_NAME,
            action='install',
            action_via='via remote execution - customize first',
        )
        assert job_values['job_status'] == 'Failed'
        assert job_values['job_status_progress'] == '100%'
        assert int(job_values['total_hosts']) == len(hosts)
        assert ({host.name for host in hosts}
                == {host['Host'] for host in job_values['hosts_table']})
    def test_positive_create_with_host_collection(self):
        """Create Activation key with Host Collection

        @Feature: Activation key - Positive Create

        @Assert: Activation key is created
        """
        name = gen_string(str_type='alpha')
        # create Host Collection using API
        host_col = entities.HostCollection(
            organization=self.organization,
            name=gen_string(str_type='utf8'),
        ).create()

        with Session(self.browser) as session:
            make_activationkey(
                session,
                org=self.organization.name,
                name=name,
                env=ENVIRONMENT,
            )
            self.assertIsNotNone(self.activationkey.search(name))
            # add Host Collection
            self.activationkey.add_host_collection(name, host_col.name)
            self.assertIsNotNone(
                self.activationkey.find_element(
                    common_locators['alert.success']))

            # check added host collection is listed
            self.activationkey.click(tab_locators['ak.host_collections.list'])
            strategy, value = tab_locators['ak.host_collections.add.select']
            host_collection = self.activationkey.wait_until_element(
                (strategy, value % host_col.name))
            self.assertIsNotNone(host_collection)
    def test_positive_remove_host_collection(self):
        """Disassociate host collection from the activation key

        :id: 31992ac4-fe55-45bb-bd17-a191928ec2ab

        :expectedresults:

            1. By default, an activation key is associated with no host
               collections.
            2. Associating host collection with activation key add it to the
               list.
            3. Disassociating host collection from the activation key actually
               removes it from the list

        :CaseLevel: Integration

        :CaseImportance: Critical
        """
        org = entities.Organization().create()

        # An activation key has no host collections by default.
        act_key = entities.ActivationKey(organization=org).create()
        self.assertEqual(len(act_key.host_collection), 0)

        host_collection = entities.HostCollection(organization=org).create()

        # Associate host collection with activation key.
        act_key.add_host_collection(data={'host_collection_ids': [host_collection.id]})
        self.assertEqual(len(act_key.read().host_collection), 1)

        # Disassociate host collection from the activation key.
        act_key.remove_host_collection(data={'host_collection_ids': [host_collection.id]})
        self.assertEqual(len(act_key.read().host_collection), 0)
Beispiel #7
0
    def test_positive_add_subscription(self):
        """Try to bulk add a subscription to members of a host collection.

        :id: c4ec5727-eb25-452e-a91f-87cafb16666b

        :steps:

            1. Create a new or use an existing subscription
            2. Add the subscription to the members of the host collection

        :expectedresults: The subscription was added to hosts in the host collection

        :CaseImportance: Critical
        """
        # Create an activate key for this test
        act_key = entities.ActivationKey(content_view=self.content_view,
                                         environment=self.lce,
                                         organization=self.org).create()
        # this command creates a host collection and "appends", makes available, to the AK
        act_key.host_collection.append(
            entities.HostCollection(organization=self.org).create())
        # Move HC from Add tab to List tab on AK view
        act_key = act_key.update(['host_collection'])
        # Create a product to be bulk added to members of Host Collection
        product = entities.Product(organization=self.org).create()
        prod_name = product.name
        product_subscription = entities.Subscription().search(
            query={'search': f'name={prod_name}'})[0]
        with VirtualMachine(distro=DISTRO_RHEL7) as client1, VirtualMachine(
                distro=DISTRO_RHEL7) as client2:
            for client in [client1, client2]:
                client.install_katello_ca()
                client.register_contenthost(self.org.label, act_key.name)
            # Read host_collection back from Satellite to get host_ids
            host_collection = act_key.host_collection[0].read()
            host_ids = [host.id for host in host_collection.host]
            # Call nailgun to make the API PUT to members of Host Collection
            entities.Host().bulk_add_subscriptions(
                data={
                    "organization_id":
                    self.org.id,
                    "included": {
                        "ids": host_ids
                    },
                    "subscriptions": [{
                        "id": product_subscription.id,
                        "quantity": 1
                    }],
                })
            # Get the subscriptions from hosts
            for host_id in host_ids:
                req = request(
                    'GET',
                    '{0}/api/v2/hosts/{1}/subscriptions'.format(
                        settings.server.get_url(), host_id),
                    verify=False,
                    auth=settings.server.get_credentials(),
                    headers={'content-type': 'application/json'},
                )
                assert prod_name in req.text, 'Subscription not applied HC members'
Beispiel #8
0
def test_negative_install_via_remote_execution(session, module_org,
                                               smart_proxy_location):
    """Test basic functionality of the Hosts collection UI install package via
    remote execution.

    :id: c5fe46fb-0b34-4ea3-bc53-e86c18adaf94

    :setup: Create a host collection with two fake hosts assigned.

    :expectedresults: The package is not installed, and the job invocation
        status contains some expected values: hosts information, jos status.

    :CaseLevel: Integration
    """
    hosts = []
    for _ in range(2):
        hosts.append(
            entities.Host(organization=module_org,
                          location=smart_proxy_location).create())
    host_collection = entities.HostCollection(
        host=[host.id for host in hosts], organization=module_org).create()
    with session:
        job_values = session.hostcollection.manage_packages(
            host_collection.name,
            packages=constants.FAKE_0_CUSTOM_PACKAGE_NAME,
            action='install',
            action_via='via remote execution',
        )
        assert job_values['job_status'] == 'Failed'
        assert job_values['job_status_progress'] == '100%'
        assert int(job_values['total_hosts']) == len(hosts)
        assert {host.name
                for host in hosts
                } == {host['Host']
                      for host in job_values['hosts_table']}
Beispiel #9
0
def test_positive_list_for_organization():
    """Create host collection for specific organization. Retrieve list of
    host collections for that organization

    :id: 5f9de8ab-2c53-401b-add3-57d86c97563a

    :expectedresults: The host collection was successfully created and
        present in the list of collections for specific organization

    :CaseImportance: Critical
    """
    org = entities.Organization().create()
    hc = entities.HostCollection(organization=org).create()
    hc_list = entities.HostCollection(organization=org).search()
    assert len(hc_list) == 1
    assert hc_list[0].id == hc.id
Beispiel #10
0
def vm_host_collection_module_stream(module_org, vm_content_hosts_module_stream):
    host_ids = [
        entities.Host().search(query={'search': f'name={host.hostname}'})[0].id
        for host in vm_content_hosts_module_stream
    ]
    host_collection = entities.HostCollection(host=host_ids, organization=module_org).create()
    return host_collection
Beispiel #11
0
def test_positive_host_collections(session):
    """Check if the Host Collections widget displays list of host
    collection in UI

    :id: 1feae601-987d-4553-8644-4ceef5059e64

    :Steps:

        1. Make sure to have some hosts and host collections
        2. Navigate Monitor -> Dashboard
        3. Review the Host Collections Widget

    :expectedresults: The list of host collections along with content host
        is displayed in the widget

    :CaseLevel: Integration
    """
    org = entities.Organization().create()
    loc = entities.Location().create()
    host = entities.Host(organization=org, location=loc).create()
    host_collection = entities.HostCollection(
        host=[host], organization=org).create()
    with session:
        session.organization.select(org_name=org.name)
        session.location.select(loc_name=loc.name)
        values = session.dashboard.read('HostCollections')
        assert values['collections'][0]['Name'] == host_collection.name
        assert values['collections'][0]['Content Hosts'] == '1'
    def test_pre_create_activation_key(self):
        """Activation key with different entities are created

        :id: preupgrade-a7443b54-eb2e-497b-8a50-92abeae01496

        :steps: In Preupgrade Satellite, Create activation key with different entities.

        :expectedresults: Activation key should create successfully.
        """
        org = entities.Organization(name=self.org_name).create()
        custom_repo = entities.Repository(product=entities.Product(
            organization=org).create()).create()
        custom_repo.sync()
        cv = entities.ContentView(organization=org,
                                  repository=[custom_repo.id],
                                  name=self.cv_name).create()
        cv.publish()
        ak = entities.ActivationKey(content_view=cv,
                                    organization=org,
                                    name=self.ak_name).create()
        org_subscriptions = entities.Subscription(organization=org).search()
        for subscription in org_subscriptions:
            ak.add_subscriptions(data={
                'quantity': 1,
                'subscription_id': subscription.id
            })
        ak_subscriptions = ak.product_content()['results']
        self.assertEqual(
            {custom_repo.product.id},
            {subscr['product']['id']
             for subscr in ak_subscriptions})
        ak.host_collection.append(entities.HostCollection().create())
        ak.update(['host_collection'])
        self.assertEqual(len(ak.host_collection), 1)
Beispiel #13
0
def test_positive_add_host_collection_non_admin(module_org, test_name):
    """Test that host collection can be associated to Activation Keys by
    non-admin user.

    :id: 417f0b36-fd49-4414-87ab-6f72a09696f2

    :expectedresults: Activation key is created, added host collection is
        listed

    :BZ: 1473212

    :CaseLevel: Integration
    """
    ak_name = gen_string('alpha')
    hc = entities.HostCollection(organization=module_org).create()
    # Create non-admin user with specified permissions
    roles = [entities.Role().create()]
    user_permissions = {
        'Katello::ActivationKey': PERMISSIONS['Katello::ActivationKey'],
        'Katello::HostCollection': PERMISSIONS['Katello::HostCollection'],
    }
    viewer_role = entities.Role().search(query={'search': 'name="Viewer"'})[0]
    roles.append(viewer_role)
    create_role_permissions(roles[0], user_permissions)
    password = gen_string('alphanumeric')
    user = entities.User(
        admin=False, role=roles, password=password, organization=[module_org]
    ).create()
    with Session(test_name, user=user.login, password=password) as session:
        session.activationkey.create({'name': ak_name, 'lce': {ENVIRONMENT: True}})
        assert session.activationkey.search(ak_name)[0]['Name'] == ak_name
        session.activationkey.add_host_collection(ak_name, hc.name)
        ak = session.activationkey.read(ak_name, widget_names='host_collections')
        assert ak['host_collections']['resources']['assigned'][0]['Name'] == hc.name
Beispiel #14
0
    def test_positive_host_collections(self):
        """Check if the Host Collections widget displays list of host
        collection in UI

        :id: 1feae601-987d-4553-8644-4ceef5059e64

        :Steps:

            1. Make sure to have some hosts and host collections
            2. Navigate Monitor -> Dashboard
            3. Review the Host Collections Widget

        :expectedresults: The list of host collections along with content host
            is displayed in the widget

        :CaseLevel: Integration
        """
        org = entities.Organization().create()
        host = entities.Host(organization=org).create()
        host_collection = entities.HostCollection(
            host=[host],
            organization=org,
        ).create()
        with Session(self.browser) as session:
            set_context(session, org=org.name)
            self.assertEqual(
                self.dashboard.get_hc_host_count(host_collection.name),
                1
            )
Beispiel #15
0
def test_positive_list(module_org):
    """Create new host collection and then retrieve list of all existing
    host collections

    :id: 6ae32df2-b917-4830-8709-15fb272b76c1

    :BZ: 1331875

    :expectedresults: Returned list of host collections for the system
        contains at least one collection

    :CaseImportance: Critical
    """
    entities.HostCollection(organization=module_org).create()
    hc_list = entities.HostCollection().search()
    assert len(hc_list) >= 1
Beispiel #16
0
 def setUp(self):
     """Create VMs, subscribe them to satellite-tools repo, install
     katello-ca and katello-agent packages, then create Host collection,
     associate it with previously created hosts.
     """
     super(HostCollectionPackageManagementTest, self).setUp()
     self.hosts = []
     for _ in range(self.hosts_number):
         client = VirtualMachine(distro=DISTRO_RHEL7)
         self.hosts.append(client)
         client.create()
         client.install_katello_ca()
         result = client.register_contenthost(self.session_org.label,
                                              self.activation_key.name)
         self.assertEqual(result.return_code, 0)
         client.enable_repo(REPOS['rhst7']['id'])
         client.install_katello_agent()
     host_ids = [
         entities.Host().search(
             query={'search': 'name={0}'.format(host.hostname)})[0].id
         for host in self.hosts
     ]
     self.host_collection = entities.HostCollection(
         host=host_ids,
         organization=self.session_org,
     ).create()
def test_post_crud_activation_key(request):
    """After Upgrade, Activation keys entities remain the same and all their functionality works.

    :id: postupgrade-a7443b54-eb2e-497b-8a50-92abeae01496

    :steps:
        1. Postupgrade, Verify activation key has same entities associated.
        2. Update existing activation key with new entities
        3. Delete activation key.

    :expectedresults: Activation key's entities should be same after upgrade and activation
    key update and delete should work
    """
    pre_test_name = [
        mark.kwargs['depend_on'].__name__ for mark in request.node.own_markers
        if 'depend_on' in mark.kwargs
    ][0]

    org = entities.Organization().search(
        query={'search': f'name={pre_test_name}_org'})
    ak = entities.ActivationKey(organization=org[0]).search(
        query={'search': f'name={pre_test_name}_ak'})
    cv = entities.ContentView(organization=org[0]).search(
        query={'search': f'name={pre_test_name}_cv'})
    assert pre_test_name + '_ak' == ak[0].name
    assert pre_test_name + '_cv' == cv[0].name
    ak[0].host_collection.append(entities.HostCollection().create())
    ak[0].update(['host_collection'])
    assert len(ak[0].host_collection) == 2
    custom_repo2 = entities.Repository(product=entities.Product(
        organization=org[0]).create()).create()
    custom_repo2.sync()
    cv2 = entities.ContentView(organization=org[0],
                               repository=[custom_repo2.id]).create()
    cv2.publish()
    org_subscriptions = entities.Subscription(organization=org[0]).search()
    for subscription in org_subscriptions:
        provided_products_ids = [
            prod.id for prod in subscription.read().provided_product
        ]
        if custom_repo2.product.id in provided_products_ids:
            ak[0].add_subscriptions(data={
                'quantity': 1,
                'subscription_id': subscription.id
            })
    ak_subscriptions = ak[0].product_content()['results']
    assert custom_repo2.product.id in {
        subscr['product']['id']
        for subscr in ak_subscriptions
    }
    ak[0].delete()
    with pytest.raises(HTTPError):
        entities.ActivationKey(id=ak[0].id).read()
    for cv_object in [cv2, cv[0]]:
        cv_contents = cv_object.read_json()
        cv_object.delete_from_environment(cv_contents['environments'][0]['id'])
        cv_object.delete(cv_object.organization.id)
    custom_repo2.delete()
    org[0].delete()
def vm_host_collection(module_org, vm_content_hosts):
    host_ids = [
        entities.Host().search(
            query={'search': 'name={0}'.format(host.hostname)})[0].id
        for host in vm_content_hosts
    ]
    host_collection = entities.HostCollection(
        host=host_ids, organization=module_org).create()
    return host_collection
    def test_post_crud_activation_key(self):
        """Activation key is intact post upgrade and update/delete activation key works

        :id: postupgrade-a7443b54-eb2e-497b-8a50-92abeae01496

        :steps:

            1. Postupgrade, Verify activation key has same entities associated.
            2. Update existing activation key with new entities
            3. Delete activation key.

        :expectedresults: Activation key should update and delete successfully.
        """
        org = entities.Organization().search(
            query={'search': f'name={self.org_name}'})
        ak = entities.ActivationKey(organization=org[0]).search(
            query={'search': f'name={self.ak_name}'})
        cv = entities.ContentView(organization=org[0]).search(
            query={'search': f'name={self.cv_name}'})

        # verify activation key is intact after upgrade
        self.assertEqual(self.ak_name, ak[0].name)
        self.assertEqual(self.cv_name, cv[0].name)

        # update activation key after upgrade
        ak[0].host_collection.append(entities.HostCollection().create())
        ak[0].update(['host_collection'])
        self.assertEqual(len(ak[0].host_collection), 2)
        custom_repo2 = entities.Repository(product=entities.Product(
            organization=org[0]).create()).create()
        custom_repo2.sync()
        cv2 = entities.ContentView(organization=org[0],
                                   repository=[custom_repo2.id]).create()
        cv2.publish()
        org_subscriptions = entities.Subscription(organization=org[0]).search()
        for subscription in org_subscriptions:
            provided_products_ids = [
                prod.id for prod in subscription.read().provided_product
            ]
            if custom_repo2.product.id in provided_products_ids:
                ak[0].add_subscriptions(data={
                    'quantity': 1,
                    'subscription_id': subscription.id
                })
        ak_subscriptions = ak[0].product_content()['results']
        self.assertIn(custom_repo2.product.id,
                      {subscr['product']['id']
                       for subscr in ak_subscriptions})

        # Delete activation key
        ak[0].delete()
        with self.assertRaises(HTTPError):
            entities.ActivationKey(id=ak[0].id).read()
    def test_positive_add_hosts(self):
        """Add hosts to host collection.

        @Feature: Host Collection

        @Assert: Hosts were added to the host collection.
        """
        host_collection = entities.HostCollection(
            organization=self.org, ).create()
        host_collection.host = self.hosts
        host_collection = host_collection.update(['host'])
        self.assertEqual(len(host_collection.host), len(self.hosts))
    def test_positive_delete(self):
        """Check if host collection can be deleted

        @id: 13a16cd2-16ce-4966-8c03-5d821edf963b

        @Assert: Host collection was successfully deleted
        """
        host_collection = entities.HostCollection(
            organization=self.org).create()
        host_collection.delete()
        with self.assertRaises(HTTPError):
            host_collection.read()
    def test_positive_add_host(self):
        """Add a host to host collection.

        @Feature: Host Collection

        @Assert: Host was added to the host collection.
        """
        host_collection = entities.HostCollection(
            organization=self.org, ).create()
        host_collection.host = [self.hosts[0]]
        host_collection = host_collection.update(['host'])
        self.assertEqual(len(host_collection.host), 1)
    def test_positive_delete(self):
        """Check if host collection can be deleted

        @Feature: Host Collection

        @Assert: Host collection was successfully deleted
        """
        host_collection = entities.HostCollection(
            organization=self.org).create()
        host_collection.delete()
        with self.assertRaises(HTTPError):
            host_collection.read()
    def test_positive_create_with_host(self):
        """Create a host collection that contains a host.

        @Feature: Host Collection

        @Assert: The host collection can be read back, and it includes one
        host.
        """
        host_collection = entities.HostCollection(
            host=[self.hosts[0]],
            organization=self.org,
        ).create()
        self.assertEqual(len(host_collection.host), 1)
    def test_positive_create_with_host(self):
        """Create a host collection that contains a host.

        @id: 9dc0ad72-58c2-4079-b1ca-2c4373472f0f

        @Assert: The host collection can be read back, and it includes one
        host.
        """
        host_collection = entities.HostCollection(
            host=[self.hosts[0]],
            organization=self.org,
        ).create()
        self.assertEqual(len(host_collection.host), 1)
    def test_positive_create_with_hosts(self):
        """Create a host collection that contains hosts.

        @id: bb8d2b42-9a8b-4c4f-ba0c-c56ae5a7eb1d

        @Assert: The host collection can be read back, and it references two
        hosts.
        """
        host_collection = entities.HostCollection(
            host=self.hosts,
            organization=self.org,
        ).create()
        self.assertEqual(len(host_collection.host), len(self.hosts))
    def test_positive_update_name(self):
        """Check if host collection name can be updated

        @id: b2dedb99-6dd7-41be-8aaa-74065c820ac6

        @Assert: Host collection name was successfully updated
        """
        host_collection = entities.HostCollection(
            organization=self.org).create()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                host_collection.name = new_name
                self.assertEqual(host_collection.update().name, new_name)
    def test_negative_create_with_invalid_name(self):
        """Try to create host collections with different invalid names

        :id: 38f67d04-a19d-4eab-a577-21b8d62c7389

        :expectedresults: The host collection was not created

        :CaseImportance: Critical
        """
        for name in invalid_values_list():
            with self.subTest(name):
                with self.assertRaises(HTTPError):
                    entities.HostCollection(name=name, organization=self.org).create()
Beispiel #29
0
def test_negative_create_with_invalid_name(module_org, name):
    """Try to create host collections with different invalid names

    :id: 38f67d04-a19d-4eab-a577-21b8d62c7389

    :parametrized: yes

    :expectedresults: The host collection was not created

    :CaseImportance: Critical
    """
    with pytest.raises(HTTPError):
        entities.HostCollection(name=name, organization=module_org).create()
Beispiel #30
0
def test_positive_delete(module_org):
    """Check if host collection can be deleted

    :id: 13a16cd2-16ce-4966-8c03-5d821edf963b

    :expectedresults: Host collection was successfully deleted

    :CaseImportance: Critical
    """
    host_collection = entities.HostCollection(organization=module_org).create()
    host_collection.delete()
    with pytest.raises(HTTPError):
        host_collection.read()