diff --git a/samples/smoketest/key_vault_certificates.py b/common/smoketest/key_vault_certificates.py similarity index 85% rename from samples/smoketest/key_vault_certificates.py rename to common/smoketest/key_vault_certificates.py index f3772d599ce..4184ec9a935 100644 --- a/samples/smoketest/key_vault_certificates.py +++ b/common/smoketest/key_vault_certificates.py @@ -22,13 +22,14 @@ class KeyVaultCertificates: self.certificate_name = "cert-name-" + uuid.uuid1().hex def create_certificate(self): - self.certificate_client.begin_create_certificate(name=self.certificate_name, policy=CertificatePolicy.get_default()).wait() + print("creating certificate...") + self.certificate_client.create_certificate(name=self.certificate_name) print("\tdone") def get_certificate(self): print("Getting a certificate...") - certificate = self.certificate_client.get_certificate(name=self.certificate_name) - print(f"\tdone, certificate: {certificate.name}.") + certificate = self.certificate_client.get_certificate_with_policy(name=self.certificate_name) + print("\tdone, certificate: %s." % certificate.name) def delete_certificate(self): print("Deleting a certificate...") diff --git a/samples/smoketest/key_vault_certificates_async.py b/common/smoketest/key_vault_certificates_async.py similarity index 90% rename from samples/smoketest/key_vault_certificates_async.py rename to common/smoketest/key_vault_certificates_async.py index a969a98b231..428ab678041 100644 --- a/samples/smoketest/key_vault_certificates_async.py +++ b/common/smoketest/key_vault_certificates_async.py @@ -23,12 +23,13 @@ class KeyVaultCertificates: self.certificate_name = "cert-name-" + uuid.uuid1().hex async def create_certificate(self): - await self.certificate_client.create_certificate(name=self.certificate_name, policy=CertificatePolicy.get_default()) + create_certificate_poller = await self.certificate_client.create_certificate(name=self.certificate_name) + await create_certificate_poller print("\tdone") async def get_certificate(self): print("Getting a certificate...") - certificate = await self.certificate_client.get_certificate(name=self.certificate_name) + certificate = await self.certificate_client.get_certificate_with_policy(name=self.certificate_name) print(f"\tdone, certificate: {certificate.name}.") async def delete_certificate(self): diff --git a/samples/smoketest/key_vault_keys.py b/common/smoketest/key_vault_keys.py similarity index 92% rename from samples/smoketest/key_vault_keys.py rename to common/smoketest/key_vault_keys.py index 43bee361050..f8dfc69a106 100644 --- a/samples/smoketest/key_vault_keys.py +++ b/common/smoketest/key_vault_keys.py @@ -23,17 +23,17 @@ class KeyVaultKeys: def create_rsa_key(self): print("Creating an RSA key...") - self.key_client.create_rsa_key(name=self.key_name, size=2048) + self.key_client.create_rsa_key(name=self.key_name, size=2048, hsm=False) print("\tdone") def get_key(self): print("Getting a key...") key = self.key_client.get_key(name=self.key_name) - print(f"\tdone, key: {key.name}.") + print("\tdone, key: %s." % key.name) def delete_key(self): print("Deleting a key...") - deleted_key = self.key_client.begin_delete_key(name=self.key_name).result() + deleted_key = self.key_client.delete_key(name=self.key_name) print("\tdone: " + deleted_key.name) def run(self): diff --git a/samples/smoketest/key_vault_keys_async.py b/common/smoketest/key_vault_keys_async.py similarity index 98% rename from samples/smoketest/key_vault_keys_async.py rename to common/smoketest/key_vault_keys_async.py index 8e910343484..41562d4bccf 100644 --- a/samples/smoketest/key_vault_keys_async.py +++ b/common/smoketest/key_vault_keys_async.py @@ -23,7 +23,7 @@ class KeyVaultKeys: async def create_rsa_key(self): print("Creating an RSA key...") - await self.key_client.create_rsa_key(name=self.key_name, size=2048) + await self.key_client.create_rsa_key(name=self.key_name, size=2048, hsm=False) print("\tdone") async def get_key(self): diff --git a/common/smoketest/program.py b/common/smoketest/program.py index 28511c3e316..3d92de01596 100644 --- a/common/smoketest/program.py +++ b/common/smoketest/program.py @@ -2,8 +2,12 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ +import logging +logging.basicConfig() + import smoke_test + try: import smoke_test_async except SyntaxError: diff --git a/common/smoketest/requirements.txt b/common/smoketest/requirements.txt index e4abc709776..4da24d4727d 100644 --- a/common/smoketest/requirements.txt +++ b/common/smoketest/requirements.txt @@ -3,6 +3,8 @@ azure-core==1.0.0b3 azure-cosmos==4.0.0b2 azure-eventhub==5.0.0b3 azure-identity==1.0.0b3 +azure-keyvault-certificates==4.0.0b3 +azure-keyvault-keys==4.0.0b3 azure-keyvault-secrets==4.0.0b3 azure-storage-blob==12.0.0b3 azure-storage-common==2.1.0 \ No newline at end of file diff --git a/common/smoketest/smoke_test.py b/common/smoketest/smoke_test.py index bf586ea691b..eef8321f9fb 100644 --- a/common/smoketest/smoke_test.py +++ b/common/smoketest/smoke_test.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ +from key_vault_certificates import KeyVaultCertificates +from key_vault_keys import KeyVaultKeys from key_vault_secrets import KeyVaultSecrets from storage_blob import StorageBlob from event_hubs import EventHub @@ -12,6 +14,8 @@ print("==========================================") print(" AZURE TRACK 2 SDKs SMOKE TEST") print("==========================================") +KeyVaultCertificates().run() +KeyVaultKeys().run() KeyVaultSecrets().run() StorageBlob().run() EventHub().run() diff --git a/common/smoketest/smoke_test_async.py b/common/smoketest/smoke_test_async.py index b93893d8c1b..1874bd97147 100644 --- a/common/smoketest/smoke_test_async.py +++ b/common/smoketest/smoke_test_async.py @@ -3,6 +3,8 @@ # Licensed under the MIT License. # ------------------------------------ import asyncio +from key_vault_certificates_async import KeyVaultCertificates +from key_vault_keys_async import KeyVaultKeys from key_vault_secrets_async import KeyVaultSecrets from event_hubs_async import EventHub @@ -13,6 +15,8 @@ print("==========================================") async def main(): + await KeyVaultCertificates().run() + await KeyVaultKeys().run() await KeyVaultSecrets().run() await EventHub().run() diff --git a/eng/pipelines/smoke-test.yml b/eng/pipelines/smoke-test.yml index 2a444e22237..010ca3ebc0c 100644 --- a/eng/pipelines/smoke-test.yml +++ b/eng/pipelines/smoke-test.yml @@ -5,8 +5,8 @@ jobs: - job: strategy: matrix: - Python_374: - PythonVersion: '3.7.4' + Python_37: + PythonVersion: '3.7' Python_27: PythonVersion: '2.7' InstallAsyncRequirements: false