コード例 #1
0
    def test_positive_create_update_delete_domain(self):
        """Create domain, update and delete domain and set parameters

        :id: 018740bf-1551-4162-b88e-4d4905af097b

        :expectedresults: Domain successfully created, updated and deleted


        :CaseImportance: Critical
        """
        options = valid_create_params()[0]
        location = make_location()
        org = make_org()
        domain = make_domain({
            u'name': options['name'],
            u'description': options['description'],
            u'location-ids': location['id'],
            u'organization-ids': org['id']
        })
        self.assertEqual(domain['name'], options['name'])
        self.assertEqual(domain['description'], options['description'])
        self.assertIn(location['name'], domain['locations'])
        self.assertIn(org['name'], domain['organizations'])

        # set parameter
        parameter_options = valid_set_params()[0]
        parameter_options['domain-id'] = domain['id']
        Domain.set_parameter(parameter_options)
        domain = Domain.info({'id': domain['id']})
        parameter = {
            # Satellite applies lower to parameter's name
            parameter_options['name'].lower():
            parameter_options['value'],
        }
        self.assertDictEqual(parameter, domain['parameters'])

        # update domain
        options = valid_update_params()[0]
        Domain.update(dict(options, id=domain['id']))
        # check - domain updated
        domain = Domain.info({'id': domain['id']})
        for key, val in options.items():
            self.assertEqual(domain[key], val)

        # delete parameter
        Domain.delete_parameter({
            u'name': parameter_options['name'],
            u'domain-id': domain['id'],
        })
        # check - parameter not set
        domain = Domain.info({'name': domain['name']})
        self.assertEqual(len(domain['parameters']), 0)

        # delete domain
        Domain.delete({'id': domain['id']})
        with self.assertRaises(CLIReturnCodeError):
            Domain.info({'id': domain['id']})
コード例 #2
0
ファイル: test_domain.py プロジェクト: cpeters/robottelo
    def test_negative_delete(self):
        """@test: Create Domain then delete it by wrong ID

        @feature: Domain

        @assert: Domain is not deleted
        """
        for entity_id in invalid_id_list():
            with self.subTest(entity_id):
                with self.assertRaises(CLIReturnCodeError):
                    Domain.delete({'id': entity_id})
コード例 #3
0
ファイル: test_domain.py プロジェクト: waffle-iron/robottelo
    def test_negative_delete_by_id(self):
        """Create Domain then delete it by wrong ID

        @id: 0e4ef107-f006-4433-abc3-f872613e0b91

        @assert: Domain is not deleted
        """
        for entity_id in invalid_id_list():
            with self.subTest(entity_id):
                with self.assertRaises(CLIReturnCodeError):
                    Domain.delete({'id': entity_id})
コード例 #4
0
ファイル: test_domain.py プロジェクト: rohitkadam19/robottelo
    def test_negative_delete_by_id(self):
        """Create Domain then delete it by wrong ID

        @id: 0e4ef107-f006-4433-abc3-f872613e0b91

        @assert: Domain is not deleted
        """
        for entity_id in invalid_id_list():
            with self.subTest(entity_id):
                with self.assertRaises(CLIReturnCodeError):
                    Domain.delete({'id': entity_id})
コード例 #5
0
    def test_negative_delete_by_id(self):
        """Create Domain then delete it by wrong ID

        @feature: Domain

        @assert: Domain is not deleted
        """
        for entity_id in invalid_id_list():
            with self.subTest(entity_id):
                with self.assertRaises(CLIReturnCodeError):
                    Domain.delete({'id': entity_id})
コード例 #6
0
ファイル: test_domain.py プロジェクト: chbrown13/robottelo
    def test_negative_delete_by_id(self):
        """Create Domain then delete it by wrong ID

        :id: 0e4ef107-f006-4433-abc3-f872613e0b91

        :expectedresults: Domain is not deleted

        :CaseImportance: Critical
        """
        for entity_id in invalid_id_list():
            with self.subTest(entity_id):
                with self.assertRaises(CLIReturnCodeError):
                    Domain.delete({'id': entity_id})
コード例 #7
0
ファイル: test_domain.py プロジェクト: vsedmik/robottelo
def test_negative_delete_by_id(entity_id):
    """Create Domain then delete it by wrong ID

    :id: 0e4ef107-f006-4433-abc3-f872613e0b91

    :parametrized: yes

    :expectedresults: Domain is not deleted

    :CaseImportance: Medium
    """
    with pytest.raises(CLIReturnCodeError):
        Domain.delete({'id': entity_id})
コード例 #8
0
    def test_negative_delete_by_id(self):
        """Create Domain then delete it by wrong ID

        :id: 0e4ef107-f006-4433-abc3-f872613e0b91

        :expectedresults: Domain is not deleted

        :CaseImportance: Critical
        """
        for entity_id in invalid_id_list():
            with self.subTest(entity_id):
                with self.assertRaises(CLIReturnCodeError):
                    Domain.delete({'id': entity_id})
コード例 #9
0
ファイル: test_domain.py プロジェクト: cpeters/robottelo
    def test_positive_delete(self):
        """@test: Create Domain with valid values then delete it
        by ID

        @feature: Domain

        @assert: Domain is deleted
        """
        for name in valid_data_list():
            with self.subTest(name):
                domain = make_domain({'name': name})
                Domain.delete({'id': domain['id']})
                with self.assertRaises(CLIReturnCodeError):
                    Domain.info({'id': domain['id']})
コード例 #10
0
ファイル: test_domain.py プロジェクト: waffle-iron/robottelo
    def test_positive_delete_by_id(self):
        """Create Domain with valid values then delete it
        by ID

        @id: b50a5daa-67f8-4ecd-8e03-2a3c492d3c25

        @assert: Domain is deleted
        """
        for name in valid_data_list():
            with self.subTest(name):
                domain = make_domain({'name': name})
                Domain.delete({'id': domain['id']})
                with self.assertRaises(CLIReturnCodeError):
                    Domain.info({'id': domain['id']})
コード例 #11
0
ファイル: test_domain.py プロジェクト: rohitkadam19/robottelo
    def test_positive_delete_by_id(self):
        """Create Domain with valid values then delete it
        by ID

        @id: b50a5daa-67f8-4ecd-8e03-2a3c492d3c25

        @assert: Domain is deleted
        """
        for name in valid_data_list():
            with self.subTest(name):
                domain = make_domain({'name': name})
                Domain.delete({'id': domain['id']})
                with self.assertRaises(CLIReturnCodeError):
                    Domain.info({'id': domain['id']})
コード例 #12
0
 def _cleanup():
     if Domain.exists(search=('name', domain['name'])):
         Domain.delete(options={'id': domain['id']})