From e05b5bd876f400e0f866f3d7e55a843156cb81f0 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 18 Jun 2019 09:07:33 -0400 Subject: [PATCH] qa/rgw: extra s3tests tasks use rgw endpoint configuration Signed-off-by: Casey Bodley (cherry picked from commit 09e992ff01b4ce286540e1230a30df67103f5968) --- qa/tasks/ragweed.py | 2 +- qa/tasks/rgw_logsocket.py | 10 +++++++--- qa/tasks/s3readwrite.py | 9 ++++++--- qa/tasks/s3roundtrip.py | 10 +++++++--- qa/tasks/s3tests.py | 2 +- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/qa/tasks/ragweed.py b/qa/tasks/ragweed.py index ef99098907c94..b3c69f7b261f7 100644 --- a/qa/tasks/ragweed.py +++ b/qa/tasks/ragweed.py @@ -340,7 +340,7 @@ def task(ctx, config): 'rgw': { 'port' : endpoint.port, - 'is_secure' : 'yes' if endpoint.cert else 'no', + 'is_secure' : endpoint.cert is not None, }, 'fixtures' : {}, 'user system' : {}, diff --git a/qa/tasks/rgw_logsocket.py b/qa/tasks/rgw_logsocket.py index 6f49b00d8a420..2fb4a0c62fb2e 100644 --- a/qa/tasks/rgw_logsocket.py +++ b/qa/tasks/rgw_logsocket.py @@ -112,9 +112,10 @@ def task(ctx, config): client.1: extra_args: ['--exclude', 'test_100_continue'] """ + assert hasattr(ctx, 'rgw'), 'rgw-logsocket must run after the rgw task' assert config is None or isinstance(config, list) \ or isinstance(config, dict), \ - "task s3tests only supports a list or dictionary for configuration" + "task rgw-logsocket only supports a list or dictionary for configuration" all_clients = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')] if config is None: @@ -132,13 +133,16 @@ def task(ctx, config): s3tests_conf = {} for client in clients: + endpoint = ctx.rgw.role_endpoints.get(client) + assert endpoint, 'rgw-logsocket: no rgw endpoint for {}'.format(client) + s3tests_conf[client] = ConfigObj( indent_type='', infile={ 'DEFAULT': { - 'port' : 7280, - 'is_secure' : 'no', + 'port' : endpoint.port, + 'is_secure' : endpoint.cert is not None, }, 'fixtures' : {}, 's3 main' : {}, diff --git a/qa/tasks/s3readwrite.py b/qa/tasks/s3readwrite.py index 9f1507ef8167d..6f98e59b07334 100644 --- a/qa/tasks/s3readwrite.py +++ b/qa/tasks/s3readwrite.py @@ -293,9 +293,10 @@ def task(ctx, config): secret_key: mysecretkey """ + assert hasattr(ctx, 'rgw'), 's3readwrite must run after the rgw task' assert config is None or isinstance(config, list) \ or isinstance(config, dict), \ - "task s3tests only supports a list or dictionary for configuration" + "task s3readwrite only supports a list or dictionary for configuration" all_clients = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')] if config is None: @@ -319,12 +320,14 @@ def task(ctx, config): config[client] = {} config[client].setdefault('s3', {}) config[client].setdefault('readwrite', {}) + endpoint = ctx.rgw.role_endpoints.get(client) + assert endpoint, 's3readwrite: no rgw endpoint for {}'.format(client) s3tests_conf[client] = ({ 'DEFAULT': { - 'port' : 7280, - 'is_secure' : False, + 'port' : endpoint.port, + 'is_secure' : endpoint.cert is not None, }, 'readwrite' : config[client]['readwrite'], 's3' : config[client]['s3'], diff --git a/qa/tasks/s3roundtrip.py b/qa/tasks/s3roundtrip.py index 620b9d42db268..f2632c9b1e509 100644 --- a/qa/tasks/s3roundtrip.py +++ b/qa/tasks/s3roundtrip.py @@ -262,9 +262,10 @@ def task(ctx, config): secret_key: mysecretkey """ + assert hasattr(ctx, 'rgw'), 's3roundtrip must run after the rgw task' assert config is None or isinstance(config, list) \ or isinstance(config, dict), \ - "task s3tests only supports a list or dictionary for configuration" + "task s3roundtrip only supports a list or dictionary for configuration" all_clients = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')] if config is None: @@ -280,11 +281,14 @@ def task(ctx, config): config[client].setdefault('s3', {}) config[client].setdefault('roundtrip', {}) + endpoint = ctx.rgw.role_endpoints.get(client) + assert endpoint, 's3roundtrip: no rgw endpoint for {}'.format(client) + s3tests_conf[client] = ({ 'DEFAULT': { - 'port' : 7280, - 'is_secure' : False, + 'port' : endpoint.port, + 'is_secure' : endpoint.cert is not None, }, 'roundtrip' : config[client]['roundtrip'], 's3' : config[client]['s3'], diff --git a/qa/tasks/s3tests.py b/qa/tasks/s3tests.py index ba699665fcf95..11e139df4a416 100644 --- a/qa/tasks/s3tests.py +++ b/qa/tasks/s3tests.py @@ -395,7 +395,7 @@ def task(ctx, config): 'DEFAULT': { 'port' : endpoint.port, - 'is_secure' : 'yes' if endpoint.cert else 'no', + 'is_secure' : endpoint.cert is not None, 'api_name' : 'default', }, 'fixtures' : {}, -- 2.39.5