Skip to content

Commit 1c8862a

Browse files
venkatr21msyyc
andauthored
Added test cases for Azure load testing management plane (Azure#26842)
* added sdk tests * removed recorded_by_proxy * updated test proxy setup as per recommendation * Update conftest.py * Update ci.yml * Update ci.yml Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent feb90ec commit 1c8862a

File tree

5 files changed

+1135
-6
lines changed

5 files changed

+1135
-6
lines changed

sdk/loadtestservice/azure-mgmt-loadtestservice/tests/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
from devtools_testutils import test_proxy, add_general_regex_sanitizer
3434
from devtools_testutils import add_header_regex_sanitizer, add_body_key_sanitizer
3535

36-
# Ignore async tests for Python < 3.5
37-
collect_ignore_glob = []
38-
if sys.version_info < (3, 5) or platform.python_implementation() == "PyPy":
39-
collect_ignore_glob.append("*_async.py")
40-
4136
load_dotenv()
4237

4338
@pytest.fixture(scope="session", autouse=True)
@@ -52,4 +47,4 @@ def add_sanitizers(test_proxy):
5247
add_general_regex_sanitizer(regex=client_secret, value="00000000-0000-0000-0000-000000000000")
5348
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
5449
add_header_regex_sanitizer(key="Cookie", value="cookie;")
55-
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
50+
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,359 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "*/*",
8+
"Accept-Encoding": "gzip, deflate",
9+
"Connection": "keep-alive",
10+
"User-Agent": "azsdk-python-identity/1.11.0 Python/3.10.7 (Windows-10-10.0.22621-SP0)"
11+
},
12+
"RequestBody": null,
13+
"StatusCode": 200,
14+
"ResponseHeaders": {
15+
"Access-Control-Allow-Methods": "GET, OPTIONS",
16+
"Access-Control-Allow-Origin": "*",
17+
"Cache-Control": "max-age=86400, private",
18+
"Content-Length": "1753",
19+
"Content-Type": "application/json; charset=utf-8",
20+
"Date": "Mon, 17 Oct 2022 05:17:41 GMT",
21+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
22+
"Set-Cookie": "[set-cookie;]",
23+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
24+
"X-Content-Type-Options": "nosniff",
25+
"x-ms-ests-server": "2.1.13845.10 - SEASLR1 ProdSlices",
26+
"X-XSS-Protection": "0"
27+
},
28+
"ResponseBody": {
29+
"token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
30+
"token_endpoint_auth_methods_supported": [
31+
"client_secret_post",
32+
"private_key_jwt",
33+
"client_secret_basic"
34+
],
35+
"jwks_uri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/discovery/v2.0/keys",
36+
"response_modes_supported": [
37+
"query",
38+
"fragment",
39+
"form_post"
40+
],
41+
"subject_types_supported": [
42+
"pairwise"
43+
],
44+
"id_token_signing_alg_values_supported": [
45+
"RS256"
46+
],
47+
"response_types_supported": [
48+
"code",
49+
"id_token",
50+
"code id_token",
51+
"id_token token"
52+
],
53+
"scopes_supported": [
54+
"openid",
55+
"profile",
56+
"email",
57+
"offline_access"
58+
],
59+
"issuer": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0",
60+
"request_uri_parameter_supported": false,
61+
"userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo",
62+
"authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/authorize",
63+
"device_authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/devicecode",
64+
"http_logout_supported": true,
65+
"frontchannel_logout_supported": true,
66+
"end_session_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/logout",
67+
"claims_supported": [
68+
"sub",
69+
"iss",
70+
"cloud_instance_name",
71+
"cloud_instance_host_name",
72+
"cloud_graph_host_name",
73+
"msgraph_host",
74+
"aud",
75+
"exp",
76+
"iat",
77+
"auth_time",
78+
"acr",
79+
"nonce",
80+
"preferred_username",
81+
"name",
82+
"tid",
83+
"ver",
84+
"at_hash",
85+
"c_hash",
86+
"email"
87+
],
88+
"kerberos_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/kerberos",
89+
"tenant_region_scope": "WW",
90+
"cloud_instance_name": "microsoftonline.com",
91+
"cloud_graph_host_name": "graph.windows.net",
92+
"msgraph_host": "graph.microsoft.com",
93+
"rbac_url": "https://pas.windows.net"
94+
}
95+
},
96+
{
97+
"RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize",
98+
"RequestMethod": "GET",
99+
"RequestHeaders": {
100+
"Accept": "application/json",
101+
"Accept-Encoding": "gzip, deflate",
102+
"Connection": "keep-alive",
103+
"Cookie": "cookie;",
104+
"User-Agent": "azsdk-python-identity/1.11.0 Python/3.10.7 (Windows-10-10.0.22621-SP0)"
105+
},
106+
"RequestBody": null,
107+
"StatusCode": 200,
108+
"ResponseHeaders": {
109+
"Access-Control-Allow-Methods": "GET, OPTIONS",
110+
"Access-Control-Allow-Origin": "*",
111+
"Cache-Control": "max-age=86400, private",
112+
"Content-Length": "945",
113+
"Content-Type": "application/json; charset=utf-8",
114+
"Date": "Mon, 17 Oct 2022 05:17:41 GMT",
115+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
116+
"Set-Cookie": "[set-cookie;]",
117+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
118+
"X-Content-Type-Options": "nosniff",
119+
"x-ms-ests-server": "2.1.13777.6 - SEASLR2 ProdSlices",
120+
"X-XSS-Protection": "0"
121+
},
122+
"ResponseBody": {
123+
"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration",
124+
"api-version": "1.1",
125+
"metadata": [
126+
{
127+
"preferred_network": "login.microsoftonline.com",
128+
"preferred_cache": "login.windows.net",
129+
"aliases": [
130+
"login.microsoftonline.com",
131+
"login.windows.net",
132+
"login.microsoft.com",
133+
"sts.windows.net"
134+
]
135+
},
136+
{
137+
"preferred_network": "login.partner.microsoftonline.cn",
138+
"preferred_cache": "login.partner.microsoftonline.cn",
139+
"aliases": [
140+
"login.partner.microsoftonline.cn",
141+
"login.chinacloudapi.cn"
142+
]
143+
},
144+
{
145+
"preferred_network": "login.microsoftonline.de",
146+
"preferred_cache": "login.microsoftonline.de",
147+
"aliases": [
148+
"login.microsoftonline.de"
149+
]
150+
},
151+
{
152+
"preferred_network": "login.microsoftonline.us",
153+
"preferred_cache": "login.microsoftonline.us",
154+
"aliases": [
155+
"login.microsoftonline.us",
156+
"login.usgovcloudapi.net"
157+
]
158+
},
159+
{
160+
"preferred_network": "login-us.microsoftonline.com",
161+
"preferred_cache": "login-us.microsoftonline.com",
162+
"aliases": [
163+
"login-us.microsoftonline.com"
164+
]
165+
}
166+
]
167+
}
168+
},
169+
{
170+
"RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
171+
"RequestMethod": "POST",
172+
"RequestHeaders": {
173+
"Accept": "application/json",
174+
"Accept-Encoding": "gzip, deflate",
175+
"client-request-id": "a0e191c0-8e5a-40b4-bb61-e1c79f9a0c33",
176+
"Connection": "keep-alive",
177+
"Content-Length": "288",
178+
"Content-Type": "application/x-www-form-urlencoded",
179+
"Cookie": "cookie;",
180+
"User-Agent": "azsdk-python-identity/1.11.0 Python/3.10.7 (Windows-10-10.0.22621-SP0)",
181+
"x-client-cpu": "x64",
182+
"x-client-current-telemetry": "4|730,0|",
183+
"x-client-last-telemetry": "4|0|||",
184+
"x-client-os": "win32",
185+
"x-client-sku": "MSAL.Python",
186+
"x-client-ver": "1.20.0",
187+
"x-ms-lib-capability": "retry-after, h429"
188+
},
189+
"RequestBody": "client_id=00000000-0000-0000-0000-000000000000\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=00000000-0000-0000-0000-000000000000\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fmanagement.azure.com%2F.default",
190+
"StatusCode": 200,
191+
"ResponseHeaders": {
192+
"Cache-Control": "no-store, no-cache",
193+
"client-request-id": "a0e191c0-8e5a-40b4-bb61-e1c79f9a0c33",
194+
"Content-Length": "114",
195+
"Content-Type": "application/json; charset=utf-8",
196+
"Date": "Mon, 17 Oct 2022 05:17:41 GMT",
197+
"Expires": "-1",
198+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
199+
"Pragma": "no-cache",
200+
"Set-Cookie": "[set-cookie;]",
201+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
202+
"X-Content-Type-Options": "nosniff",
203+
"x-ms-clitelem": "1,0,0,,",
204+
"x-ms-ests-server": "2.1.13845.10 - KRC ProdSlices",
205+
"X-XSS-Protection": "0"
206+
},
207+
"ResponseBody": {
208+
"token_type": "Bearer",
209+
"expires_in": 86399,
210+
"ext_expires_in": 86399,
211+
"refresh_in": 43199,
212+
"access_token": "access_token"
213+
}
214+
},
215+
{
216+
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas?api-version=2022-12-01",
217+
"RequestMethod": "GET",
218+
"RequestHeaders": {
219+
"Accept": "application/json",
220+
"Accept-Encoding": "gzip, deflate",
221+
"Connection": "keep-alive",
222+
"User-Agent": "azsdk-python-mgmt-loadtestservice/1.0.0 Python/3.10.7 (Windows-10-10.0.22621-SP0)"
223+
},
224+
"RequestBody": null,
225+
"StatusCode": 200,
226+
"ResponseHeaders": {
227+
"Cache-Control": "no-cache",
228+
"Content-Encoding": "gzip",
229+
"Content-Type": "application/json; charset=utf-8",
230+
"Date": "Mon, 17 Oct 2022 05:17:42 GMT",
231+
"Expires": "-1",
232+
"mise-correlation-id": "21cfd777-5c88-471b-a156-e9206d5983b1",
233+
"Pragma": "no-cache",
234+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
235+
"Transfer-Encoding": "chunked",
236+
"Vary": "Accept-Encoding",
237+
"X-Content-Type-Options": "nosniff",
238+
"x-ms-correlation-request-id": "865d3295-215b-47ec-b284-02ed4d6ebda8",
239+
"x-ms-providerhub-traffic": "True",
240+
"x-ms-ratelimit-remaining-subscription-reads": "11992",
241+
"x-ms-routing-request-id": "SOUTHINDIA:20221017T051743Z:865d3295-215b-47ec-b284-02ed4d6ebda8"
242+
},
243+
"ResponseBody": {
244+
"value": [
245+
{
246+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxConcurrentTestRuns",
247+
"name": "maxConcurrentTestRuns",
248+
"type": "Microsoft.LoadTestService/Locations/Quotas",
249+
"properties": {
250+
"usage": 0,
251+
"limit": 25
252+
}
253+
},
254+
{
255+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxConcurrentEngineInstances",
256+
"name": "maxConcurrentEngineInstances",
257+
"type": "Microsoft.LoadTestService/Locations/Quotas",
258+
"properties": {
259+
"usage": 0,
260+
"limit": 100
261+
}
262+
},
263+
{
264+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxEngineInstancesPerTestRun",
265+
"name": "maxEngineInstancesPerTestRun",
266+
"type": "Microsoft.LoadTestService/Locations/Quotas",
267+
"properties": {
268+
"usage": 0,
269+
"limit": 45
270+
}
271+
}
272+
]
273+
}
274+
},
275+
{
276+
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxEngineInstancesPerTestRun?api-version=2022-12-01",
277+
"RequestMethod": "GET",
278+
"RequestHeaders": {
279+
"Accept": "application/json",
280+
"Accept-Encoding": "gzip, deflate",
281+
"Connection": "keep-alive",
282+
"User-Agent": "azsdk-python-mgmt-loadtestservice/1.0.0 Python/3.10.7 (Windows-10-10.0.22621-SP0)"
283+
},
284+
"RequestBody": null,
285+
"StatusCode": 200,
286+
"ResponseHeaders": {
287+
"Cache-Control": "no-cache",
288+
"Content-Encoding": "gzip",
289+
"Content-Type": "application/json; charset=utf-8",
290+
"Date": "Mon, 17 Oct 2022 05:17:43 GMT",
291+
"Expires": "-1",
292+
"mise-correlation-id": "6a20ed80-ec8b-417f-a719-3fe8665c4bef",
293+
"Pragma": "no-cache",
294+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
295+
"Transfer-Encoding": "chunked",
296+
"Vary": "Accept-Encoding",
297+
"X-Content-Type-Options": "nosniff",
298+
"x-ms-correlation-request-id": "7745323c-0f41-40f3-85c3-8f50e60cd376",
299+
"x-ms-providerhub-traffic": "True",
300+
"x-ms-ratelimit-remaining-subscription-reads": "11991",
301+
"x-ms-routing-request-id": "SOUTHINDIA:20221017T051744Z:7745323c-0f41-40f3-85c3-8f50e60cd376"
302+
},
303+
"ResponseBody": {
304+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxEngineInstancesPerTestRun",
305+
"name": "maxEngineInstancesPerTestRun",
306+
"type": "Microsoft.LoadTestService/Locations/Quotas",
307+
"properties": {
308+
"usage": 0,
309+
"limit": 45
310+
}
311+
}
312+
},
313+
{
314+
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxEngineInstancesPerTestRun/checkAvailability?api-version=2022-12-01",
315+
"RequestMethod": "POST",
316+
"RequestHeaders": {
317+
"Accept": "application/json",
318+
"Accept-Encoding": "gzip, deflate",
319+
"Connection": "keep-alive",
320+
"Content-Length": "32",
321+
"Content-Type": "application/json",
322+
"User-Agent": "azsdk-python-mgmt-loadtestservice/1.0.0 Python/3.10.7 (Windows-10-10.0.22621-SP0)"
323+
},
324+
"RequestBody": {
325+
"properties": {
326+
"newQuota": 45
327+
}
328+
},
329+
"StatusCode": 200,
330+
"ResponseHeaders": {
331+
"Cache-Control": "no-cache",
332+
"Content-Encoding": "gzip",
333+
"Content-Type": "application/json; charset=utf-8",
334+
"Date": "Mon, 17 Oct 2022 05:17:44 GMT",
335+
"Expires": "-1",
336+
"mise-correlation-id": "bc40c140-e961-45ea-bf31-bf26a1cf0b18",
337+
"Pragma": "no-cache",
338+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
339+
"Transfer-Encoding": "chunked",
340+
"Vary": "Accept-Encoding",
341+
"X-Content-Type-Options": "nosniff",
342+
"x-ms-correlation-request-id": "1de74463-270b-4d6a-8d20-9240db69af79",
343+
"x-ms-providerhub-traffic": "True",
344+
"x-ms-ratelimit-remaining-subscription-writes": "1199",
345+
"x-ms-routing-request-id": "SOUTHINDIA:20221017T051745Z:1de74463-270b-4d6a-8d20-9240db69af79"
346+
},
347+
"ResponseBody": {
348+
"properties": {
349+
"isAvailable": true,
350+
"availabilityStatus": "The requested quota is available."
351+
},
352+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus2/quotas/maxEngineInstancesPerTestRun",
353+
"type": "Microsoft.LoadTestService/Locations/Quotas",
354+
"name": "maxEngineInstancesPerTestRun"
355+
}
356+
}
357+
],
358+
"Variables": {}
359+
}

0 commit comments

Comments
 (0)