mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 03:47:22 +00:00
config: add fixtures for iam name/path prefixes
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 83af25722c
)
This commit is contained in:
parent
4638a40e47
commit
73781a5337
2 changed files with 22 additions and 4 deletions
|
@ -19,6 +19,14 @@ ssl_verify = False
|
|||
## the prefix to 30 characters long, and avoid collisions
|
||||
bucket prefix = yournamehere-{random}-
|
||||
|
||||
# all the iam account resources (users, roles, etc) created
|
||||
# will start with this name prefix
|
||||
iam name prefix = s3-tests-
|
||||
|
||||
# all the iam account resources (users, roles, etc) created
|
||||
# will start with this path prefix
|
||||
iam path prefix = /s3-tests/
|
||||
|
||||
[s3 main]
|
||||
# main display_name set in vstart.sh
|
||||
display_name = M. Tester
|
||||
|
|
|
@ -261,11 +261,12 @@ def setup():
|
|||
config.tenant_email = cfg.get('s3 tenant',"email")
|
||||
|
||||
# vars from the fixtures section
|
||||
try:
|
||||
template = cfg.get('fixtures', "bucket prefix")
|
||||
except (configparser.NoOptionError):
|
||||
template = 'test-{random}-'
|
||||
template = cfg.get('fixtures', "bucket prefix", fallback='test-{random}-')
|
||||
prefix = choose_bucket_prefix(template=template)
|
||||
template = cfg.get('fixtures', "iam name prefix", fallback="s3-tests-")
|
||||
config.iam_name_prefix = choose_bucket_prefix(template=template)
|
||||
template = cfg.get('fixtures', "iam path prefix", fallback="/s3-tests/")
|
||||
config.iam_path_prefix = choose_bucket_prefix(template=template)
|
||||
|
||||
alt_client = get_alt_client()
|
||||
tenant_client = get_tenant_client()
|
||||
|
@ -699,6 +700,15 @@ def get_token():
|
|||
def get_realm_name():
|
||||
return config.webidentity_realm
|
||||
|
||||
def get_iam_name_prefix():
|
||||
return config.iam_name_prefix
|
||||
|
||||
def make_iam_name(name):
|
||||
return config.iam_name_prefix + name
|
||||
|
||||
def get_iam_path_prefix():
|
||||
return config.iam_path_prefix
|
||||
|
||||
def get_iam_access_key():
|
||||
return config.iam_access_key
|
||||
|
||||
|
|
Loading…
Reference in a new issue