-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: recreate UAA before SSO tests (#274)
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) | ||
|
@@ -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() |