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

test: skip test__signing tests for mtls #511

Merged
merged 1 commit into from
Jul 20, 2021
Merged
Changes from all commits
Commits
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
60 changes: 38 additions & 22 deletions tests/system/test__signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ def _create_signed_list_blobs_url_helper(
assert response.status_code == 200


def test_create_signed_list_blobs_url_v2(storage_client, signing_bucket):
def test_create_signed_list_blobs_url_v2(storage_client, signing_bucket, no_mtls):
_create_signed_list_blobs_url_helper(
storage_client, signing_bucket, version="v2",
)


def test_create_signed_list_blobs_url_v2_w_expiration(storage_client, signing_bucket):
def test_create_signed_list_blobs_url_v2_w_expiration(
storage_client, signing_bucket, no_mtls
):
now = datetime.datetime.utcnow()
delta = datetime.timedelta(seconds=10)

Expand All @@ -63,13 +65,15 @@ def test_create_signed_list_blobs_url_v2_w_expiration(storage_client, signing_bu
)


def test_create_signed_list_blobs_url_v4(storage_client, signing_bucket):
def test_create_signed_list_blobs_url_v4(storage_client, signing_bucket, no_mtls):
_create_signed_list_blobs_url_helper(
storage_client, signing_bucket, version="v4",
)


def test_create_signed_list_blobs_url_v4_w_expiration(storage_client, signing_bucket):
def test_create_signed_list_blobs_url_v4_w_expiration(
storage_client, signing_bucket, no_mtls
):
now = datetime.datetime.utcnow()
delta = datetime.timedelta(seconds=10)
_create_signed_list_blobs_url_helper(
Expand Down Expand Up @@ -125,17 +129,19 @@ def _create_signed_read_url_helper(
assert response.content == _helpers.signing_blob_content


def test_create_signed_read_url_v2(storage_client, signing_bucket):
def test_create_signed_read_url_v2(storage_client, signing_bucket, no_mtls):
_create_signed_read_url_helper(storage_client, signing_bucket)


def test_create_signed_read_url_v4(storage_client, signing_bucket):
def test_create_signed_read_url_v4(storage_client, signing_bucket, no_mtls):
_create_signed_read_url_helper(
storage_client, signing_bucket, version="v4",
)


def test_create_signed_read_url_v2_w_expiration(storage_client, signing_bucket):
def test_create_signed_read_url_v2_w_expiration(
storage_client, signing_bucket, no_mtls
):
now = datetime.datetime.utcnow()
delta = datetime.timedelta(seconds=10)

Expand All @@ -144,25 +150,33 @@ def test_create_signed_read_url_v2_w_expiration(storage_client, signing_bucket):
)


def test_create_signed_read_url_v4_w_expiration(storage_client, signing_bucket):
def test_create_signed_read_url_v4_w_expiration(
storage_client, signing_bucket, no_mtls
):
now = datetime.datetime.utcnow()
delta = datetime.timedelta(seconds=10)
_create_signed_read_url_helper(
storage_client, signing_bucket, expiration=now + delta, version="v4"
)


def test_create_signed_read_url_v2_lowercase_method(storage_client, signing_bucket):
def test_create_signed_read_url_v2_lowercase_method(
storage_client, signing_bucket, no_mtls
):
_create_signed_read_url_helper(storage_client, signing_bucket, method="get")


def test_create_signed_read_url_v4_lowercase_method(storage_client, signing_bucket):
def test_create_signed_read_url_v4_lowercase_method(
storage_client, signing_bucket, no_mtls
):
_create_signed_read_url_helper(
storage_client, signing_bucket, method="get", version="v4"
)


def test_create_signed_read_url_v2_w_non_ascii_name(storage_client, signing_bucket):
def test_create_signed_read_url_v2_w_non_ascii_name(
storage_client, signing_bucket, no_mtls
):
_create_signed_read_url_helper(
storage_client,
signing_bucket,
Expand All @@ -171,7 +185,9 @@ def test_create_signed_read_url_v2_w_non_ascii_name(storage_client, signing_buck
)


def test_create_signed_read_url_v4_w_non_ascii_name(storage_client, signing_bucket):
def test_create_signed_read_url_v4_w_non_ascii_name(
storage_client, signing_bucket, no_mtls
):
_create_signed_read_url_helper(
storage_client,
signing_bucket,
Expand All @@ -181,7 +197,7 @@ def test_create_signed_read_url_v4_w_non_ascii_name(storage_client, signing_buck
)


def test_create_signed_read_url_v2_w_csek(storage_client, signing_bucket):
def test_create_signed_read_url_v2_w_csek(storage_client, signing_bucket, no_mtls):
encryption_key = os.urandom(32)
_create_signed_read_url_helper(
storage_client,
Expand All @@ -192,7 +208,7 @@ def test_create_signed_read_url_v2_w_csek(storage_client, signing_bucket):
)


def test_create_signed_read_url_v4_w_csek(storage_client, signing_bucket):
def test_create_signed_read_url_v4_w_csek(storage_client, signing_bucket, no_mtls):
encryption_key = os.urandom(32)
_create_signed_read_url_helper(
storage_client,
Expand All @@ -205,7 +221,7 @@ def test_create_signed_read_url_v4_w_csek(storage_client, signing_bucket):


def test_create_signed_read_url_v2_w_access_token(
storage_client, signing_bucket, service_account,
storage_client, signing_bucket, service_account, no_mtls
):
client = iam_credentials_v1.IAMCredentialsClient()
service_account_email = service_account.service_account_email
Expand All @@ -229,7 +245,7 @@ def test_create_signed_read_url_v2_w_access_token(


def test_create_signed_read_url_v4_w_access_token(
storage_client, signing_bucket, service_account,
storage_client, signing_bucket, service_account, no_mtls
):
client = iam_credentials_v1.IAMCredentialsClient()
service_account_email = service_account.service_account_email
Expand Down Expand Up @@ -270,11 +286,11 @@ def _create_signed_delete_url_helper(client, bucket, version="v2", expiration=No
assert not blob.exists()


def test_create_signed_delete_url_v2(storage_client, signing_bucket):
def test_create_signed_delete_url_v2(storage_client, signing_bucket, no_mtls):
_create_signed_delete_url_helper(storage_client, signing_bucket)


def test_create_signed_delete_url_v4(storage_client, signing_bucket):
def test_create_signed_delete_url_v4(storage_client, signing_bucket, no_mtls):
_create_signed_delete_url_helper(storage_client, signing_bucket, version="v4")


Expand Down Expand Up @@ -318,20 +334,20 @@ def _create_signed_resumable_upload_url_helper(
assert delete_response.status_code == 204


def test_create_signed_resumable_upload_url_v2(storage_client, signing_bucket):
def test_create_signed_resumable_upload_url_v2(storage_client, signing_bucket, no_mtls):
_create_signed_resumable_upload_url_helper(
storage_client, signing_bucket, version="v2",
)


def test_create_signed_resumable_upload_url_v4(storage_client, signing_bucket):
def test_create_signed_resumable_upload_url_v4(storage_client, signing_bucket, no_mtls):
_create_signed_resumable_upload_url_helper(
storage_client, signing_bucket, version="v4",
)


def test_generate_signed_post_policy_v4(
storage_client, buckets_to_delete, blobs_to_delete, service_account,
storage_client, buckets_to_delete, blobs_to_delete, service_account, no_mtls
):
bucket_name = _helpers.unique_name("post_policy")
bucket = _helpers.retry_429_503(storage_client.create_bucket)(bucket_name)
Expand Down Expand Up @@ -364,7 +380,7 @@ def test_generate_signed_post_policy_v4(


def test_generate_signed_post_policy_v4_invalid_field(
storage_client, buckets_to_delete, blobs_to_delete, service_account,
storage_client, buckets_to_delete, blobs_to_delete, service_account, no_mtls
):
bucket_name = _helpers.unique_name("post_policy-invalid")
bucket = _helpers.retry_429_503(storage_client.create_bucket)(bucket_name)
Expand Down