22
22
23
23
from acktest .resources import random_suffix_name
24
24
from acktest .k8s import resource as k8s
25
+ from e2e .bootstrap_resources import get_bootstrap_resources
25
26
from e2e import service_marker , CRD_GROUP , CRD_VERSION , load_apigateway_resource
26
27
from e2e .replacement_values import REPLACEMENT_VALUES
27
28
from .rest_api_test import simple_rest_api
32
33
33
34
34
35
@pytest .fixture (scope = "function" )
35
- def authorizer_test_resources (cognito_client , simple_rest_api ):
36
+ def authorizer_test_resources (simple_rest_api ):
36
37
_ , rest_api_cr = simple_rest_api
37
38
rest_api_id = rest_api_cr ["status" ].get ("id" )
38
39
assert rest_api_id is not None
39
40
40
- user_pool_name_1 = random_suffix_name ("user-pool-1" , 32 )
41
- user_pool_name_2 = random_suffix_name ("user-pool-2" , 32 )
42
- authorizer_name = random_suffix_name ("authorizer" , 32 )
41
+ bootstrap_resources = get_bootstrap_resources ()
43
42
44
- pool1_resp = cognito_client .create_user_pool (PoolName = user_pool_name_1 )
45
- user_pool_id_1 = pool1_resp ['UserPool' ]['Id' ]
46
- user_pool_arn_1 = pool1_resp ['UserPool' ]['Arn' ]
43
+ user_pool_arn_1 = bootstrap_resources .AuthorizerUserPool1 .user_pool_arn
44
+ user_pool_arn_2 = bootstrap_resources .AuthorizerUserPool2 .user_pool_arn
47
45
48
- pool2_resp = cognito_client .create_user_pool (PoolName = user_pool_name_2 )
49
- user_pool_id_2 = pool2_resp ['UserPool' ]['Id' ]
50
- user_pool_arn_2 = pool2_resp ['UserPool' ]['Arn' ]
46
+ authorizer_name = random_suffix_name ("authorizer" , 32 )
51
47
52
- # Create Authorizer CR using prerequisites
53
48
replacements_authorizer = REPLACEMENT_VALUES .copy ()
54
49
replacements_authorizer ["AUTHORIZER_NAME" ] = authorizer_name
55
50
replacements_authorizer ["REST_API_ID" ] = rest_api_id
@@ -75,9 +70,6 @@ def authorizer_test_resources(cognito_client, simple_rest_api):
75
70
authorizer_ref , wait_periods = 3 , period_length = DEFAULT_WAIT_SECS )
76
71
assert deleted_auth
77
72
78
- cognito_client .delete_user_pool (UserPoolId = user_pool_id_1 )
79
- cognito_client .delete_user_pool (UserPoolId = user_pool_id_2 )
80
-
81
73
82
74
@service_marker
83
75
@pytest .mark .canary
0 commit comments