Skip to content

Commit

Permalink
[Key Vault] Skip tests failing with SAS issues (Azure#22351)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccoyp authored Jan 6, 2022
1 parent 8068346 commit 2344a63
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def __init__(self, *args, **kwargs):
@all_api_versions()
@backup_client_setup
def test_full_backup_and_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

# backup the vault
backup_poller = client.begin_backup(self.container_uri, self.sas_token)
backup_operation = backup_poller.result()
Expand Down Expand Up @@ -67,6 +70,9 @@ def test_full_backup_and_restore_rehydration(self, client):
@all_api_versions()
@backup_client_setup
def test_selective_key_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

# create a key to selectively restore
key_client = self.create_key_client(self.managed_hsm_url)
key_name = self.get_resource_name("selective-restore-test-key")
Expand Down Expand Up @@ -116,6 +122,7 @@ def test_backup_client_polling(self, client):
# rehydrate a poller with a continuation token of a completed operation
late_rehydrated = client.begin_backup(self.container_uri, self.sas_token, continuation_token=token)
assert late_rehydrated.status() == "Succeeded"
late_rehydrated.wait()

# restore the backup
restore_poller = client.begin_restore(backup_operation.folder_url, self.sas_token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def __init__(self, *args, **kwargs):
@all_api_versions()
@backup_client_setup
async def test_full_backup_and_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

# backup the vault
backup_poller = await client.begin_backup(self.container_uri, self.sas_token)
backup_operation = await backup_poller.result()
Expand Down Expand Up @@ -65,6 +68,9 @@ async def test_full_backup_and_restore_rehydration(self, client):
@all_api_versions()
@backup_client_setup
async def test_selective_key_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

# create a key to selectively restore
key_client = self.create_key_client(self.managed_hsm_url, is_async=True)
key_name = self.get_resource_name("selective-restore-test-key")
Expand Down Expand Up @@ -112,6 +118,7 @@ async def test_backup_client_polling(self, client):
# rehydrate a poller with a continuation token of a completed operation
late_rehydrated = await client.begin_backup(self.container_uri, self.sas_token, continuation_token=token)
assert late_rehydrated.status() == "Succeeded"
await late_rehydrated.wait()

# restore the backup
restore_poller = await client.begin_restore(backup_operation.folder_url, self.sas_token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# ------------------------------------
import time

import pytest

from _shared.test_case import KeyVaultTestCase
from _test_case import AdministrationTestCase, backup_client_setup, get_decorator

Expand All @@ -18,6 +20,9 @@ def __init__(self, *args, **kwargs):
@all_api_versions()
@backup_client_setup
def test_example_backup_and_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

backup_client = client
container_uri = self.container_uri
sas_token = self.sas_token
Expand Down Expand Up @@ -53,6 +58,9 @@ def test_example_backup_and_restore(self, client):
@all_api_versions()
@backup_client_setup
def test_example_selective_key_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

# create a key to selectively restore
key_client = self.create_key_client(self.managed_hsm_url)
key_name = self.get_resource_name("selective-restore-test-key")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# ------------------------------------
import asyncio

import pytest

from _shared.test_case_async import KeyVaultTestCase
from _test_case import AdministrationTestCase, backup_client_setup, get_decorator

Expand All @@ -18,6 +20,9 @@ def __init__(self, *args, **kwargs):
@all_api_versions()
@backup_client_setup
async def test_example_backup_and_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

backup_client = client
container_uri = self.container_uri
sas_token = self.sas_token
Expand Down Expand Up @@ -53,6 +58,9 @@ async def test_example_backup_and_restore(self, client):
@all_api_versions()
@backup_client_setup
async def test_example_selective_key_restore(self, client):
if self.is_live:
pytest.skip("SAS token failures are causing sev2 alerts for service team")

# create a key to selectively restore
key_client = self.create_key_client(self.managed_hsm_url, is_async=True)
key_name = self.get_resource_name("selective-restore-test-key")
Expand Down

0 comments on commit 2344a63

Please sign in to comment.