Skip to content

Commit

Permalink
Fix: recreate UAA before SSO tests (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccheetham committed Jan 12, 2023
1 parent 207e355 commit 904cc8e
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ def setup(context):
"""
:type context: behave.runner.Context
"""
uaa = 'uaa'
sso = 'single-signon'
cf = cloudfoundry.CloudFoundry(context)
# remove previous apps
cf.delete_app('single-signon')
# cf.delete_app('uaa')
cf.delete_app(sso)
cf.delete_app(uaa)
# create UAA service and app
if not cf.service_exists('myOAuthService'):
credentials = '\'{{"client_id":"myTestApp", "client_secret":"myTestApp", "uri":"{}"}}\''.format(
dns.resolve_url(context, 'uaa://uaa'))
cf.create_user_provided_service('myOAuthService', credentials)
uaa = 'uaa'
if not cf.app_exists(uaa):
fqdn = dns.resolve_hostname(context, uaa)
domain = fqdn.removeprefix("{}.".format(uaa))
Expand All @@ -45,6 +46,6 @@ def remove_readonly(func, path, excinfo):
'uaac user add testuser --given_name Test --family_name User --emails [email protected] --password Password1!',
'uaac member add testgroup testuser',
'uaac client add myTestApp --scope cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --authorized_grant_types authorization_code,refresh_token --authorities uaa.resource --redirect_uri {} --autoapprove cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --secret myTestApp'.format(
'https://single-signon/signin-cloudfoundry'),
'https://{}/signin-cloudfoundry'.format(sso)),
]:
Command(context, cmd_s).run()

0 comments on commit 904cc8e

Please sign in to comment.