示例#1
0
    def test_positive_update_with_manager_role(self):
        """Create template providing the initial name, then update its name
        with manager user role.

        :id: 28c4357a-93cb-4b01-a445-5db50435bcc0

        :expectedresults: Provisioning Template is created, and its name can
            be updated.

        :CaseImportance: Critical

        :BZ: 1277308
        """
        new_name = gen_string('alpha')
        username = gen_string('alpha')
        password = gen_string('alpha')
        org = make_org()
        loc = make_location()
        template = make_template({
            'organization-ids': org['id'], 'location-ids': loc['id']})
        # Create user with Manager role
        user = make_user({
            'login': username,
            'password': password,
            'admin': False,
            'organization-ids': org['id'],
            'location-ids': loc['id'],
        })
        User.add_role({'id': user['id'], 'role': "Manager"})
        # Update template name with that user
        Template.with_user(username=username, password=password).update({
            'id': template['id'], 'name': new_name})
        template = Template.info({'id': template['id']})
        self.assertEqual(new_name, template['name'])
示例#2
0
def test_positive_update_with_manager_role(module_location, module_org):
    """Create template providing the initial name, then update its name
    with manager user role.

    :id: 28c4357a-93cb-4b01-a445-5db50435bcc0

    :expectedresults: Provisioning Template is created, and its name can
        be updated.

    :CaseImportance: Medium

    :BZ: 1277308
    """
    new_name = gen_string('alpha')
    username = gen_string('alpha')
    password = gen_string('alpha')
    template = make_template(
        {'organization-ids': module_org.id, 'location-ids': module_location.id}
    )
    # Create user with Manager role
    user = entities.User(
        login=username,
        password=password,
        admin=False,
        organization=[module_org.id],
        location=[module_location.id],
    ).create()
    User.add_role({'id': user.id, 'role': "Manager"})
    # Update template name with that user
    Template.with_user(username=username, password=password).update(
        {'id': template['id'], 'name': new_name}
    )
    template = Template.info({'id': template['id']})
    assert new_name == template['name']
示例#3
0
    def test_positive_update_with_manager_role(self):
        """Create template providing the initial name, then update its name
        with manager user role.

        :id: 28c4357a-93cb-4b01-a445-5db50435bcc0

        :expectedresults: Provisioning Template is created, and its name can
            be updated.

        :CaseImportance: Critical

        :BZ: 1277308
        """
        new_name = gen_string('alpha')
        username = gen_string('alpha')
        password = gen_string('alpha')
        org = make_org()
        loc = make_location()
        template = make_template({
            'organization-ids': org['id'], 'location-ids': loc['id']})
        # Create user with Manager role
        user = make_user({
            'login': username,
            'password': password,
            'admin': False,
            'organization-ids': org['id'],
            'location-ids': loc['id'],
        })
        User.add_role({'id': user['id'], 'role': "Manager"})
        # Update template name with that user
        Template.with_user(username=username, password=password).update({
            'id': template['id'], 'name': new_name})
        template = Template.info({'id': template['id']})
        self.assertEqual(new_name, template['name'])