From 74b5ec876cade98195196428c3f3f9edafb35128 Mon Sep 17 00:00:00 2001 From: Kalpesh Pandya Date: Fri, 16 Jul 2021 15:21:53 +0530 Subject: [PATCH] qa/tasks: Addition of two new parameters for sts-tests Addition of SUB and AZP parameter for some new sts-tests Signed-off-by: Kalpesh Pandya --- .../tasks/{webidentity.yaml => first.yaml} | 0 qa/tasks/keycloak.py | 32 +++++++++++++++---- qa/tasks/s3tests.py | 2 ++ 3 files changed, 27 insertions(+), 7 deletions(-) rename qa/suites/rgw/sts/tasks/{webidentity.yaml => first.yaml} (100%) diff --git a/qa/suites/rgw/sts/tasks/webidentity.yaml b/qa/suites/rgw/sts/tasks/first.yaml similarity index 100% rename from qa/suites/rgw/sts/tasks/webidentity.yaml rename to qa/suites/rgw/sts/tasks/first.yaml diff --git a/qa/tasks/keycloak.py b/qa/tasks/keycloak.py index 1ffe60acee8ee..e1c3a9b8f00d9 100644 --- a/qa/tasks/keycloak.py +++ b/qa/tasks/keycloak.py @@ -261,21 +261,39 @@ def run_admin_cmds(ctx,config): if(character!=':'): ans5+=character - out6= toxvenv_sh(ctx, remote, + str1 = 'curl' + str2 = '-k' + str3 = '-v' + str4 = '-X' + str5 = 'POST' + str6 = '-u' + str7 = '-d' + str8 = 'http://localhost:8080/auth/realms/'+realm_name+'/protocol/openid-connect/token/introspect' + + out6= toxvenv_sh(ctx, remote, [ - 'curl', '-k', '-v', - '-X', 'POST', - '-u', ans0, - '-d', acc_token, - 'http://localhost:8080/auth/realms/'+realm_name+'/protocol/openid-connect/token/introspect', run.Raw('|'), - 'jq', '-r', '.aud' + str1, str2, str3, str4, str5, str6, ans0, str7, acc_token, str8, run.Raw('|'), 'jq', '-r', '.aud' + ]) + + out7= toxvenv_sh(ctx, remote, + [ + str1, str2, str3, str4, str5, str6, ans0, str7, acc_token, str8, run.Raw('|'), 'jq', '-r', '.sub' + ]) + + out8= toxvenv_sh(ctx, remote, + [ + str1, str2, str3, str4, str5, str6, ans0, str7, acc_token, str8, run.Raw('|'), 'jq', '-r', '.azp' ]) ans6=out6.rstrip() + ans7=out7.rstrip() + ans8=out8.rstrip() os.environ['TOKEN']=ans4 os.environ['THUMBPRINT']=ans5 os.environ['AUD']=ans6 + os.environ['SUB']=ans7 + os.environ['AZP']=ans8 os.environ['KC_REALM']=realm_name try: diff --git a/qa/tasks/s3tests.py b/qa/tasks/s3tests.py index 302ead5e2ad72..6882da2d18412 100644 --- a/qa/tasks/s3tests.py +++ b/qa/tasks/s3tests.py @@ -251,6 +251,8 @@ def create_users(ctx, config): s3tests_conf.setdefault('webidentity', {}) s3tests_conf['webidentity'].setdefault('token',os.environ['TOKEN']) s3tests_conf['webidentity'].setdefault('aud',os.environ['AUD']) + s3tests_conf['webidentity'].setdefault('sub',os.environ['SUB']) + s3tests_conf['webidentity'].setdefault('azp',os.environ['AZP']) s3tests_conf['webidentity'].setdefault('thumbprint',os.environ['THUMBPRINT']) s3tests_conf['webidentity'].setdefault('KC_REALM',os.environ['KC_REALM']) -- 2.39.5