Added a new test-suite to configure cloudtier storage class and run related s3-tests.
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
--- /dev/null
+../.qa
\ No newline at end of file
--- /dev/null
+roles:
+- [mon.a, osd.0, osd.1, osd.2, mgr.0, client.0, client.1]
--- /dev/null
+overrides:
+ ceph:
+ conf:
+ client:
+ setuser: ceph
+ setgroup: ceph
+ debug rgw: 20
+ rgw crypt s3 kms backend: testing
+ rgw crypt s3 kms encryption keys: testkey-1=YmluCmJvb3N0CmJvb3N0LWJ1aWxkCmNlcGguY29uZgo= testkey-2=aWIKTWFrZWZpbGUKbWFuCm91dApzcmMKVGVzdGluZwo=
+ rgw crypt require ssl: false
+ rgw lc debug interval: 10
+ rgw:
+ storage classes: LUKEWARM, FROZEN
+ frontend: beast
--- /dev/null
+.qa/distros/supported-random-distro$
\ No newline at end of file
--- /dev/null
+tasks:
+- install:
+- ceph:
+- s3tests:
+ client.0:
+ force-repo: https://github.com/soumyakoduri/s3-tests.git
+ git_remote: https://github.com/soumyakoduri/
+ force-branch: cloudtier_tests
+ rgw_server: client.0
+ storage classes: LUKEWARM, FROZEN
+ extra_attrs: ["cloud_transition"]
+ lc_debug_interval: 10
+ cloudtier_tests: True
+- rgw:
+ storage classes: LUKEWARM, FROZEN
+ client.0:
+ port: 8000
+ cloudtier:
+ # cloudtier storage class params
+ cloud_storage_class: CLOUDTIER
+ cloud_client: client.1
+ cloud_regular_storage_class: LUKEWARM
+ cloud_target_storage_class: FROZEN
+ cloud_retain_head_object: "true"
+ cloud_target_path: "teuthology"
+ cloudtier_user:
+ # cloud-user creds to be created on cloud-client
+ cloud_secret: "abcefgh"
+ cloud_access_key: "12345678"
+ client.1:
+ port: 8001
exit_on_first_error=False
)
+ cloudtier_config = client_config.get('cloudtier')
+ if cloudtier_config is not None:
+ log.info('client %s - cloudtier config is -----------------%s ', client, cloudtier_config)
+ # configuring cloudtier
+
+ cloud_client = cloudtier_config.get('cloud_client')
+ cloud_storage_class = cloudtier_config.get('cloud_storage_class')
+ cloud_target_path = cloudtier_config.get('cloud_target_path')
+ cloud_target_storage_class = cloudtier_config.get('cloud_target_storage_class')
+ cloud_regular_storage_class = cloudtier_config.get('cloud_regular_storage_class')
+ cloud_retain_head_object = cloudtier_config.get('cloud_retain_head_object')
+
+ cloudtier_user = client_config.get('cloudtier_user')
+ cloud_access_key = cloudtier_user.get('cloud_access_key')
+ cloud_secret = cloudtier_user.get('cloud_secret')
+
+ # XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
+ # issue a 'radosgw-admin user list' command to trigger this
+ rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
+
+ endpoint = ctx.rgw.role_endpoints[cloud_client]
+
+ # create cloudtier storage class
+ tier_config_params = "endpoint=" + endpoint.url() + \
+ ",access_key=" + cloud_access_key + \
+ ",secret=" + cloud_secret + \
+ ",retain_head_object=" + cloud_retain_head_object
+
+ if (cloud_target_path != None):
+ tier_config_params += ",target_path=" + cloud_target_path
+ if (cloud_target_storage_class != None):
+ tier_config_params += ",target_storage_class=" + cloud_target_storage_class
+
+ log.info('Configuring cloud-s3 tier storage class type = %s', cloud_storage_class)
+
+ rgwadmin(ctx, client,
+ cmd=['zonegroup', 'placement', 'add',
+ '--rgw-zone', 'default',
+ '--placement-id', 'default-placement',
+ '--storage-class', cloud_storage_class,
+ '--tier-type', 'cloud-s3',
+ '--tier-config', tier_config_params],
+ check_status=True)
+
+ ## create cloudtier user with the access keys given on the cloud client
+ rgwadmin(ctx, cloud_client,
+ cmd=['user', 'create', '--uid', 'cloud-tier-user',
+ '--display-name', 'CLOUD TIER USER',
+ '--access-key', cloud_access_key,
+ '--secret', cloud_secret,
+ '--caps', 'user-policy=*'],
+ check_status=True)
+
run_cmd = list(cmd_prefix)
run_cmd.extend(rgw_cmd)
stdin=run.PIPE,
wait=False,
)
-
+
# XXX: add_daemon() doesn't let us wait until radosgw finishes startup
for client in clients:
endpoint = ctx.rgw.role_endpoints[client]
if lc_debug_interval:
s3tests_conf['s3 main']['lc_debug_interval'] = lc_debug_interval
+ client_rgw_config = ctx.rgw.config.get(client)
+ if client_rgw_config:
+ cloudtier_config = client_rgw_config.get('cloudtier')
+ if cloudtier_config:
+ cloudtier_user = client_rgw_config.get('cloudtier_user')
+ cloud_client = cloudtier_config.get('cloud_client')
+ endpoint = ctx.rgw.role_endpoints.get(cloud_client)
+ s3tests_conf['s3 cloud']['host'] = endpoint.dns_name
+ s3tests_conf['s3 cloud']['port'] = endpoint.port
+ s3tests_conf['s3 cloud']['access_key'] = cloudtier_user.get('cloud_access_key')
+ s3tests_conf['s3 cloud']['secret_key'] = cloudtier_user.get('cloud_secret')
+ s3tests_conf['s3 cloud']['cloud_storage_class'] = cloudtier_config.get('cloud_storage_class')
+ s3tests_conf['s3 cloud']['storage_class'] = cloudtier_config.get('cloud_regular_storage_class')
+ s3tests_conf['s3 cloud']['retain_head_object'] = cloudtier_config.get('cloud_retain_head_object')
+ cloud_target_path = cloudtier_config.get('cloud_target_path')
+ cloud_target_storage_class = cloudtier_config.get('cloud_target_storage_class')
+ if (cloud_target_path != None):
+ s3tests_conf['s3 cloud']['target_path'] = cloud_target_path
+ if (cloud_target_storage_class != None):
+ s3tests_conf['s3 cloud']['target_storage_class'] = cloud_target_storage_class
+
(remote,) = ctx.cluster.only(client).remotes.keys()
remote.run(
args=[
sts_tests: True
rgw_server: client.0
+ To run any cloud-transition tests don't forget to set a config variable named 'cloudtier_tests' to 'True' as follows::
+
+ tasks:
+ - ceph:
+ - rgw: [client.0 client.1]
+ - s3tests:
+ client.0:
+ cloudtier_tests: True
+ rgw_server: client.0
+
"""
assert hasattr(ctx, 'rgw'), 's3tests must run after the rgw task'
assert config is None or isinstance(config, list) \
ctx.sts_variable = True
else:
ctx.sts_variable = False
+ if 'cloudtier_tests' in client_config:
+ ctx.cloudtier_variable = True
+ else:
+ ctx.cloudtier_variable = False
#This will be the structure of config file when you want to run webidentity_test (sts-test)
if ctx.sts_variable and "TOKEN" in os.environ:
for client in clients:
}
)
+ elif ctx.cloudtier_variable:
+ #This will be the structure of config file when you want to run normal s3-tests
+ for client in clients:
+ endpoint = ctx.rgw.role_endpoints.get(client)
+ assert endpoint, 's3tests: no rgw endpoint for {}'.format(client)
+
+ s3tests_conf[client] = ConfigObj(
+ indent_type='',
+ infile={
+ 'DEFAULT':
+ {
+ 'port' : endpoint.port,
+ 'is_secure' : endpoint.cert is not None,
+ 'api_name' : 'default',
+ },
+ 'fixtures' : {},
+ 's3 main' : {},
+ 's3 alt' : {},
+ 's3 tenant' : {},
+ 's3 cloud' : {},
+ }
+ )
else:
#This will be the structure of config file when you want to run normal s3-tests
for client in clients: