Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Container Registry] fixing up the test-resources-post script #17883

Merged
merged 27 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b93e2e3
fixing up the test-resources-post script
seankane-msft Apr 7, 2021
9f9c4a9
adding forced import of Az
seankane-msft Apr 8, 2021
99bc805
flipping orders
seankane-msft Apr 8, 2021
80d6ee2
changing from updatet to import force
seankane-msft Apr 8, 2021
8c8fae5
update for mac
seankane-msft Apr 8, 2021
04d91fd
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
seankane-msft Apr 9, 2021
b48fb81
using default shell
seankane-msft Apr 9, 2021
c2da20e
dropping the .exe
seankane-msft Apr 9, 2021
706e72e
removing shell=True
seankane-msft Apr 9, 2021
96746c7
removing powershell altogether
seankane-msft Apr 9, 2021
d45fb38
linking powershell command to module
seankane-msft Apr 12, 2021
5016886
powershell.exe -> pwsh
seankane-msft Apr 12, 2021
2c025af
simplifying cmdlet
seankane-msft Apr 12, 2021
af3e753
chnging command structure
seankane-msft Apr 12, 2021
7109f78
simpler pwsh call
seankane-msft Apr 12, 2021
2c25924
moving to mgmt plane library
seankane-msft Apr 13, 2021
2d61153
adding import image using mgmt plane
seankane-msft Apr 13, 2021
7fb0211
import_repo -> import_image
seankane-msft Apr 13, 2021
f10b54d
cleaning up test-resources-post
seankane-msft Apr 13, 2021
84dedae
more changes to test files
seankane-msft Apr 13, 2021
4154731
more corrections
seankane-msft Apr 13, 2021
1acad8c
making hello-world a constant too
seankane-msft Apr 13, 2021
6c42094
fixing up recordings
seankane-msft Apr 13, 2021
79ed1b1
adding try catch for import-module
seankane-msft Apr 13, 2021
317cde4
adding import for Az.Accounts
seankane-msft Apr 13, 2021
1a94117
using a fixture instead of the powershell script
seankane-msft Apr 13, 2021
2bbe887
removing test-resources-post.ps1 entirely, using fixture
seankane-msft Apr 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-e ../../../tools/azure-sdk-tools
-e ../../../tools/azure-devtools
../../core/azure-core
../azure-mgmt-containerregistry
aiohttp>=3.0; python_version >= '3.5'
azure-identity
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@

import sys

# Fixture
from testcase import load_registry

# Ignore async tests for Python < 3.5
collect_ignore_glob = []
if sys.version_info < (3, 5):
collect_ignore_glob.append("*_async.py")

def pytest_configure(config):
config.addinivalue_line(
"usefixtures", "load_registry"
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

TO_BE_DELETED = "to_be_deleted"
DOES_NOT_EXIST = "does_not_exist"
HELLO_WORLD = "library/hello-world"
Original file line number Diff line number Diff line change
@@ -1,4 +1,93 @@
interactions:
- request:
body: '{"source": {"registryUri": "registry.hub.docker.com", "sourceImage": "library/hello-world"},
"targetTags": ["to_be_deleted"], "mode": "Force"}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '142'
Content-Type:
- application/json
User-Agent:
- azsdk-python-azure-mgmt-containerregistry/8.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0)
method: POST
uri: https://management.azure.com/subscriptions/2cd617ea-1866-46b1-90e3-fffb087ebf9b/resourceGroups/fake_rg/providers/Microsoft.ContainerRegistry/registries/seankane/importImage?api-version=2019-05-01
response:
body:
string: 'null'
headers:
cache-control:
- no-cache
content-length:
- '4'
content-type:
- application/json; charset=utf-8
date:
- Tue, 13 Apr 2021 15:57:07 GMT
expires:
- '-1'
location:
- https://management.azure.com/subscriptions/2cd617ea-1866-46b1-90e3-fffb087ebf9b/providers/Microsoft.ContainerRegistry/locations/WESTUS2/operationResults/registries-e542e949-9c70-11eb-9c3f-002b67128e4c?api-version=2019-05-01
pragma:
- no-cache
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
- max-age=31536000; includeSubDomains
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
status:
code: 202
message: Accepted
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- azsdk-python-azure-mgmt-containerregistry/8.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://management.azure.com/subscriptions/2cd617ea-1866-46b1-90e3-fffb087ebf9b/providers/Microsoft.ContainerRegistry/locations/WESTUS2/operationResults/registries-e542e949-9c70-11eb-9c3f-002b67128e4c?api-version=2019-05-01
response:
body:
string: '{"status": "Succeeded"}'
headers:
cache-control:
- no-cache
content-length:
- '22'
content-type:
- application/json; charset=utf-8
date:
- Tue, 13 Apr 2021 15:57:20 GMT
expires:
- '-1'
pragma:
- no-cache
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
status:
code: 200
message: OK
- request:
body: null
headers:
Expand All @@ -13,11 +102,11 @@ interactions:
User-Agent:
- azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0)
method: DELETE
uri: https://fake_url.azurecr.io/acr/v1/repo530d1618
uri: https://fake_url.azurecr.io/acr/v1/to_be_deleted
response:
body:
string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required,
visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"repo530d1618","Action":"delete"}]}]}
visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"to_be_deleted","Action":"delete"}]}]}

'
headers:
Expand All @@ -29,11 +118,11 @@ interactions:
connection:
- keep-alive
content-length:
- '208'
- '209'
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:09 GMT
- Tue, 13 Apr 2021 15:57:21 GMT
docker-distribution-api-version:
- registry/2.0
server:
Expand All @@ -42,7 +131,7 @@ interactions:
- max-age=31536000; includeSubDomains
- max-age=31536000; includeSubDomains
www-authenticate:
- Bearer realm="https://seankane.azurecr.io/oauth2/token",service="seankane.azurecr.io",scope="repository:repo530d1618:delete"
- Bearer realm="https://seankane.azurecr.io/oauth2/token",service="seankane.azurecr.io",scope="repository:to_be_deleted:delete"
x-content-type-options:
- nosniff
status:
Expand Down Expand Up @@ -74,20 +163,20 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:11 GMT
- Tue, 13 Apr 2021 15:57:22 GMT
server:
- openresty
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
x-ms-ratelimit-remaining-calls-per-second:
- '333.183333'
- '166.65'
status:
code: 200
message: OK
- request:
body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Arepo530d1618%3Adelete&refresh_token=REDACTED
body: grant_type=refresh_token&service=fake_url.azurecr.io&scope=repository%3Ato_be_deleted%3Adelete&refresh_token=REDACTED
headers:
Accept:
- application/json
Expand All @@ -96,7 +185,7 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '1073'
- '1074'
Content-Type:
- application/x-www-form-urlencoded
User-Agent:
Expand All @@ -112,15 +201,15 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:12 GMT
- Tue, 13 Apr 2021 15:57:22 GMT
server:
- openresty
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
x-ms-ratelimit-remaining-calls-per-second:
- '332.933333'
- '166.633333'
status:
code: 200
message: OK
Expand All @@ -138,7 +227,7 @@ interactions:
User-Agent:
- azsdk-python-azure-containerregistry/1.0.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0)
method: DELETE
uri: https://fake_url.azurecr.io/acr/v1/repo530d1618
uri: https://fake_url.azurecr.io/acr/v1/to_be_deleted
response:
body:
string: '{"manifestsDeleted": ["sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792",
Expand All @@ -165,7 +254,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:14 GMT
- Tue, 13 Apr 2021 15:57:26 GMT
docker-distribution-api-version:
- registry/2.0
server:
Expand All @@ -176,7 +265,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-calls-per-second:
- '32.000000'
- '8.000000'
status:
code: 202
message: Accepted
Expand Down Expand Up @@ -212,7 +301,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:14 GMT
- Tue, 13 Apr 2021 15:57:26 GMT
docker-distribution-api-version:
- registry/2.0
server:
Expand Down Expand Up @@ -253,15 +342,15 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:14 GMT
- Tue, 13 Apr 2021 15:57:26 GMT
server:
- openresty
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
x-ms-ratelimit-remaining-calls-per-second:
- '332.916667'
- '166.6'
status:
code: 200
message: OK
Expand Down Expand Up @@ -291,15 +380,15 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:15 GMT
- Tue, 13 Apr 2021 15:57:26 GMT
server:
- openresty
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
x-ms-ratelimit-remaining-calls-per-second:
- '332.9'
- '166.583333'
status:
code: 200
message: OK
Expand All @@ -318,10 +407,8 @@ interactions:
uri: https://fake_url.azurecr.io/acr/v1/_catalog
response:
body:
string: '{"repositories": ["alpine/git", "debian", "hello-world", "library/hello-world",
"repo160e197b", "repo2e8319c5", "repo308e19dd", "repo6ce51658", "repo9b321760",
"repo_set160e197b", "repo_set_manib7cc1bf8", "repob7cc1bf8", "repod2be1c42",
"repoeb7113db", "reposet160e197b", "reposetmanib7cc1bf8", "ubuntu"]}'
string: '{"repositories": ["library/alpine", "library/busybox", "library/hello-world",
"repo2e8319c5", "repo308e19dd", "repo9b321760", "repod2be1c42", "repoeb7113db"]}'
headers:
access-control-expose-headers:
- Docker-Content-Digest
Expand All @@ -331,11 +418,11 @@ interactions:
connection:
- keep-alive
content-length:
- '289'
- '151'
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:15 GMT
- Tue, 13 Apr 2021 15:57:26 GMT
docker-distribution-api-version:
- registry/2.0
server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:15 GMT
- Tue, 13 Apr 2021 15:57:27 GMT
docker-distribution-api-version:
- registry/2.0
server:
Expand Down Expand Up @@ -74,15 +74,15 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:17 GMT
- Tue, 13 Apr 2021 15:57:28 GMT
server:
- openresty
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
x-ms-ratelimit-remaining-calls-per-second:
- '333.033333'
- '166.55'
status:
code: 200
message: OK
Expand Down Expand Up @@ -112,15 +112,15 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:18 GMT
- Tue, 13 Apr 2021 15:57:28 GMT
server:
- openresty
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
x-ms-ratelimit-remaining-calls-per-second:
- '332.966667'
- '166.2'
status:
code: 200
message: OK
Expand Down Expand Up @@ -156,7 +156,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 09 Apr 2021 14:56:18 GMT
- Tue, 13 Apr 2021 15:57:29 GMT
docker-distribution-api-version:
- registry/2.0
server:
Expand All @@ -167,7 +167,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-calls-per-second:
- '32.000000'
- '8.000000'
status:
code: 404
message: Not Found
Expand Down
Loading