You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.1 KiB

# Copyright (C) 2013 eNovance SAS <>
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.object_storage import base
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
CONF = config.CONF
class AccountNegativeTest(base.BaseObjectTest):
"""Negative tests of account"""
credentials = [['operator', CONF.object_storage.operator_role],
['operator_alt', CONF.object_storage.operator_role]]
def setup_credentials(cls):
super(AccountNegativeTest, cls).setup_credentials()
cls.os_operator = cls.os_roles_operator_alt
def test_list_containers_with_non_authorized_user(self):
"""Test listing containers using non-authorized user"""
test_auth_provider = self.os_operator.auth_provider
# Get auth for the test user
# Get fresh auth for test user and set it to next auth request for
# account_client
delattr(test_auth_provider, 'auth_data')
test_auth_new_data = test_auth_provider.auth_data
params = {'format': 'json'}
# list containers with non-authorized user token