From 99db07b01b1c698a899f79fa5eb3d6c744b2daeb Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:54:31 -0700 Subject: [PATCH 01/13] one commit to rule them all --- cmake-modules/FolderList.cmake | 10 +++++----- eng/common/testproxy/test-proxy-tool.yml | 17 ++++++++++++++++- .../azure-security-attestation/CHANGELOG.md | 10 ++++++++++ .../src/private/package_version.hpp | 2 +- sdk/core/azure-core/CHANGELOG.md | 10 ++++++++++ .../azure-core/src/private/package_version.hpp | 4 ++-- sdk/storage/azure-storage-blobs/CHANGELOG.md | 8 +++++++- sdk/storage/azure-storage-blobs/CMakeLists.txt | 4 ++-- .../src/private/package_version.hpp | 4 ++-- sdk/storage/azure-storage-blobs/vcpkg.json | 4 ++-- .../azure-storage-blobs/vcpkg/Config.cmake.in | 2 +- .../azure-storage-blobs/vcpkg/vcpkg.json | 2 +- sdk/storage/azure-storage-common/CHANGELOG.md | 8 ++++++-- sdk/storage/azure-storage-common/CMakeLists.txt | 4 ++-- sdk/storage/azure-storage-common/vcpkg.json | 4 ++-- .../azure-storage-common/vcpkg/Config.cmake.in | 2 +- .../azure-storage-common/vcpkg/vcpkg.json | 2 +- sdk/storage/azure-storage-queues/CHANGELOG.md | 8 +++++++- sdk/storage/azure-storage-queues/CMakeLists.txt | 4 ++-- .../src/private/package_version.hpp | 4 ++-- sdk/storage/azure-storage-queues/vcpkg.json | 4 ++-- .../azure-storage-queues/vcpkg/Config.cmake.in | 2 +- .../azure-storage-queues/vcpkg/vcpkg.json | 2 +- 23 files changed, 86 insertions(+), 35 deletions(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index f2a555f2da..52de3985cd 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -13,10 +13,10 @@ macro(GetFolderList project) DownloadDepVersion(sdk/core azure-core 1.2.0) DownloadDepVersion(sdk/identity azure-identity 1.1.0) elseif(${project} STREQUAL STORAGE_COMMON) - DownloadDepVersion(sdk/core azure-core 1.3.1) + DownloadDepVersion(sdk/core azure-core 1.5.0) elseif(${project} STREQUAL STORAGE_BLOBS) - DownloadDepVersion(sdk/core azure-core 1.3.1) - DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) + DownloadDepVersion(sdk/core azure-core 1.5.0) + DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) elseif(${project} STREQUAL STORAGE_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) @@ -25,8 +25,8 @@ macro(GetFolderList project) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) elseif(${project} STREQUAL STORAGE_QUEUES) - DownloadDepVersion(sdk/core azure-core 1.3.1) - DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) + DownloadDepVersion(sdk/core azure-core 1.5.0) + DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) endif() list(REMOVE_DUPLICATES BUILD_FOLDERS) endmacro() diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index 9006c0d7af..7b5fedaaeb 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -11,7 +11,7 @@ steps: - pwsh: | $version = $(Get-Content "$(Build.SourcesDirectory)/eng/common/testproxy/target_version.txt" -Raw).Trim() $overrideVersion = "${{ parameters.targetVersion }}" - + if($overrideVersion) { Write-Host "Overriding default target proxy version of '$version' with override $overrideVersion." $version = $overrideVersion @@ -47,3 +47,18 @@ steps: displayName: "Run the testproxy - linux/mac" condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) workingDirectory: "${{ parameters.rootFolder }}" + + - pwsh: | + for ($i = 0; $i -lt 10; $i++) { + try { + Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null + exit 0 + } catch { + Write-Warning "Failed to successfully connect to test proxy. Retrying..." + Start-Sleep 6 + } + } + Write-Error "Could not connect to test proxy." + exit 1 + displayName: Test Proxy IsAlive + diff --git a/sdk/attestation/azure-security-attestation/CHANGELOG.md b/sdk/attestation/azure-security-attestation/CHANGELOG.md index c18b84f051..ebe12c9519 100644 --- a/sdk/attestation/azure-security-attestation/CHANGELOG.md +++ b/sdk/attestation/azure-security-attestation/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.1 (2022-04-05) ### Features Added diff --git a/sdk/attestation/azure-security-attestation/src/private/package_version.hpp b/sdk/attestation/azure-security-attestation/src/private/package_version.hpp index 9765dad46f..f762853cea 100644 --- a/sdk/attestation/azure-security-attestation/src/private/package_version.hpp +++ b/sdk/attestation/azure-security-attestation/src/private/package_version.hpp @@ -11,7 +11,7 @@ #define AZURE_ATTESTATION_VERSION_MAJOR 1 #define AZURE_ATTESTATION_VERSION_MINOR 0 #define AZURE_ATTESTATION_VERSION_PATCH 0 -#define AZURE_ATTESTATION_VERSION_PRERELEASE "beta.1" +#define AZURE_ATTESTATION_VERSION_PRERELEASE "beta.2" #define AZURE_ATTESTATION_VERSION_ITOA_HELPER(i) #i #define AZURE_ATTESTATION_VERSION_ITOA(i) AZURE_ATTESTATION_VERSION_ITOA_HELPER(i) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 6b46b7079d..7d96da393c 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.6.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.5.0 (2022-03-31) ### Features Added diff --git a/sdk/core/azure-core/src/private/package_version.hpp b/sdk/core/azure-core/src/private/package_version.hpp index 59ba877a3d..b0f9e28ebe 100644 --- a/sdk/core/azure-core/src/private/package_version.hpp +++ b/sdk/core/azure-core/src/private/package_version.hpp @@ -11,9 +11,9 @@ #include #define AZURE_CORE_VERSION_MAJOR 1 -#define AZURE_CORE_VERSION_MINOR 5 +#define AZURE_CORE_VERSION_MINOR 6 #define AZURE_CORE_VERSION_PATCH 0 -#define AZURE_CORE_VERSION_PRERELEASE "" +#define AZURE_CORE_VERSION_PRERELEASE "beta.1" #define AZURE_CORE_VERSION_ITOA_HELPER(i) #i #define AZURE_CORE_VERSION_ITOA(i) AZURE_CORE_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-blobs/CHANGELOG.md b/sdk/storage/azure-storage-blobs/CHANGELOG.md index 6ff5f13bac..3ca4d85de9 100644 --- a/sdk/storage/azure-storage-blobs/CHANGELOG.md +++ b/sdk/storage/azure-storage-blobs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.4.0-beta.2 (Unreleased) +## 12.5.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 12.4.0 (2022-04-06) + +### Other changes + +- No public changes in this release. + ## 12.4.0-beta.1 (2022-03-09) ### Features Added diff --git a/sdk/storage/azure-storage-blobs/CMakeLists.txt b/sdk/storage/azure-storage-blobs/CMakeLists.txt index 63348e5314..122ad8b768 100644 --- a/sdk/storage/azure-storage-blobs/CMakeLists.txt +++ b/sdk/storage/azure-storage-blobs/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-storage-common-cpp "12.2.2" CONFIG QUIET) + find_package(azure-storage-common-cpp "12.2.3" CONFIG QUIET) if(NOT azure-storage-common-cpp_FOUND) - find_package(azure-storage-common-cpp "12.2.2" REQUIRED) + find_package(azure-storage-common-cpp "12.2.3" REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-blobs/src/private/package_version.hpp b/sdk/storage/azure-storage-blobs/src/private/package_version.hpp index 76fa57e75f..b2361f3b40 100644 --- a/sdk/storage/azure-storage-blobs/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-blobs/src/private/package_version.hpp @@ -9,9 +9,9 @@ #pragma once #define AZURE_STORAGE_BLOBS_VERSION_MAJOR 12 -#define AZURE_STORAGE_BLOBS_VERSION_MINOR 4 +#define AZURE_STORAGE_BLOBS_VERSION_MINOR 5 #define AZURE_STORAGE_BLOBS_VERSION_PATCH 0 -#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.2" +#define AZURE_STORAGE_BLOBS_VERSION_PRERELEASE "beta.1" #define AZURE_STORAGE_BLOBS_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_BLOBS_VERSION_ITOA(i) AZURE_STORAGE_BLOBS_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-blobs/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg.json index c06b902a0d..2847c101f2 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg.json +++ b/sdk/storage/azure-storage-blobs/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-blobs-cpp", - "version-semver": "12.4.0-beta.1", + "version-semver": "12.4.0", "description": [ "Microsoft Azure Storage Blobs SDK for C++", "This library provides Azure Storage Blobs SDK." @@ -11,7 +11,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.2" + "version>=": "12.2.3" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in index 479be48447..e2692f288a 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-blobs/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-storage-common-cpp "12.2.2") +find_dependency(azure-storage-common-cpp "12.2.3") include("${CMAKE_CURRENT_LIST_DIR}/azure-storage-blobs-cppTargets.cmake") diff --git a/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json b/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json index ec303d341d..648b9f5082 100644 --- a/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-blobs/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.2" + "version>=": "12.2.3" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-common/CHANGELOG.md b/sdk/storage/azure-storage-common/CHANGELOG.md index 80956642fb..85fac2ba62 100644 --- a/sdk/storage/azure-storage-common/CHANGELOG.md +++ b/sdk/storage/azure-storage-common/CHANGELOG.md @@ -8,10 +8,14 @@ ### Bugs Fixed -- Fixed a bug where we got error when XML request body is too big. - ### Other Changes +## 12.2.3 (2022-04-06) + +### Bugs Fixed + +- Fixed a bug where we got error when XML request body is too big. + ## 12.2.2 (2022-03-09) ### Features Added diff --git a/sdk/storage/azure-storage-common/CMakeLists.txt b/sdk/storage/azure-storage-common/CMakeLists.txt index 04674fc200..2e1f73e873 100644 --- a/sdk/storage/azure-storage-common/CMakeLists.txt +++ b/sdk/storage/azure-storage-common/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-core-cpp "1.3.1" CONFIG QUIET) + find_package(azure-core-cpp "1.5.0" CONFIG QUIET) if(NOT azure-core-cpp_FOUND) - find_package(azure-core-cpp "1.3.1" REQUIRED) + find_package(azure-core-cpp "1.5.0" REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-common/vcpkg.json b/sdk/storage/azure-storage-common/vcpkg.json index 916203dfe0..ff818f2a25 100644 --- a/sdk/storage/azure-storage-common/vcpkg.json +++ b/sdk/storage/azure-storage-common/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-common-cpp", - "version-semver": "12.2.2", + "version-semver": "12.2.3", "description": [ "Microsoft Azure Common Storage SDK for C++", "This library provides common Azure Storage-related abstractions for Azure SDK." @@ -11,7 +11,7 @@ { "name": "azure-core-cpp", "default-features": false, - "version>=": "1.3.1" + "version>=": "1.5.0" }, { "name": "libxml2", diff --git a/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in index 08fc765c37..f92c6f19be 100644 --- a/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in @@ -5,7 +5,7 @@ include(CMakeFindDependencyMacro) find_dependency(Threads) -find_dependency(azure-core-cpp "1.3.1") +find_dependency(azure-core-cpp "1.5.0") if(NOT WIN32) find_dependency(LibXml2) diff --git a/sdk/storage/azure-storage-common/vcpkg/vcpkg.json b/sdk/storage/azure-storage-common/vcpkg/vcpkg.json index 6691770594..5c91fef890 100644 --- a/sdk/storage/azure-storage-common/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-common/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-core-cpp", "default-features": false, - "version>=": "1.3.1" + "version>=": "1.5.0" }, { "name": "libxml2", diff --git a/sdk/storage/azure-storage-queues/CHANGELOG.md b/sdk/storage/azure-storage-queues/CHANGELOG.md index 35cdb10471..44d6e6f37e 100644 --- a/sdk/storage/azure-storage-queues/CHANGELOG.md +++ b/sdk/storage/azure-storage-queues/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.0.0-beta.5 (Unreleased) +## 12.1.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 12.0.0 (2022-04-06) + +### New Features + +- This release includes all features from beta.1 to beta.4. This is the first stable release of a ground-up rewrite of our client libraries to ensure consistency, idiomatic design, productivity and an excellent developer experience. It was created following the [Azure SDK Design Guideline for C++](https://azure.github.io/azure-sdk/cpp_introduction.html). + ## 12.0.0-beta.4 (2022-03-09) ### Other Changes diff --git a/sdk/storage/azure-storage-queues/CMakeLists.txt b/sdk/storage/azure-storage-queues/CMakeLists.txt index e1d729eba3..1392c4748d 100644 --- a/sdk/storage/azure-storage-queues/CMakeLists.txt +++ b/sdk/storage/azure-storage-queues/CMakeLists.txt @@ -32,9 +32,9 @@ if(FETCH_SOURCE_DEPS) add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL) endforeach() elseif(NOT AZ_ALL_LIBRARIES) - find_package(azure-storage-common-cpp "12.2.2" CONFIG QUIET) + find_package(azure-storage-common-cpp "12.2.3" CONFIG QUIET) if(NOT azure-storage-common-cpp_FOUND) - find_package(azure-storage-common-cpp "12.2.2" REQUIRED) + find_package(azure-storage-common-cpp "12.2.3" REQUIRED) endif() endif() diff --git a/sdk/storage/azure-storage-queues/src/private/package_version.hpp b/sdk/storage/azure-storage-queues/src/private/package_version.hpp index 2f000c1bcc..817761f962 100644 --- a/sdk/storage/azure-storage-queues/src/private/package_version.hpp +++ b/sdk/storage/azure-storage-queues/src/private/package_version.hpp @@ -9,9 +9,9 @@ #pragma once #define AZURE_STORAGE_QUEUES_VERSION_MAJOR 12 -#define AZURE_STORAGE_QUEUES_VERSION_MINOR 0 +#define AZURE_STORAGE_QUEUES_VERSION_MINOR 1 #define AZURE_STORAGE_QUEUES_VERSION_PATCH 0 -#define AZURE_STORAGE_QUEUES_VERSION_PRERELEASE "beta.5" +#define AZURE_STORAGE_QUEUES_VERSION_PRERELEASE "beta.1" #define AZURE_STORAGE_QUEUES_VERSION_ITOA_HELPER(i) #i #define AZURE_STORAGE_QUEUES_VERSION_ITOA(i) AZURE_STORAGE_QUEUES_VERSION_ITOA_HELPER(i) diff --git a/sdk/storage/azure-storage-queues/vcpkg.json b/sdk/storage/azure-storage-queues/vcpkg.json index b48d71ab27..e81924b0de 100644 --- a/sdk/storage/azure-storage-queues/vcpkg.json +++ b/sdk/storage/azure-storage-queues/vcpkg.json @@ -1,6 +1,6 @@ { "name": "azure-storage-queues-cpp", - "version-semver": "12.0.0-beta.4", + "version-semver": "12.0.0", "description": [ "Microsoft Azure Storage Queues SDK for C++", "This library provides Azure Storage Queues SDK." @@ -11,7 +11,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.2" + "version>=": "12.2.3" }, { "name": "vcpkg-cmake", diff --git a/sdk/storage/azure-storage-queues/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-queues/vcpkg/Config.cmake.in index 5e6faa1590..f8463bda82 100644 --- a/sdk/storage/azure-storage-queues/vcpkg/Config.cmake.in +++ b/sdk/storage/azure-storage-queues/vcpkg/Config.cmake.in @@ -4,7 +4,7 @@ @PACKAGE_INIT@ include(CMakeFindDependencyMacro) -find_dependency(azure-storage-common-cpp "12.2.2") +find_dependency(azure-storage-common-cpp "12.2.3") include("${CMAKE_CURRENT_LIST_DIR}/azure-storage-queues-cppTargets.cmake") diff --git a/sdk/storage/azure-storage-queues/vcpkg/vcpkg.json b/sdk/storage/azure-storage-queues/vcpkg/vcpkg.json index 00abee17f5..33a002e51f 100644 --- a/sdk/storage/azure-storage-queues/vcpkg/vcpkg.json +++ b/sdk/storage/azure-storage-queues/vcpkg/vcpkg.json @@ -14,7 +14,7 @@ { "name": "azure-storage-common-cpp", "default-features": false, - "version>=": "12.2.2" + "version>=": "12.2.3" }, { "name": "vcpkg-cmake", From dce08e2dd7e042e7472528b90e75de99325e7d01 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:54:31 -0700 Subject: [PATCH 02/13] main merge --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 8c3685b432..599350982b 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) + elseif(${project} STREQUAL STORAGE_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From 1df702ab6e40b419e5468b005570bdacc521acc8 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 24 May 2022 10:24:42 -0700 Subject: [PATCH 03/13] error --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 599350982b..8c3685b432 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_DATALAKE) + elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From ff85b81ffbde1b70b9af18076edc19d987e79e5e Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:54:31 -0700 Subject: [PATCH 04/13] main merge --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 8c3685b432..599350982b 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) + elseif(${project} STREQUAL STORAGE_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From f95c70d43cf2532fb842404d3d78887445475859 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 24 May 2022 10:24:42 -0700 Subject: [PATCH 05/13] error --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 599350982b..8c3685b432 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_DATALAKE) + elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From 02d33938c7be7a482601f09ddef55b8c4da68531 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:54:31 -0700 Subject: [PATCH 06/13] main merge --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 8c3685b432..599350982b 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) + elseif(${project} STREQUAL STORAGE_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From 29acacde3a935bf98a789ab046e8f57536850bf4 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 24 May 2022 10:24:42 -0700 Subject: [PATCH 07/13] error --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 599350982b..8c3685b432 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_DATALAKE) + elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From 237ebb774ed9918fc4b9e2104866b58bb892dea7 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:54:31 -0700 Subject: [PATCH 08/13] main merge --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 8c3685b432..599350982b 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) + elseif(${project} STREQUAL STORAGE_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From 3bd6c572f6b75b82a72bc500e3fadebfb6e6df1e Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 24 May 2022 10:24:42 -0700 Subject: [PATCH 09/13] error --- cmake-modules/FolderList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-modules/FolderList.cmake b/cmake-modules/FolderList.cmake index 599350982b..8c3685b432 100644 --- a/cmake-modules/FolderList.cmake +++ b/cmake-modules/FolderList.cmake @@ -17,7 +17,7 @@ macro(GetFolderList project) elseif(${project} STREQUAL STORAGE_BLOBS) DownloadDepVersion(sdk/core azure-core 1.5.0) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.3) - elseif(${project} STREQUAL STORAGE_DATALAKE) + elseif(${project} STREQUAL STORAGE_FILES_DATALAKE) DownloadDepVersion(sdk/core azure-core 1.3.1) DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.2.2) DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.3.0) From 68ab4153c7d59c3d115c9b16e1de56c08b088c98 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Wed, 8 Jun 2022 18:01:09 -0700 Subject: [PATCH 10/13] example of perf test --- .vs/launch.vs.json | 34 +++++++ CMakeSettings.json | 23 ++++- .../CMakeLists.txt | 6 +- .../test/perf/CMakeLists.txt | 38 +++++++ .../test/get_certificate_test.hpp | 98 +++++++++++++++++++ ...curity_keyvault_certificates_perf_test.cpp | 18 ++++ 6 files changed, 213 insertions(+), 4 deletions(-) create mode 100644 .vs/launch.vs.json create mode 100644 sdk/keyvault/azure-security-keyvault-certificates/test/perf/CMakeLists.txt create mode 100644 sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp create mode 100644 sdk/keyvault/azure-security-keyvault-certificates/test/perf/src/azure_security_keyvault_certificates_perf_test.cpp diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json new file mode 100644 index 0000000000..fb5ff70bec --- /dev/null +++ b/.vs/launch.vs.json @@ -0,0 +1,34 @@ +{ + "version": "0.2.1", + "defaults": {}, + "configurations": [ + { + "type": "default", + "project": "CMakeLists.txt", + "projectTarget": "azure-security-keyvault-keys-perf.exe (sdk\\keyvault\\azure-security-keyvault-keys\\test\\perf\\azure-security-keyvault-keys-perf.exe)", + "name": "azure-security-keyvault-keys-perf.exe (sdk\\keyvault\\azure-security-keyvault-keys\\test\\perf\\azure-security-keyvault-keys-perf.exe)", + "args": [ + "GetKey", + "--vaultUrl=https://gearamakv1.vault.azure.net/", + "--keyName=CreateEcKey", + "--tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47", + "--clientId=1be2562c-52c4-4a9c-9b63-c310936d00d6", + "--secret=Ntz7Q~4Qhstd6pcUrsyrvJgXHBRlVnbqwsyCm" + ] + }, + { + "type": "default", + "project": "CMakeLists.txt", + "projectTarget": "azure-security-keyvault-certificates-perf.exe (sdk\\keyvault\\azure-security-keyvault-certificates\\test\\perf\\azure-security-keyvault-certificates-perf.exe)", + "name": "azure-security-keyvault-certificates-perf.exe (sdk\\keyvault\\azure-security-keyvault-certificates\\test\\perf\\azure-security-keyvault-certificates-perf.exe)", + "args": [ + "GetCertificate", + "--vaultUrl=https://gearamakv1.vault.azure.net/", + "--certName=testCert", + "--tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47", + "--clientId=1be2562c-52c4-4a9c-9b63-c310936d00d6", + "--secret=Ntz7Q~4Qhstd6pcUrsyrvJgXHBRlVnbqwsyCm" + ] + } + ] +} \ No newline at end of file diff --git a/CMakeSettings.json b/CMakeSettings.json index 445a2b6952..c10c6410f7 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -21,7 +21,6 @@ "value": "True", "type": "BOOL" } - ] }, { @@ -231,6 +230,28 @@ "type": "BOOL" } ] + }, + { + "name": "x64-DebugWithPerfTest", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "-DINSTALL_GTEST=OFF -DBUILD_TESTING=ON -DBUILD_TRANSPORT_CURL=ON -DBUILD_SAMPLES=ON -DBUILD_PERFORMANCE_TESTS=ON", + "buildCommandArgs": "-v", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [ + { + "name": "VCPKG_TARGET_TRIPLET", + "value": "x64-windows-static", + "type": "STRING" + }, + { + "name": "MSVC_USE_STATIC_CRT", + "value": "True", + "type": "BOOL" + } + ] } ] } \ No newline at end of file diff --git a/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt index 205a5e008f..40c099e2ac 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt +++ b/sdk/keyvault/azure-security-keyvault-certificates/CMakeLists.txt @@ -112,9 +112,9 @@ if(BUILD_TESTING) endif() -# if (BUILD_PERFORMANCE_TESTS) -# add_subdirectory(test/perf) -# endif() +if (BUILD_PERFORMANCE_TESTS) + add_subdirectory(test/perf) +endif() if(BUILD_SAMPLES) add_subdirectory(test/samples) diff --git a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/CMakeLists.txt b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/CMakeLists.txt new file mode 100644 index 0000000000..5ef328b4f7 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# SPDX-License-Identifier: MIT + +# Configure CMake project. +cmake_minimum_required (VERSION 3.13) +project(azure-security-keyvault-certificates-perf LANGUAGES CXX) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +set( + AZURE_KEYVAULT_CERTIFICATES_PERF_TEST_HEADER + inc/azure/keyvault/certificates/test/get_certificate_test.hpp +) + +set( + AZURE_KEYVAULT_CERTIFICATES_PERF_TEST_SOURCE + src/azure_security_keyvault_certificates_perf_test.cpp +) + +# Name the binary to be created. +add_executable ( + azure-security-keyvault-certificates-perf + ${AZURE_KEYVAULT_CERTIFICATES_PERF_TEST_HEADER} ${AZURE_KEYVAULT_CERTIFICATES_PERF_TEST_SOURCE} +) +create_per_service_target_build(keyvault azure-security-keyvault-certificates-perf) +create_map_file(azure-security-keyvault-certificates-perf azure-security-keyvault-certificates-perf.map) + +# Include the headers from the project. +target_include_directories( + azure-security-keyvault-certificates-perf + PUBLIC + $ +) + +# link the `azure-perf` lib together with any other library which will be used for the tests. +target_link_libraries(azure-security-keyvault-certificates-perf PRIVATE azure-identity azure-security-keyvault-certificates azure-perf) +# Make sure the project will appear in the test folder for Visual Studio CMake view +set_target_properties(azure-security-keyvault-certificates-perf PROPERTIES FOLDER "Tests/Keyvault") diff --git a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp new file mode 100644 index 0000000000..c45100c6c8 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +/** + * @file + * @brief Test the overhead of getting a certificate. + * + */ + +#pragma once + +#include + +#include +#include + +#include +#include +#include + +namespace Azure { namespace Security { namespace KeyVault { namespace Certificates { namespace Test { + + /** + * @brief A test to measure getting a key performance. + * + */ + class GetCertificate : public Azure::Perf::PerfTest { + private: + std::string m_vaultUrl; + std::string m_certificateName; + std::string m_tenantId; + std::string m_clientId; + std::string m_secret; + std::shared_ptr m_credential; + std::unique_ptr m_client; + + public: + /** + * @brief Get the Ids and secret + * + */ + void Setup() override + { + m_vaultUrl = m_options.GetMandatoryOption("vaultUrl"); + m_certificateName = m_options.GetMandatoryOption("certName"); + m_tenantId = m_options.GetMandatoryOption("TenantId"); + m_clientId = m_options.GetMandatoryOption("ClientId"); + m_secret = m_options.GetMandatoryOption("Secret"); + m_credential = std::make_shared( + m_tenantId, m_clientId, m_secret); + m_client = std::make_unique( + m_vaultUrl, + m_credential, + InitClientOptions()); + } + + /** + * @brief Construct a new GetCertificate test. + * + * @param options The test options. + */ + GetCertificate(Azure::Perf::TestOptions options) : PerfTest(options) {} + + /** + * @brief Define the test + * + */ + void Run(Azure::Core::Context const&) override { auto t = m_client->GetCertificate(m_certificateName); } + + /** + * @brief Define the test options for the test. + * + * @return The list of test options. + */ + std::vector GetTestOptions() override + { + return { + {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, true}, + {"certName", {"--certName"}, "The Certificate name to get.", 1, true}, + {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}, + {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, true}, + {"Secret", {"--secret"}, "The secret for authentication.", 1, true, true}}; + } + + /** + * @brief Get the static Test Metadata for the test. + * + * @return Azure::Perf::TestMetadata describing the test. + */ + static Azure::Perf::TestMetadata GetTestMetadata() + { + return {"GetCertificate", "Get a certificate", [](Azure::Perf::TestOptions options) { + return std::make_unique(options); + }}; + } + }; + +}}}}} // namespace Azure::Security::KeyVault::Keys::Test diff --git a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/src/azure_security_keyvault_certificates_perf_test.cpp b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/src/azure_security_keyvault_certificates_perf_test.cpp new file mode 100644 index 0000000000..e0c2e4486d --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/src/azure_security_keyvault_certificates_perf_test.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// SPDX-License-Identifier: MIT + +#include + +#include "azure/keyvault/certificates/test/get_certificate_test.hpp" + +int main(int argc, char** argv) +{ + + // Create the test list + std::vector tests{ + Azure::Security::KeyVault::Certificates::Test::GetCertificate::GetTestMetadata()}; + + Azure::Perf::Program::Run(Azure::Core::Context::ApplicationContext, tests, argc, argv); + + return 0; +} From 32519f1c3b5551953d0a04a7add6782ee5fc8ec9 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:21:05 -0700 Subject: [PATCH 11/13] remove file --- .vs/launch.vs.json | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .vs/launch.vs.json diff --git a/.vs/launch.vs.json b/.vs/launch.vs.json deleted file mode 100644 index fb5ff70bec..0000000000 --- a/.vs/launch.vs.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "0.2.1", - "defaults": {}, - "configurations": [ - { - "type": "default", - "project": "CMakeLists.txt", - "projectTarget": "azure-security-keyvault-keys-perf.exe (sdk\\keyvault\\azure-security-keyvault-keys\\test\\perf\\azure-security-keyvault-keys-perf.exe)", - "name": "azure-security-keyvault-keys-perf.exe (sdk\\keyvault\\azure-security-keyvault-keys\\test\\perf\\azure-security-keyvault-keys-perf.exe)", - "args": [ - "GetKey", - "--vaultUrl=https://gearamakv1.vault.azure.net/", - "--keyName=CreateEcKey", - "--tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47", - "--clientId=1be2562c-52c4-4a9c-9b63-c310936d00d6", - "--secret=Ntz7Q~4Qhstd6pcUrsyrvJgXHBRlVnbqwsyCm" - ] - }, - { - "type": "default", - "project": "CMakeLists.txt", - "projectTarget": "azure-security-keyvault-certificates-perf.exe (sdk\\keyvault\\azure-security-keyvault-certificates\\test\\perf\\azure-security-keyvault-certificates-perf.exe)", - "name": "azure-security-keyvault-certificates-perf.exe (sdk\\keyvault\\azure-security-keyvault-certificates\\test\\perf\\azure-security-keyvault-certificates-perf.exe)", - "args": [ - "GetCertificate", - "--vaultUrl=https://gearamakv1.vault.azure.net/", - "--certName=testCert", - "--tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47", - "--clientId=1be2562c-52c4-4a9c-9b63-c310936d00d6", - "--secret=Ntz7Q~4Qhstd6pcUrsyrvJgXHBRlVnbqwsyCm" - ] - } - ] -} \ No newline at end of file From 2a7c3d7bcb3e0e6542a414396639e4e11aca2b20 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Fri, 10 Jun 2022 10:52:47 -0700 Subject: [PATCH 12/13] create certs and keys in post setup, use to run the test --- sdk/core/perf/inc/azure/perf/base_test.hpp | 4 +- .../test/get_certificate_test.hpp | 56 ++++++++++++++++--- .../azure/keyvault/keys/test/get_key_test.hpp | 25 ++++++++- 3 files changed, 74 insertions(+), 11 deletions(-) diff --git a/sdk/core/perf/inc/azure/perf/base_test.hpp b/sdk/core/perf/inc/azure/perf/base_test.hpp index 18a0e9ee9f..217cff1d41 100644 --- a/sdk/core/perf/inc/azure/perf/base_test.hpp +++ b/sdk/core/perf/inc/azure/perf/base_test.hpp @@ -70,7 +70,7 @@ namespace Azure { namespace Perf { * or any other configuration to happen after a test set up definition. * */ - void PostSetUp(); + virtual void PostSetUp(); /** * @brief Define actions to run after each test run. @@ -79,7 +79,7 @@ namespace Azure { namespace Perf { * letting test do clean up. * */ - void PreCleanUp(); + virtual void PreCleanUp(); void ConfigureInsecureConnection(Azure::Core::_internal::ClientOptions& clientOptions); diff --git a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp index c45100c6c8..46f538a713 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp +++ b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -42,7 +43,6 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat void Setup() override { m_vaultUrl = m_options.GetMandatoryOption("vaultUrl"); - m_certificateName = m_options.GetMandatoryOption("certName"); m_tenantId = m_options.GetMandatoryOption("TenantId"); m_clientId = m_options.GetMandatoryOption("ClientId"); m_secret = m_options.GetMandatoryOption("Secret"); @@ -54,6 +54,44 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat InitClientOptions()); } + /** + * @brief Create a random named certificate. + * + */ + void PostSetUp() override + { + std::string name("perf"); + int suffixLen = 10; + static const char alphanum[] + = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + std::string suffix; + suffix.reserve(suffixLen); + + for (int i = 0; i < suffixLen; ++i) + { + suffix += alphanum[rand() % (sizeof(alphanum) - 1)]; + } + + m_certificateName = name+suffix; + CertificateCreateOptions options; + options.Policy.Subject = "CN=xyz"; + options.Policy.ValidityInMonths = 12; + options.Policy.Enabled = true; + + options.Properties.Enabled = true; + options.Properties.Name = m_certificateName; + options.Policy.ContentType = CertificateContentType::Pkcs12; + options.Policy.IssuerName = "Self"; + + LifetimeAction action; + action.LifetimePercentage = 80; + action.Action = CertificatePolicyAction::AutoRenew; + options.Policy.LifetimeActions.emplace_back(action); + + auto response = m_client->StartCreateCertificate(m_certificateName, options); + auto pollResult = response.PollUntilDone(std::chrono::milliseconds(2000)); + } + /** * @brief Construct a new GetCertificate test. * @@ -65,7 +103,10 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat * @brief Define the test * */ - void Run(Azure::Core::Context const&) override { auto t = m_client->GetCertificate(m_certificateName); } + void Run(Azure::Core::Context const&) override + { + auto t = m_client->GetCertificate(m_certificateName); + } /** * @brief Define the test options for the test. @@ -76,7 +117,6 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat { return { {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, true}, - {"certName", {"--certName"}, "The Certificate name to get.", 1, true}, {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}, {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, true}, {"Secret", {"--secret"}, "The secret for authentication.", 1, true, true}}; @@ -89,10 +129,12 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat */ static Azure::Perf::TestMetadata GetTestMetadata() { - return {"GetCertificate", "Get a certificate", [](Azure::Perf::TestOptions options) { - return std::make_unique(options); - }}; + return { + "GetCertificate", "Get a certificate", [](Azure::Perf::TestOptions options) { + return std::make_unique( + options); + }}; } }; -}}}}} // namespace Azure::Security::KeyVault::Keys::Test +}}}}} // namespace Azure::Security::KeyVault::Certificates::Test diff --git a/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp b/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp index c75f7a0ef8..60db93ddea 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp @@ -42,7 +42,6 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam void Setup() override { m_vaultUrl = m_options.GetMandatoryOption("vaultUrl"); - m_keyName = m_options.GetMandatoryOption("keyName"); m_tenantId = m_options.GetMandatoryOption("TenantId"); m_clientId = m_options.GetMandatoryOption("ClientId"); m_secret = m_options.GetMandatoryOption("Secret"); @@ -54,6 +53,29 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam InitClientOptions()); } + /** + * @brief Create a random named certificate. + * + */ + void PostSetUp() override + { + std::string name("perf"); + int suffixLen = 10; + static const char alphanum[] + = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + std::string suffix; + suffix.reserve(suffixLen); + + for (int i = 0; i < suffixLen; ++i) + { + suffix += alphanum[rand() % (sizeof(alphanum) - 1)]; + } + + m_keyName = name + suffix; + auto ecKey = Azure::Security::KeyVault::Keys::CreateEcKeyOptions(m_keyName); + auto keyResponse = m_client->CreateEcKey(ecKey); + } + /** * @brief Construct a new GetKey test. * @@ -76,7 +98,6 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam { return { {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, true}, - {"keyName", {"--keyName"}, "The Key name to get.", 1, true}, {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}, {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, true}, {"Secret", {"--secret"}, "The secret for authentication.", 1, true, true}}; From 3966fdda2ab4a83862bcd4e7332482f4c2f07d06 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 21 Jun 2022 11:51:37 -0700 Subject: [PATCH 13/13] PR comments --- sdk/core/perf/inc/azure/perf/base_test.hpp | 4 +- .../test/get_certificate_test.hpp | 42 ++++++++++++------- .../azure/keyvault/keys/test/get_key_test.hpp | 25 +++++++---- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/sdk/core/perf/inc/azure/perf/base_test.hpp b/sdk/core/perf/inc/azure/perf/base_test.hpp index 217cff1d41..18a0e9ee9f 100644 --- a/sdk/core/perf/inc/azure/perf/base_test.hpp +++ b/sdk/core/perf/inc/azure/perf/base_test.hpp @@ -70,7 +70,7 @@ namespace Azure { namespace Perf { * or any other configuration to happen after a test set up definition. * */ - virtual void PostSetUp(); + void PostSetUp(); /** * @brief Define actions to run after each test run. @@ -79,7 +79,7 @@ namespace Azure { namespace Perf { * letting test do clean up. * */ - virtual void PreCleanUp(); + void PreCleanUp(); void ConfigureInsecureConnection(Azure::Core::_internal::ClientOptions& clientOptions); diff --git a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp index 46f538a713..4cfb141dd7 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp +++ b/sdk/keyvault/azure-security-keyvault-certificates/test/perf/inc/azure/keyvault/certificates/test/get_certificate_test.hpp @@ -11,15 +11,21 @@ #include +#include #include #include - #include #include #include #include -namespace Azure { namespace Security { namespace KeyVault { namespace Certificates { namespace Test { +using namespace Azure::Core::_internal; + +namespace Azure { + namespace Security { + namespace KeyVault { + namespace Certificates { + namespace Test { /** * @brief A test to measure getting a key performance. @@ -42,23 +48,28 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat */ void Setup() override { - m_vaultUrl = m_options.GetMandatoryOption("vaultUrl"); - m_tenantId = m_options.GetMandatoryOption("TenantId"); - m_clientId = m_options.GetMandatoryOption("ClientId"); - m_secret = m_options.GetMandatoryOption("Secret"); + m_vaultUrl = m_options.GetOptionOrDefault( + "vaultUrl", Environment::GetVariable("AZURE_KEYVAULT_URL")); + m_tenantId = m_options.GetOptionOrDefault( + "TenantId", Environment::GetVariable("AZURE_TENANT_ID")); + m_clientId = m_options.GetOptionOrDefault( + "ClientId", Environment::GetVariable("AZURE_CLIENT_ID")); + m_secret = m_options.GetOptionOrDefault( + "Secret", Environment::GetVariable("AZURE_CLIENT_SECRET")); m_credential = std::make_shared( m_tenantId, m_clientId, m_secret); m_client = std::make_unique( m_vaultUrl, m_credential, InitClientOptions()); + this->CreateRandomNameCertificate(); } /** * @brief Create a random named certificate. * */ - void PostSetUp() override + void CreateRandomNameCertificate() { std::string name("perf"); int suffixLen = 10; @@ -72,7 +83,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat suffix += alphanum[rand() % (sizeof(alphanum) - 1)]; } - m_certificateName = name+suffix; + m_certificateName = name + suffix; CertificateCreateOptions options; options.Policy.Subject = "CN=xyz"; options.Policy.ValidityInMonths = 12; @@ -87,8 +98,11 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat action.LifetimePercentage = 80; action.Action = CertificatePolicyAction::AutoRenew; options.Policy.LifetimeActions.emplace_back(action); - - auto response = m_client->StartCreateCertificate(m_certificateName, options); + auto duration = std::chrono::minutes(5); + auto deadline = std::chrono::system_clock::now() + duration; + Azure::Core::Context context; + auto response = m_client->StartCreateCertificate( + m_certificateName, options, context.WithDeadline(deadline)); auto pollResult = response.PollUntilDone(std::chrono::milliseconds(2000)); } @@ -116,10 +130,10 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Certificat std::vector GetTestOptions() override { return { - {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, true}, - {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}, - {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, true}, - {"Secret", {"--secret"}, "The secret for authentication.", 1, true, true}}; + {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, false}, + {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, false}, + {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, false}, + {"Secret", {"--secret"}, "The secret for authentication.", 1, false, true}}; } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp b/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp index 60db93ddea..339afc5291 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key_test.hpp @@ -11,6 +11,7 @@ #include +#include #include #include @@ -18,6 +19,7 @@ #include #include +using namespace Azure::Core::_internal; namespace Azure { namespace Security { namespace KeyVault { namespace Keys { namespace Test { /** @@ -41,23 +43,28 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam */ void Setup() override { - m_vaultUrl = m_options.GetMandatoryOption("vaultUrl"); - m_tenantId = m_options.GetMandatoryOption("TenantId"); - m_clientId = m_options.GetMandatoryOption("ClientId"); - m_secret = m_options.GetMandatoryOption("Secret"); + m_vaultUrl = m_options.GetOptionOrDefault( + "vaultUrl", Environment::GetVariable("AZURE_KEYVAULT_URL")); + m_tenantId = m_options.GetOptionOrDefault( + "TenantId", Environment::GetVariable("AZURE_TENANT_ID")); + m_clientId = m_options.GetOptionOrDefault( + "ClientId", Environment::GetVariable("AZURE_CLIENT_ID")); + m_secret = m_options.GetOptionOrDefault( + "Secret", Environment::GetVariable("AZURE_CLIENT_SECRET")); m_credential = std::make_shared( m_tenantId, m_clientId, m_secret); m_client = std::make_unique( m_vaultUrl, m_credential, InitClientOptions()); + this->CreateRandomNameKey(); } /** * @brief Create a random named certificate. * */ - void PostSetUp() override + void CreateRandomNameKey() { std::string name("perf"); int suffixLen = 10; @@ -97,10 +104,10 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam std::vector GetTestOptions() override { return { - {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, true}, - {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, true}, - {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, true}, - {"Secret", {"--secret"}, "The secret for authentication.", 1, true, true}}; + {"vaultUrl", {"--vaultUrl"}, "The Key Vault Account.", 1, false}, + {"TenantId", {"--tenantId"}, "The tenant Id for the authentication.", 1, false}, + {"ClientId", {"--clientId"}, "The client Id for the authentication.", 1, false}, + {"Secret", {"--secret"}, "The secret for authentication.", 1, false, true}}; } /**