Exemple #1
0
def test_positive_update_to_unlimited_hosts(module_org):
    """Create Host Collection with a limit and update it to unlimited hosts

    :id: d688fd4a-88eb-484e-9e90-854e0595edd0

    :expectedresults: Host Collection is created and updated to unlimited hosts

    :CaseImportance: High
    """
    host_collection = make_host_collection({
        'max-hosts': 1,
        'organization-id': module_org.id,
    })
    result = HostCollection.info({
        'name': host_collection['name'],
        'organization-id': module_org.id
    })
    assert result['limit'] == '1'
    HostCollection.update({
        'name': host_collection['name'],
        'organization-id': module_org.id,
        'unlimited-hosts': True,
    })
    result = HostCollection.info({
        'name': host_collection['name'],
        'organization-id': module_org.id
    })
    assert result['limit'] == 'None'
    def test_positive_update_name(self):
        """Check if host collection name can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and name is updated

        """
        new_host_col = self._new_host_collection()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                HostCollection.update({"id": new_host_col["id"], "name": new_name, "organization-id": self.org["id"]})
                result = HostCollection.info({"id": new_host_col["id"]})
                self.assertEqual(result["name"], new_name)
def test_positive_update_limit(module_org):
    """Check if host collection limits can be updated

    :id: 4c0e0c3b-82ac-4aa2-8378-6adc7946d4ec

    :expectedresults: Host collection limits is updated

    :BZ: 1245334

    :CaseImportance: Critical
    """
    new_host_col = make_host_collection({'organization-id': module_org.id})
    for limit in ('3', '6', '9', '12', '15', '17', '19'):
        HostCollection.update({'id': new_host_col['id'], 'max-hosts': limit, 'unlimited-hosts': 0})
        result = HostCollection.info({'id': new_host_col['id']})
        assert result['limit'] == limit
    def test_positive_update_description(self):
        """Check if host collection description can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and description is updated

        """
        new_host_col = self._new_host_collection()
        for desc in valid_data_list():
            with self.subTest(desc):
                HostCollection.update(
                    {"description": desc, "id": new_host_col["id"], "organization-id": self.org["id"]}
                )
                result = HostCollection.info({"id": new_host_col["id"]})
                self.assertEqual(result["description"], desc)
    def test_positive_update_1(self, test_data):
        """@Test: Check if host collection name can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and name is updated

        """

        new_host_col = self._new_host_collection()
        # Assert that name does not matches data passed
        self.assertNotEqual(new_host_col['name'], test_data['name'])

        # Update host collection
        result = HostCollection.update({
            'id': new_host_col['id'],
            'organization-id': self.org['id'],
            'name': test_data['name']
        })
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)

        # Fetch it
        result = HostCollection.info({
            'id': new_host_col['id'],
        })
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        # Assert that name matches new value
        self.assertIsNotNone(result.stdout.get('name', None))
        self.assertEqual(result.stdout['name'], test_data['name'])
        # Assert that name does not match original value
        self.assertNotEqual(new_host_col['name'], result.stdout['name'])
Exemple #6
0
    def test_positive_update_3(self, test_data):
        """
        @Test: Check if host collection limits be updated
        @Feature: Host Collection
        @Assert: Host collection limits is updated
        @BZ: 1084240
        """

        new_host_col = self._new_host_collection()

        # Update sync interval
        result = HostCollection.update({
            'id': new_host_col['id'],
            'organization-id': self.org['id'],
            'max-content-hosts': test_data
        })
        self.assertEqual(result.return_code, 0,
                         "Host collection was not updated")
        self.assertEqual(len(result.stderr), 0, "No error was expected")

        # Fetch it
        result = HostCollection.info({
            'id': new_host_col['id'],
        })
        self.assertEqual(result.return_code, 0,
                         "Host collection was not updated")
        self.assertEqual(len(result.stderr), 0, "No error was expected")
        # Assert that limit was updated
        self.assertEqual(result.stdout['max-content-hosts'], test_data,
                         "Limits don't match")
        self.assertNotEqual(new_host_col['max-content-hosts'],
                            result.stdout['max-content-hosts'],
                            "Limits don't match")
    def test_positive_update_3(self, test_data):
        """@Test: Check if host collection limits be updated

        @Feature: Host Collection

        @Assert: Host collection limits is updated

        @BZ: 1245334

        """

        new_host_col = self._new_host_collection()

        # Update sync interval
        result = HostCollection.update({
            'id': new_host_col['id'],
            'organization-id': self.org['id'],
            'max-content-hosts': test_data
        })
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)

        # Fetch it
        result = HostCollection.info({
            'id': new_host_col['id'],
        })
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        # Assert that limit was updated
        self.assertEqual(result.stdout['limit'], test_data)
        self.assertNotEqual(
            new_host_col['limit'],
            result.stdout['limit']
        )
Exemple #8
0
    def test_positive_update_2(self, test_data):
        """
        @Test: Check if host collection description can be updated
        @Feature: Host Collection
        @Assert: Host collection is created and description is updated
        @BZ: 1084240
        """

        new_host_col = self._new_host_collection()
        # Assert that description does not match data passed
        self.assertNotEqual(
            new_host_col['description'],
            test_data['description'],
            "Descriptions should not match"
        )

        # Update sync plan
        result = HostCollection.update(
            {
                'id': new_host_col['id'],
                'organization-id': self.org['id'],
                'description': test_data['description']
            }
        )
        self.assertEqual(
            result.return_code,
            0,
            "Host collection was not updated")
        self.assertEqual(
            len(result.stderr), 0, "No error was expected")

        # Fetch it
        result = HostCollection.info(
            {
                'id': new_host_col['id'],
            }
        )
        self.assertEqual(
            result.return_code,
            0,
            "Host collection was not updated")
        self.assertEqual(
            len(result.stderr), 0, "No error was expected")
        # Assert that description matches new value
        self.assertIsNotNone(
            result.stdout.get('description', None),
            "The description field was not returned"
        )
        self.assertEqual(
            result.stdout['description'],
            test_data['description'],
            "Descriptions should match"
        )
        # Assert that description does not matches original value
        self.assertNotEqual(
            new_host_col['description'],
            result.stdout['description'],
            "Descriptions should not match"
        )
Exemple #9
0
    def test_positive_update_description(self):
        """Check if host collection description can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and description is updated

        """
        new_host_col = self._new_host_collection()
        for desc in valid_data_list():
            with self.subTest(desc):
                HostCollection.update({
                    'description': desc,
                    'id': new_host_col['id'],
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['description'], desc)
    def test_positive_update_limit(self):
        """Check if host collection limits be updated

        @Feature: Host Collection

        @Assert: Host collection limits is updated

        @BZ: 1245334

        """
        new_host_col = self._new_host_collection()
        for limit in ("3", "6", "9", "12", "15", "17", "19"):
            with self.subTest(limit):
                HostCollection.update(
                    {"id": new_host_col["id"], "max-content-hosts": limit, "organization-id": self.org["id"]}
                )
                result = HostCollection.info({"id": new_host_col["id"]})
                self.assertEqual(result["limit"], limit)
    def test_positive_update_2(self):
        """@Test: Check if host collection description can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and description is updated

        """
        new_host_col = self._new_host_collection()
        for desc in valid_data_list():
            with self.subTest(desc):
                HostCollection.update({
                    'description': desc,
                    'id': new_host_col['id'],
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['description'], desc)
    def test_positive_update_1(self):
        """@Test: Check if host collection name can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and name is updated

        """
        new_host_col = self._new_host_collection()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'name': new_name,
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['name'], new_name)
Exemple #13
0
    def test_positive_update_name(self):
        """Check if host collection name can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and name is updated

        """
        new_host_col = self._new_host_collection()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'name': new_name,
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['name'], new_name)
Exemple #14
0
    def test_positive_update_name(self):
        """Check if host collection name can be updated

        @id: 10d395e6-4ac6-4c35-a78c-c59a78c55799

        @Assert: Host collection is created and name is updated

        @BZ: 1328925
        """
        new_host_col = self._new_host_collection()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'name': new_name,
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['name'], new_name)
Exemple #15
0
    def test_positive_update_description(self):
        """Check if host collection description can be updated

        @id: 298b1f86-d4ab-4e10-a948-a0034826505f

        @Assert: Host collection is created and description is updated

        @BZ: 1328925
        """
        new_host_col = self._new_host_collection()
        for desc in valid_data_list():
            with self.subTest(desc):
                HostCollection.update({
                    'description': desc,
                    'id': new_host_col['id'],
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['description'], desc)
    def test_positive_update_3(self):
        """@Test: Check if host collection limits be updated

        @Feature: Host Collection

        @Assert: Host collection limits is updated

        @BZ: 1245334

        """
        new_host_col = self._new_host_collection()
        for limit in ('3', '6', '9', '12', '15', '17', '19'):
            with self.subTest(limit):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'max-content-hosts': limit,
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['limit'], limit)
Exemple #17
0
    def test_positive_update_limit(self):
        """Check if host collection limits be updated

        @id: 4c0e0c3b-82ac-4aa2-8378-6adc7946d4ec

        @Assert: Host collection limits is updated

        @BZ: 1245334

        """
        new_host_col = self._new_host_collection()
        for limit in ('3', '6', '9', '12', '15', '17', '19'):
            with self.subTest(limit):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'max-hosts': limit,
                    'organization-id': self.org['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['limit'], limit)
Exemple #18
0
    def test_positive_update_name_by_id(self):
        """Check if host collection name can be updated by id

        :id: 10d395e6-4ac6-4c35-a78c-c59a78c55799

        :expectedresults: Host collection is created and name is updated

        :BZ: 1328925

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection(
            {'organization-id': self.organization['id']})
        for new_name in valid_data_list():
            with self.subTest(new_name):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'new-name': new_name,
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['name'], new_name)
Exemple #19
0
    def test_positive_update_description(self):
        """Check if host collection description can be updated

        :id: 298b1f86-d4ab-4e10-a948-a0034826505f

        :expectedresults: Host collection is created and description is updated

        :BZ: 1328925

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection(
            {'organization-id': self.organization['id']})
        for desc in valid_data_list():
            with self.subTest(desc):
                HostCollection.update({
                    'description': desc,
                    'id': new_host_col['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['description'], desc)
    def test_positive_update_name_by_name(self):
        """Check if host collection name can be updated by name

        :id: 447a7602-a017-4b08-b2f2-10ac868b3fee

        :expectedresults: Host collection is created and name is updated

        :BZ: 1328925

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection({
            'organization-id': self.organization['id']})
        new_name = gen_string('alphanumeric')
        HostCollection.update({
            'name': new_host_col['name'],
            'new-name': new_name,
            'organization-id': self.organization['id']
        })
        result = HostCollection.info({'id': new_host_col['id']})
        self.assertEqual(result['name'], new_name)
    def test_positive_update_name_by_id(self):
        """Check if host collection name can be updated by id

        :id: 10d395e6-4ac6-4c35-a78c-c59a78c55799

        :expectedresults: Host collection is created and name is updated

        :BZ: 1328925

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection({
            'organization-id': self.organization['id']})
        for new_name in valid_data_list():
            with self.subTest(new_name):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'new-name': new_name,
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['name'], new_name)
    def test_positive_update_description(self):
        """Check if host collection description can be updated

        :id: 298b1f86-d4ab-4e10-a948-a0034826505f

        :expectedresults: Host collection is created and description is updated

        :BZ: 1328925

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection({
            'organization-id': self.organization['id']})
        for desc in valid_data_list():
            with self.subTest(desc):
                HostCollection.update({
                    'description': desc,
                    'id': new_host_col['id'],
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['description'], desc)
Exemple #23
0
    def test_positive_update_limit(self):
        """Check if host collection limits can be updated

        :id: 4c0e0c3b-82ac-4aa2-8378-6adc7946d4ec

        :expectedresults: Host collection limits is updated

        :BZ: 1245334

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection(
            {'organization-id': self.organization['id']})
        for limit in ('3', '6', '9', '12', '15', '17', '19'):
            with self.subTest(limit):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'max-hosts': limit,
                    'unlimited-hosts': 0,
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['limit'], limit)
    def test_positive_update_limit(self):
        """Check if host collection limits can be updated

        :id: 4c0e0c3b-82ac-4aa2-8378-6adc7946d4ec

        :expectedresults: Host collection limits is updated

        :BZ: 1245334

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection({
            'organization-id': self.organization['id']})
        for limit in ('3', '6', '9', '12', '15', '17', '19'):
            with self.subTest(limit):
                HostCollection.update({
                    'id': new_host_col['id'],
                    'max-hosts': limit,
                    'unlimited-hosts': 0,
                })
                result = HostCollection.info({'id': new_host_col['id']})
                self.assertEqual(result['limit'], limit)
Exemple #25
0
    def test_positive_update_3(self, test_data):
        """@Test: Check if host collection limits be updated

        @Feature: Host Collection

        @Assert: Host collection limits is updated

        @BZ: 1084240

        """

        new_host_col = self._new_host_collection()

        # Update sync interval
        result = HostCollection.update(
            {
                'id': new_host_col['id'],
                'organization-id': self.org['id'],
                'max-content-hosts': test_data
            }
        )
        self.assertEqual(
            result.return_code,
            0,
            "Host collection was not updated")
        self.assertEqual(
            len(result.stderr), 0, "No error was expected")

        # Fetch it
        result = HostCollection.info(
            {
                'id': new_host_col['id'],
            }
        )
        self.assertEqual(
            result.return_code,
            0,
            "Host collection was not updated")
        self.assertEqual(
            len(result.stderr), 0, "No error was expected")
        # Assert that limit was updated
        self.assertEqual(
            result.stdout['max-content-hosts'],
            test_data,
            "Limits don't match"
        )
        self.assertNotEqual(
            new_host_col['max-content-hosts'],
            result.stdout['max-content-hosts'],
            "Limits don't match"
        )
Exemple #26
0
    def test_positive_update_name_by_name(self):
        """Check if host collection name can be updated by name

        :id: 447a7602-a017-4b08-b2f2-10ac868b3fee

        :customerscenario: true

        :expectedresults: Host collection is created and name is updated

        :BZ: 1328925

        :CaseImportance: Critical
        """
        new_host_col = make_host_collection(
            {'organization-id': self.organization['id']})
        new_name = gen_string('alphanumeric')
        HostCollection.update({
            'name': new_host_col['name'],
            'new-name': new_name,
            'organization-id': self.organization['id']
        })
        result = HostCollection.info({'id': new_host_col['id']})
        self.assertEqual(result['name'], new_name)
    def test_positive_update_2(self, test_data):
        """@Test: Check if host collection description can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and description is updated

        @BZ: 1171669

        """

        new_host_col = self._new_host_collection()
        # Assert that description does not match data passed
        self.assertNotEqual(new_host_col['description'],
                            test_data['description'],
                            "Descriptions should not match")

        # Update sync plan
        result = HostCollection.update({
            'id': new_host_col['id'],
            'organization-id': self.org['id'],
            'description': test_data['description']
        })
        self.assertEqual(result.return_code, 0,
                         "Host collection was not updated")
        self.assertEqual(len(result.stderr), 0, "No error was expected")

        # Fetch it
        result = HostCollection.info({
            'id': new_host_col['id'],
        })
        self.assertEqual(result.return_code, 0,
                         "Host collection was not updated")
        self.assertEqual(len(result.stderr), 0, "No error was expected")
        # Assert that description matches new value
        self.assertIsNotNone(result.stdout.get('description', None),
                             "The description field was not returned")
        self.assertEqual(result.stdout['description'],
                         test_data['description'], "Descriptions should match")
        # Assert that description does not matches original value
        self.assertNotEqual(new_host_col['description'],
                            result.stdout['description'],
                            "Descriptions should not match")
    def test_positive_update_1(self, test_data):
        """@Test: Check if host collection name can be updated

        @Feature: Host Collection

        @Assert: Host collection is created and name is updated

        """

        new_host_col = self._new_host_collection()
        # Assert that name does not matches data passed
        self.assertNotEqual(new_host_col['name'], test_data['name'],
                            "Names should not match")

        # Update host collection
        result = HostCollection.update({
            'id': new_host_col['id'],
            'organization-id': self.org['id'],
            'name': test_data['name']
        })
        self.assertEqual(result.return_code, 0,
                         "Host collection was not updated")
        self.assertEqual(len(result.stderr), 0, "No error was expected")

        # Fetch it
        result = HostCollection.info({
            'id': new_host_col['id'],
        })
        self.assertEqual(result.return_code, 0,
                         "Host collection was not updated")
        self.assertEqual(len(result.stderr), 0, "No error was expected")
        # Assert that name matches new value
        self.assertIsNotNone(result.stdout.get('name', None),
                             "The name field was not returned")
        self.assertEqual(result.stdout['name'], test_data['name'],
                         "Names should match")
        # Assert that name does not match original value
        self.assertNotEqual(new_host_col['name'], result.stdout['name'],
                            "Names should not match")
def test_positive_end_to_end(module_org):
    """Check if host collection can be created with name and description,
    content host can be added and removed, host collection can be listed,
    updated and deleted

    :id: 2d3b718e-6f57-4c83-aedb-15604cc8a4bd

    :expectedresults: Host collection is created and has expected name and
        description, content-host is added and removed, host collection is
        updated and deleted.

    :CaseImportance: Critical
    """
    name = list(valid_data_list().values())[0]
    desc = list(valid_data_list().values())[0]
    new_host_col = make_host_collection(
        {'description': desc, 'name': name, 'organization-id': module_org.id}
    )
    assert new_host_col['name'] == name
    assert new_host_col['description'] == desc

    # add host
    new_system = _make_fake_host_helper(module_org)
    no_of_content_host = new_host_col['total-hosts']
    HostCollection.add_host({'host-ids': new_system['id'], 'id': new_host_col['id']})
    result = HostCollection.info({'id': new_host_col['id']})
    assert result['total-hosts'] > no_of_content_host

    # list hosts
    result = HostCollection.hosts({'name': name, 'organization-id': module_org.id})
    assert new_system['name'].lower() == result[0]['name']
    # List all host collections within organization
    result = HostCollection.list({'organization': module_org.name})
    assert len(result) >= 1
    # Filter list by name
    result = HostCollection.list({'name': name, 'organization-id': module_org.id})
    assert len(result) == 1
    assert result[0]['id'] == new_host_col['id']
    # Filter list by associated host name
    result = HostCollection.list({'organization': module_org.name, 'host': new_system['name']})
    assert len(result) == 1
    assert result[0]['name'] == new_host_col['name']

    # remove host
    no_of_content_host = HostCollection.info({'id': new_host_col['id']})['total-hosts']
    HostCollection.remove_host({'host-ids': new_system['id'], 'id': new_host_col['id']})
    result = HostCollection.info({'id': new_host_col['id']})
    assert no_of_content_host > result['total-hosts']

    # update
    new_name = list(valid_data_list().values())[0]
    new_desc = list(valid_data_list().values())[0]
    HostCollection.update(
        {'description': new_desc, 'id': new_host_col['id'], 'new-name': new_name}
    )
    result = HostCollection.info({'id': new_host_col['id']})
    assert result['name'] == new_name
    assert result['description'] == new_desc

    # delete
    HostCollection.delete({'id': new_host_col['id']})
    with pytest.raises(CLIReturnCodeError):
        HostCollection.info({'id': new_host_col['id']})
Exemple #30
0
    def test_positive_end_to_end(self):
        """Check if host collection can be created with name and description,
        content host can be added and removed, host collection can be listed,
        updated and deleted

        :id: 2d3b718e-6f57-4c83-aedb-15604cc8a4bd

        :expectedresults: Host collection is created and has expected name and
            description, content-host is added and removed, host collection is
            updated and deleted.

        :CaseImportance: Critical
        """
        name = valid_data_list()[0]
        desc = valid_data_list()[0]
        new_host_col = make_host_collection({
            'description':
            desc,
            'name':
            name,
            'organization-id':
            self.organization['id']
        })
        self.assertEqual(new_host_col['name'], name)
        self.assertEqual(new_host_col['description'], desc)

        # add host
        new_system = self._make_fake_host_helper()
        no_of_content_host = new_host_col['total-hosts']
        HostCollection.add_host({
            'host-ids': new_system['id'],
            'id': new_host_col['id']
        })
        result = HostCollection.info({'id': new_host_col['id']})
        self.assertGreater(result['total-hosts'], no_of_content_host)

        # list hosts
        result = HostCollection.hosts({
            'name':
            name,
            'organization-id':
            self.organization['id']
        })
        self.assertEqual(new_system['name'].lower(), result[0]['name'])
        # List all host collections within organization
        result = HostCollection.list(
            {'organization': self.organization['name']})
        self.assertGreaterEqual(len(result), 2)
        # Filter list by name
        result = HostCollection.list({
            'name': name,
            'organization-id': self.organization['id']
        })
        self.assertEqual(len(result), 1)
        self.assertEqual(result[0]['id'], new_host_col['id'])
        # Filter list by associated host name
        result = HostCollection.list({
            'organization': self.organization['name'],
            'host': new_system['name']
        })
        self.assertEqual(len(result), 1)
        self.assertEqual(result[0]['name'], new_host_col['name'])

        # remove host
        no_of_content_host = HostCollection.info({'id': new_host_col['id']
                                                  })['total-hosts']
        HostCollection.remove_host({
            'host-ids': new_system['id'],
            'id': new_host_col['id']
        })
        result = HostCollection.info({'id': new_host_col['id']})
        self.assertGreater(no_of_content_host, result['total-hosts'])

        # update
        new_name = valid_data_list()[0]
        new_desc = valid_data_list()[0]
        HostCollection.update({
            'description': new_desc,
            'id': new_host_col['id'],
            'new-name': new_name
        })
        result = HostCollection.info({'id': new_host_col['id']})
        self.assertEqual(result['name'], new_name)
        self.assertEqual(result['description'], new_desc)

        # delete
        HostCollection.delete({'id': new_host_col['id']})
        with self.assertRaises(CLIReturnCodeError):
            HostCollection.info({'id': new_host_col['id']})