]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: extra s3tests tasks use rgw endpoint configuration
authorCasey Bodley <cbodley@redhat.com>
Tue, 18 Jun 2019 13:07:33 +0000 (09:07 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 8 Oct 2019 20:49:47 +0000 (22:49 +0200)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 09e992ff01b4ce286540e1230a30df67103f5968)

qa/tasks/ragweed.py
qa/tasks/rgw_logsocket.py
qa/tasks/s3readwrite.py
qa/tasks/s3roundtrip.py
qa/tasks/s3tests.py

index ef99098907c941456c15dbc22795c8286d1a8676..b3c69f7b261f70dfb868c34f5aff2cab29f7dce5 100644 (file)
@@ -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'  : {},
index 6f49b00d8a420f39a3f9ef973be69057fcd877b2..2fb4a0c62fb2e9d2ce539c4dcfc8bdb6b7999744 100644 (file)
@@ -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'  : {},
index 9f1507ef8167de88db2995262985bbf1048f7fd1..6f98e59b073348d59485d1d35c82429c66ae25d9 100644 (file)
@@ -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'],
index 620b9d42db2682369ff2b11d843a3f0ebcf864b4..f2632c9b1e509b1832a08138de37eb06b35357b0 100644 (file)
@@ -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'],
index ba699665fcf9563f2785991c24e34c84f92092bb..11e139df4a41682ab7bc3281b2f680a4f22fc52c 100644 (file)
@@ -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' : {},