+"""
+Run rgw s3 readwite tests
+"""
from cStringIO import StringIO
import base64
import contextlib
@contextlib.contextmanager
def download(ctx, config):
+ """
+ Download the s3 tests from the git builder.
+ Remove downloaded s3 file upon exit.
+
+ The context passed in should be identical to the context
+ passed in to the main task.
+ """
assert isinstance(config, dict)
log.info('Downloading s3-tests...')
testdir = teuthology.get_testdir(ctx)
def _config_user(s3tests_conf, section, user):
+ """
+ Configure users for this section by stashing away keys, ids, and
+ email addresses.
+ """
s3tests_conf[section].setdefault('user_id', user)
s3tests_conf[section].setdefault('email', '{user}+test@test.test'.format(user=user))
s3tests_conf[section].setdefault('display_name', 'Mr. {user}'.format(user=user))
@contextlib.contextmanager
def create_users(ctx, config):
+ """
+ Create a default s3 user.
+ """
assert isinstance(config, dict)
log.info('Creating rgw users...')
testdir = teuthology.get_testdir(ctx)
delete_this_user = True
if 'delete_user' in s3tests_conf['s3']:
delete_this_user = s3tests_conf['s3']['delete_user']
- log.debug('delete_user set to {flag} for {client}'.format(flag=delete_this_user,client=client))
+ log.debug('delete_user set to {flag} for {client}'.format(flag=delete_this_user, client=client))
cached_client_user_names[client][section+user] = (s3tests_conf[section]['user_id'], delete_this_user)
# skip actual user creation if the create_user flag is set to false for this client
],
)
else:
- log.debug('skipping delete for user {uid} on {client}'.format(uid=real_uid,client=client))
+ log.debug('skipping delete for user {uid} on {client}'.format(uid=real_uid, client=client))
@contextlib.contextmanager
def configure(ctx, config):
+ """
+ Configure the s3-tests. This includes the running of the
+ bootstrap code and the updating of local conf files.
+ """
assert isinstance(config, dict)
log.info('Configuring s3-readwrite-tests...')
for client, properties in config['clients'].iteritems():
@contextlib.contextmanager
def run_tests(ctx, config):
+ """
+ Run the s3readwrite tests after everything is set up.
+
+ :param ctx: Context passed to task
+ :param config: specific configuration information
+ """
assert isinstance(config, dict)
testdir = teuthology.get_testdir(ctx)
for client, client_config in config.iteritems():
+"""
+Run rgw roundtrip message tests
+"""
from cStringIO import StringIO
import base64
import contextlib
@contextlib.contextmanager
def download(ctx, config):
+ """
+ Download the s3 tests from the git builder.
+ Remove downloaded s3 file upon exit.
+
+ The context passed in should be identical to the context
+ passed in to the main task.
+ """
assert isinstance(config, list)
log.info('Downloading s3-tests...')
testdir = teuthology.get_testdir(ctx)
)
def _config_user(s3tests_conf, section, user):
+ """
+ Configure users for this section by stashing away keys, ids, and
+ email addresses.
+ """
s3tests_conf[section].setdefault('user_id', user)
s3tests_conf[section].setdefault('email', '{user}+test@test.test'.format(user=user))
s3tests_conf[section].setdefault('display_name', 'Mr. {user}'.format(user=user))
@contextlib.contextmanager
def create_users(ctx, config):
+ """
+ Create a default s3 user.
+ """
assert isinstance(config, dict)
log.info('Creating rgw users...')
testdir = teuthology.get_testdir(ctx)
@contextlib.contextmanager
def configure(ctx, config):
+ """
+ Configure the s3-tests. This includes the running of the
+ bootstrap code and the updating of local conf files.
+ """
assert isinstance(config, dict)
log.info('Configuring s3-roundtrip-tests...')
testdir = teuthology.get_testdir(ctx)
@contextlib.contextmanager
def run_tests(ctx, config):
+ """
+ Run the s3 roundtrip after everything is set up.
+
+ :param ctx: Context passed to task
+ :param config: specific configuration information
+ """
assert isinstance(config, dict)
testdir = teuthology.get_testdir(ctx)
for client, client_config in config.iteritems():
+"""
+Run a set of s3 tests on rgw.
+"""
from cStringIO import StringIO
from configobj import ConfigObj
import base64
log = logging.getLogger(__name__)
def extract_sync_client_data(ctx, client_name):
+ """
+ Extract synchronized client rgw zone and rgw region information.
+
+ :param ctx: Context passed to the s3tests task
+ :param name: Name of client that we are synching with
+ """
return_region_name = None
return_dict = None
client = ctx.ceph.conf.get(client_name, None)
if client:
current_client_zone = client.get('rgw zone', None)
if current_client_zone:
- (endpoint_host, endpoint_port) = ctx.rgw.role_endpoints.get(client_name,(None,None))
+ (endpoint_host, endpoint_port) = ctx.rgw.role_endpoints.get(client_name, (None, None))
# pull out the radosgw_agent stuff
regions = ctx.rgw.regions
for region in regions:
log.debug('jbuck, region is {region}'.format(region=region))
region_data = ctx.rgw.regions[region]
- log.debug('jbuck, region data is {region}'.format(region=region_data))
+ log.debug('region data is {region}'.format(region=region_data))
zones = region_data['zones']
for zone in zones:
if current_client_zone in zone:
# The s3tests expect the sync_agent_[addr|port} to be
# set on the non-master node for some reason
if not region_data['is master']:
- (rgwagent_host,rgwagent_port) = ctx.radosgw_agent.endpoint
- (return_dict['sync_agent_addr'], _) = ctx.rgw.role_endpoints[rgwagent_host]
- return_dict['sync_agent_port'] = rgwagent_port
+ (rgwagent_host, rgwagent_port) = ctx.radosgw_agent.endpoint
+ (return_dict['sync_agent_addr'], _) = ctx.rgw.role_endpoints[rgwagent_host]
+ return_dict['sync_agent_port'] = rgwagent_port
else: #if client_zone:
log.debug('No zone info for {host}'.format(host=client_name))
return return_region_name, return_dict
def update_conf_with_region_info(ctx, config, s3tests_conf):
+ """
+ Scan for a client (passed in s3tests_conf) that is an s3agent
+ with which we can sync. Update information in local conf file
+ if such a client is found.
+ """
for key in s3tests_conf.keys():
# we'll assume that there's only one sync relationship (source / destination) with client.X
# as the key for now
@contextlib.contextmanager
def download(ctx, config):
+ """
+ Download the s3 tests from the git builder.
+ Remove downloaded s3 file upon exit.
+
+ The context passed in should be identical to the context
+ passed in to the main task.
+ """
assert isinstance(config, dict)
log.info('Downloading s3-tests...')
testdir = teuthology.get_testdir(ctx)
def _config_user(s3tests_conf, section, user):
+ """
+ Configure users for this section by stashing away keys, ids, and
+ email addresses.
+ """
s3tests_conf[section].setdefault('user_id', user)
s3tests_conf[section].setdefault('email', '{user}+test@test.test'.format(user=user))
s3tests_conf[section].setdefault('display_name', 'Mr. {user}'.format(user=user))
@contextlib.contextmanager
def create_users(ctx, config):
+ """
+ Create a main and an alternate s3 user.
+ """
assert isinstance(config, dict)
log.info('Creating rgw users...')
testdir = teuthology.get_testdir(ctx)
s3tests_conf['fixtures'].setdefault('bucket prefix', 'test-' + client + '-{random}-')
for section, user in users.iteritems():
_config_user(s3tests_conf, section, '{user}.{client}'.format(user=user, client=client))
- log.debug('Creating user {user} on {host}'.format(user=s3tests_conf[section]['user_id'],host=client))
+ log.debug('Creating user {user} on {host}'.format(user=s3tests_conf[section]['user_id'], host=client))
ctx.cluster.only(client).run(
args=[
'adjust-ulimits',
@contextlib.contextmanager
def configure(ctx, config):
+ """
+ Configure the s3-tests. This includes the running of the
+ bootstrap code and the updating of local conf files.
+ """
assert isinstance(config, dict)
log.info('Configuring s3-tests...')
testdir = teuthology.get_testdir(ctx)
@contextlib.contextmanager
def sync_users(ctx, config):
+ """
+ Sync this user.
+ """
assert isinstance(config, dict)
# do a full sync if this is a multi-region test
if rgw_utils.multi_region_enabled(ctx):
@contextlib.contextmanager
def run_tests(ctx, config):
+ """
+ Run the s3tests after everything is set up.
+
+ :param ctx: Context passed to task
+ :param config: specific configuration information
+ """
assert isinstance(config, dict)
testdir = teuthology.get_testdir(ctx)
for client, client_config in config.iteritems():