From e4d8522769da3c315fdec0752adaf7e21d25c3c9 Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Fri, 10 Sep 2021 09:15:31 -0700 Subject: [PATCH 01/15] k8s conformance test powershell file added --- testsuite/k8s-conformance-test-suite.ps1 | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 testsuite/k8s-conformance-test-suite.ps1 diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 new file mode 100644 index 0000000..ff8485f --- /dev/null +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -0,0 +1,84 @@ +$connectedClustedId=-join (((48..57)+(65..90)+(97..122)) * 80 |Get-Random -Count 7 |%{[char]$_}) +$AZ_TENANT_ID= # tenant field of the service principal +$AZ_SUBSCRIPTION_ID= # subscription id of the azure subscription (will be provided) +$AZ_CLIENT_ID= # appid field of the service principal +$AZ_CLIENT_SECRET= # password field of the service principal +$AZ_STORAGE_ACCOUNT= # name of your storage account +$AZ_STORAGE_ACCOUNT_SAS="" # sas token for your storage account, please add it within the quotes +$RESOURCE_GROUP= # resource group name; set this to the resource group +$OFFERING_NAME= # name of the partner offering; use this variable to distinguish between the results tar for different offerings +$CLUSTERNAME="arc-partner-test"+$connectedClustedId # name of the arc connected cluster +$LOCATION= # location of the arc connected cluster + +# Platform Cleanup Plugin +$CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out + +# In case your cluster is behind an outbound proxy, please add the following environment variables in the below command +# --plugin-env azure-arc-platform.HTTPS_PROXY="http://:" +# --plugin-env azure-arc-platform.HTTP_PROXY="http://:" +# --plugin-env azure-arc-platform.NO_PROXY="kubernetes.default.svc," + +# In case your outbound proxy is setup with certificate authentication, follow the below steps: +# Create a Kubernetes generic secret with the name sonobuoy-proxy-cert with key proxycert in any namespace: +# kubectl create secret generic sonobuoy-proxy-cert --from-file=proxycert= +# By default we check for the secret in the default namespace. In case you have created the secret in some other namespace, please add the following variables in the sonobuoy run command: +# --plugin-env azure-arc-platform.PROXY_CERT_NAMESPACE="" +# --plugin-env azure-arc-agent-cleanup.PROXY_CERT_NAMESPACE="namespace of sonobuoy secret" + +az login --service-principal --username $AZ_CLIENT_ID --password $AZ_CLIENT_SECRET --tenant $AZ_TENANT_ID +az account set -s $AZ_SUBSCRIPTION_ID + + +$arc_platform_version = Get-Content -Path @("aak8sSupportPolicy.txt") + +foreach($version in $arc_platform_version) +{ + Write-Host "Running the test suite for Arc for Kubernetes version: ${version}" + + sonobuoy run --wait ` + --plugin arc-k8s-platform/platform.yaml ` + --plugin-env azure-arc-platform.TENANT_ID=$AZ_TENANT_ID ` + --plugin-env azure-arc-platform.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` + --plugin-env azure-arc-platform.RESOURCE_GROUP=$RESOURCE_GROUP ` + --plugin-env azure-arc-platform.CLUSTER_NAME=$CLUSTERNAME ` + --plugin-env azure-arc-platform.LOCATION=$LOCATION ` + --plugin-env azure-arc-platform.CLIENT_ID=$AZ_CLIENT_ID ` + --plugin-env azure-arc-platform.CLIENT_SECRET=$AZ_CLIENT_SECRET ` + --plugin arc-k8s-platform/cleanup.yaml ` + --plugin-env azure-arc-platform.HELMREGISTRY=mcr.microsoft.com/azurearck8s/batch1/stable/azure-arc-k8sagents:$arc_platform_version ` + --plugin-env azure-arc-agent-cleanup.TENANT_ID=$AZ_TENANT_ID ` + --plugin-env azure-arc-agent-cleanup.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` + --plugin-env azure-arc-agent-cleanup.RESOURCE_GROUP=$RESOURCE_GROUP ` + --plugin-env azure-arc-agent-cleanup.CLUSTER_NAME=$CLUSTERNAME ` + --plugin-env azure-arc-agent-cleanup.CLEANUP_TIMEOUT=$CLEANUP_TIMEOUT ` + --plugin-env azure-arc-agent-cleanup.CLIENT_ID=$AZ_CLIENT_ID ` + --plugin-env azure-arc-agent-cleanup.CLIENT_SECRET=$AZ_CLIENT_SECRET + + Write-Host "Test execution completed..Retrieving results" + + $sonobuoyResults=$(sonobuoy retrieve) + + sonobuoy results $sonobuoyResults + + New-Item -Path . -Name "results" -ItemType "directory" + Move-Item -Path $sonobuoyResults -Destination results\$sonobuoyResults + + Copy-Item .\partner-metadata.md -Destination results\partner-metadata.md + + tar -czvf conformance-results-$version.tar.gz results + + Remove-Item .\results -Recurse + + Write-Host "Publishing results.." + + $versionArry=$version.Split(".") + + $containerString="conformance-results-major-"+$versionArry[0]+"-minor-"+$versionArry[1]+"-patch-"+$versionArry[2] + + az storage container create --n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS + az storage blob upload --file conformance-results-$version.tar.gz --name conformance-results-$OFFERING_NAME.tar.gz --container-name $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS + + echo "Cleaning the cluster.." + sonobuoy delete --wait + +} \ No newline at end of file From 3f7588a2fb88d1eeac2571a7dbe013863498f8cc Mon Sep 17 00:00:00 2001 From: v-suvbera <90410011+v-suvbera@users.noreply.github.com> Date: Fri, 10 Sep 2021 09:25:18 -0700 Subject: [PATCH 02/15] powershell file added - Conformance test --- testsuite/k8s-conformance-test-suite.ps1 | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 testsuite/k8s-conformance-test-suite.ps1 diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 new file mode 100644 index 0000000..463f89b --- /dev/null +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -0,0 +1,84 @@ +$connectedClustedId=-join (((48..57)+(65..90)+(97..122)) * 80 |Get-Random -Count 7 |%{[char]$_}) +$AZ_TENANT_ID= # tenant field of the service principal +$AZ_SUBSCRIPTION_ID= # subscription id of the azure subscription (will be provided) +$AZ_CLIENT_ID= # appid field of the service principal +$AZ_CLIENT_SECRET= # password field of the service principal +$AZ_STORAGE_ACCOUNT= # name of your storage account +$AZ_STORAGE_ACCOUNT_SAS="" # sas token for your storage account, please add it within the quotes +$RESOURCE_GROUP= # resource group name; set this to the resource group +$OFFERING_NAME= # name of the partner offering; use this variable to distinguish between the results tar for different offerings +$CLUSTERNAME="arc-partner-test"+$connectedClustedId # name of the arc connected cluster +$LOCATION= # location of the arc connected cluster + +# Platform Cleanup Plugin +$CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out + +# In case your cluster is behind an outbound proxy, please add the following environment variables in the below command +# --plugin-env azure-arc-platform.HTTPS_PROXY="http://:" +# --plugin-env azure-arc-platform.HTTP_PROXY="http://:" +# --plugin-env azure-arc-platform.NO_PROXY="kubernetes.default.svc," + +# In case your outbound proxy is setup with certificate authentication, follow the below steps: +# Create a Kubernetes generic secret with the name sonobuoy-proxy-cert with key proxycert in any namespace: +# kubectl create secret generic sonobuoy-proxy-cert --from-file=proxycert= +# By default we check for the secret in the default namespace. In case you have created the secret in some other namespace, please add the following variables in the sonobuoy run command: +# --plugin-env azure-arc-platform.PROXY_CERT_NAMESPACE="" +# --plugin-env azure-arc-agent-cleanup.PROXY_CERT_NAMESPACE="namespace of sonobuoy secret" + +az login --service-principal --username $AZ_CLIENT_ID --password $AZ_CLIENT_SECRET --tenant $AZ_TENANT_ID +az account set -s $AZ_SUBSCRIPTION_ID + + +$arc_platform_version = Get-Content -Path @("aak8sSupportPolicy.txt") + +foreach($version in $arc_platform_version) +{ + Write-Host "Running the test suite for Arc for Kubernetes version: ${version}" + + sonobuoy run --wait ` + --plugin arc-k8s-platform/platform.yaml ` + --plugin-env azure-arc-platform.TENANT_ID=$AZ_TENANT_ID ` + --plugin-env azure-arc-platform.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` + --plugin-env azure-arc-platform.RESOURCE_GROUP=$RESOURCE_GROUP ` + --plugin-env azure-arc-platform.CLUSTER_NAME=$CLUSTERNAME ` + --plugin-env azure-arc-platform.LOCATION=$LOCATION ` + --plugin-env azure-arc-platform.CLIENT_ID=$AZ_CLIENT_ID ` + --plugin-env azure-arc-platform.CLIENT_SECRET=$AZ_CLIENT_SECRET ` + --plugin arc-k8s-platform/cleanup.yaml ` + --plugin-env azure-arc-platform.HELMREGISTRY=mcr.microsoft.com/azurearck8s/batch1/stable/azure-arc-k8sagents:$arc_platform_version ` + --plugin-env azure-arc-agent-cleanup.TENANT_ID=$AZ_TENANT_ID ` + --plugin-env azure-arc-agent-cleanup.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` + --plugin-env azure-arc-agent-cleanup.RESOURCE_GROUP=$RESOURCE_GROUP ` + --plugin-env azure-arc-agent-cleanup.CLUSTER_NAME=$CLUSTERNAME ` + --plugin-env azure-arc-agent-cleanup.CLEANUP_TIMEOUT=$CLEANUP_TIMEOUT ` + --plugin-env azure-arc-agent-cleanup.CLIENT_ID=$AZ_CLIENT_ID ` + --plugin-env azure-arc-agent-cleanup.CLIENT_SECRET=$AZ_CLIENT_SECRET + + Write-Host "Test execution completed..Retrieving results" + + $sonobuoyResults=$(sonobuoy retrieve) + + sonobuoy results $sonobuoyResults + + New-Item -Path . -Name "results" -ItemType "directory" + Move-Item -Path $sonobuoyResults -Destination results\$sonobuoyResults + + Copy-Item .\partner-metadata.md -Destination results\partner-metadata.md + + tar -czvf conformance-results-$version.tar.gz results + + Remove-Item .\results -Recurse + + Write-Host "Publishing results.." + + $versionArry=$version.Split(".") + + $containerString="conformance-results-major-"+$versionArry[0]+"-minor-"+$versionArry[1]+"-patch-"+$versionArry[2] + + az storage container create --n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS + az storage blob upload --file conformance-results-$version.tar.gz --name conformance-results-$OFFERING_NAME.tar.gz --container-name $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS + + echo "Cleaning the cluster.." + sonobuoy delete --wait + +} \ No newline at end of file From 99589c4f2ba7f41ea38583f0a5039821ce3f7413 Mon Sep 17 00:00:00 2001 From: v-suvbera <90410011+v-suvbera@users.noreply.github.com> Date: Fri, 10 Sep 2021 10:56:51 -0700 Subject: [PATCH 03/15] Update k8s-conformance-test-suite.ps1 --- testsuite/k8s-conformance-test-suite.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 index 463f89b..cc0ffc3 100644 --- a/testsuite/k8s-conformance-test-suite.ps1 +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -1,3 +1,7 @@ +# Set the following environment variables to run the test suite + +# Common Variables +# Some of the variables need to be populated from the service principal and storage account details provided to you by Microsoft $connectedClustedId=-join (((48..57)+(65..90)+(97..122)) * 80 |Get-Random -Count 7 |%{[char]$_}) $AZ_TENANT_ID= # tenant field of the service principal $AZ_SUBSCRIPTION_ID= # subscription id of the azure subscription (will be provided) @@ -45,7 +49,7 @@ foreach($version in $arc_platform_version) --plugin-env azure-arc-platform.CLIENT_ID=$AZ_CLIENT_ID ` --plugin-env azure-arc-platform.CLIENT_SECRET=$AZ_CLIENT_SECRET ` --plugin arc-k8s-platform/cleanup.yaml ` - --plugin-env azure-arc-platform.HELMREGISTRY=mcr.microsoft.com/azurearck8s/batch1/stable/azure-arc-k8sagents:$arc_platform_version ` + --plugin-env azure-arc-platform.HELMREGISTRY=mcr.microsoft.com/azurearck8s/batch1/stable/azure-arc-k8sagents:$version ` --plugin-env azure-arc-agent-cleanup.TENANT_ID=$AZ_TENANT_ID ` --plugin-env azure-arc-agent-cleanup.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` --plugin-env azure-arc-agent-cleanup.RESOURCE_GROUP=$RESOURCE_GROUP ` @@ -81,4 +85,4 @@ foreach($version in $arc_platform_version) echo "Cleaning the cluster.." sonobuoy delete --wait -} \ No newline at end of file +} From 3cfcb164cfd0afcb7e0ed98bf3960851e6d06fb1 Mon Sep 17 00:00:00 2001 From: v-suvbera <90410011+v-suvbera@users.noreply.github.com> Date: Fri, 10 Sep 2021 11:04:19 -0700 Subject: [PATCH 04/15] Update k8s-conformance-test-suite.ps1 --- testsuite/k8s-conformance-test-suite.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 index cc0ffc3..a3a1223 100644 --- a/testsuite/k8s-conformance-test-suite.ps1 +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -82,7 +82,7 @@ foreach($version in $arc_platform_version) az storage container create --n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS az storage blob upload --file conformance-results-$version.tar.gz --name conformance-results-$OFFERING_NAME.tar.gz --container-name $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS - echo "Cleaning the cluster.." + Write-Host "Cleaning the cluster.." sonobuoy delete --wait } From cf056b0c99df15cce09dfd47d4659d4a46f6a812 Mon Sep 17 00:00:00 2001 From: v-suvbera <90410011+v-suvbera@users.noreply.github.com> Date: Fri, 10 Sep 2021 11:07:52 -0700 Subject: [PATCH 05/15] Update k8s-conformance-test-suite.ps1 --- testsuite/k8s-conformance-test-suite.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 index a3a1223..49a1be2 100644 --- a/testsuite/k8s-conformance-test-suite.ps1 +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -64,20 +64,20 @@ foreach($version in $arc_platform_version) sonobuoy results $sonobuoyResults - New-Item -Path . -Name "results" -ItemType "directory" + New-Item -Path . -Name "results" -ItemType "directory" Move-Item -Path $sonobuoyResults -Destination results\$sonobuoyResults - Copy-Item .\partner-metadata.md -Destination results\partner-metadata.md + Copy-Item .\partner-metadata.md -Destination results\partner-metadata.md tar -czvf conformance-results-$version.tar.gz results - Remove-Item .\results -Recurse + Remove-Item .\results -Recurse Write-Host "Publishing results.." - $versionArry=$version.Split(".") + $versionArry=$version.Split(".") - $containerString="conformance-results-major-"+$versionArry[0]+"-minor-"+$versionArry[1]+"-patch-"+$versionArry[2] + $containerString="conformance-results-major-"+$versionArry[0]+"-minor-"+$versionArry[1]+"-patch-"+$versionArry[2] az storage container create --n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS az storage blob upload --file conformance-results-$version.tar.gz --name conformance-results-$OFFERING_NAME.tar.gz --container-name $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS From 4a85a8a66886949a201fa5863dc57e56ede9e379 Mon Sep 17 00:00:00 2001 From: Anirudh Raghunath Date: Sat, 11 Sep 2021 15:53:31 +0530 Subject: [PATCH 06/15] script fixes --- testsuite/k8s-conformance-test-suite.ps1 | 20 ++++++++++---------- testsuite/running-tests.md | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 index 49a1be2..7a858d3 100644 --- a/testsuite/k8s-conformance-test-suite.ps1 +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -3,16 +3,16 @@ # Common Variables # Some of the variables need to be populated from the service principal and storage account details provided to you by Microsoft $connectedClustedId=-join (((48..57)+(65..90)+(97..122)) * 80 |Get-Random -Count 7 |%{[char]$_}) -$AZ_TENANT_ID= # tenant field of the service principal -$AZ_SUBSCRIPTION_ID= # subscription id of the azure subscription (will be provided) -$AZ_CLIENT_ID= # appid field of the service principal -$AZ_CLIENT_SECRET= # password field of the service principal -$AZ_STORAGE_ACCOUNT= # name of your storage account -$AZ_STORAGE_ACCOUNT_SAS="" # sas token for your storage account, please add it within the quotes -$RESOURCE_GROUP= # resource group name; set this to the resource group -$OFFERING_NAME= # name of the partner offering; use this variable to distinguish between the results tar for different offerings +$AZ_TENANT_ID="" # tenant field of the service principal, please add it within the quotes +$AZ_SUBSCRIPTION_ID="" # subscription id of the azure subscription (will be provided), please add it within the quotes +$AZ_CLIENT_ID="" # appid field of the service principal, please add it within the quotes +$AZ_CLIENT_SECRET="" # password field of the service principal, please add it within the quotes +$AZ_STORAGE_ACCOUNT="" # name of your storage account, please add it within the quotes +$AZ_STORAGE_ACCOUNT_SAS="`"`"" # sas token for your storage account, please replace with the actual value +$RESOURCE_GROUP="" # resource group name; set this to the resource group provided to you; please add it within the quotes +$OFFERING_NAME="" # name of the partner offering; use this variable to distinguish between the results tar for different offerings $CLUSTERNAME="arc-partner-test"+$connectedClustedId # name of the arc connected cluster -$LOCATION= # location of the arc connected cluster +$LOCATION="eastus" # location of the arc connected cluster # Platform Cleanup Plugin $CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out @@ -79,7 +79,7 @@ foreach($version in $arc_platform_version) $containerString="conformance-results-major-"+$versionArry[0]+"-minor-"+$versionArry[1]+"-patch-"+$versionArry[2] - az storage container create --n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS + az storage container create -n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS az storage blob upload --file conformance-results-$version.tar.gz --name conformance-results-$OFFERING_NAME.tar.gz --container-name $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS Write-Host "Cleaning the cluster.." diff --git a/testsuite/running-tests.md b/testsuite/running-tests.md index 095c9ea..3df77d7 100644 --- a/testsuite/running-tests.md +++ b/testsuite/running-tests.md @@ -28,6 +28,8 @@ This document will enumerate everything you need to do run the sonobuoy based co 4. Execute the script by running `./k8s-conformance-test-suite.sh`. 5. The test suite will take the storage account details as environment variables and will handle publishing the results in the right format. +*The above script is **bash only**. Please use the [`k8s-conformance-test-suite.ps1`](k8s-conformance-test-suite.ps1) script for windows hosts. + ### Arc enabled Data Services 1. Edit the [`ds-conformance-test-suite.sh`](ds-conformance-test-suite.sh) file and set the values for the required environment variables. 2. If your cluster is behind an outbound proxy, please edit the above file according to the instruction provided as comments for proxy configuration. From 6b19b8e80c0600d583909bf43378b5d4cab30c62 Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Fri, 1 Oct 2021 22:06:44 -0700 Subject: [PATCH 07/15] python script file added --- testsuite/k8s-conformance-test-suite.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 testsuite/k8s-conformance-test-suite.py diff --git a/testsuite/k8s-conformance-test-suite.py b/testsuite/k8s-conformance-test-suite.py new file mode 100644 index 0000000..e69de29 From 38a3df6936479e60eb6401882ef7e71e77936c5e Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Fri, 1 Oct 2021 22:16:31 -0700 Subject: [PATCH 08/15] file updated --- testsuite/k8s-conformance-test-suite.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testsuite/k8s-conformance-test-suite.py b/testsuite/k8s-conformance-test-suite.py index e69de29..e58fffd 100644 --- a/testsuite/k8s-conformance-test-suite.py +++ b/testsuite/k8s-conformance-test-suite.py @@ -0,0 +1,10 @@ +# Set the following environment variables to run the test suite + +# Common Variables +# Some of the variables need to be populated from the service principal and storage account details provided to you by Microsoft + +import random +import string + +res = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 7)) +print(res) \ No newline at end of file From 0768f1977b4687ba28573b190489e5157e6c892d Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Tue, 5 Oct 2021 13:48:45 -0700 Subject: [PATCH 09/15] python script file updated --- .vscode/launch.json | 15 ---- testsuite/k8s-conformance-test-suite.py | 115 +++++++++++++++++++++++- 2 files changed, 113 insertions(+), 17 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 7a9dfa0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "pwa-chrome", - "request": "launch", - "name": "Launch Chrome against localhost", - "url": "http://localhost:8080", - "webRoot": "${workspaceFolder}" - } - ] -} \ No newline at end of file diff --git a/testsuite/k8s-conformance-test-suite.py b/testsuite/k8s-conformance-test-suite.py index e58fffd..614b14e 100644 --- a/testsuite/k8s-conformance-test-suite.py +++ b/testsuite/k8s-conformance-test-suite.py @@ -5,6 +5,117 @@ import random import string +import os +import subprocess +import shutil +import tarfile -res = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 7)) -print(res) \ No newline at end of file +from azure.mgmt.resource import SubscriptionClient +from azure.identity import ClientSecretCredential +from azure.storage.blob import ContainerClient + +connectedClustedId = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 7)) + +AZ_TENANT_ID="8548a469-8c0e-4aa4-b534-ac75ca1e02f7" # tenant field of the service principal, please add it within the quotes +AZ_SUBSCRIPTION_ID="3959ec86-5353-4b0c-b5d7-3877122861a0" # subscription id of the azure subscription (will be provided), please add it within the quotes +AZ_CLIENT_ID="27eb2e73-6520-4676-9f36-8dcc4b07efe3" # appid field of the service principal, please add it within the quotes +AZ_CLIENT_SECRET="GnxI5n2AZltrqIfW2.tV4_THYLKGPgqHzB" # password field of the service principal, please add it within the quotes +AZ_STORAGE_ACCOUNT="arcvalidationsa" # name of your storage account, please add it within the quotes +AZ_STORAGE_ACCOUNT_SAS="?sv=2020-08-04&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-10-09T14:59:39Z&st=2021-10-05T06:59:39Z&spr=https&sig=YxYm%2FKdmEfpQJybs4DC0%2FQTB%2B%2BersVC0nK3XuNaK5k0%3D" # sas token for your storage account, please replace with the actual value +RESOURCE_GROUP="external-test" # resource group name; set this to the resource group provided to you; please add it within the quotes +OFFERING_NAME="suvankartest123" # name of the partner offering; use this variable to distinguish between the results tar for different offerings +CLUSTERNAME="arc-partner-test"+connectedClustedId # name of the arc connected cluster +LOCATION="eastus" # location of the arc connected cluster + +# Platform Cleanup Plugin +CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out + +# In case your cluster is behind an outbound proxy, please add the following environment variables in the below command +# --plugin-env azure-arc-platform.HTTPS_PROXY="http://:" +# --plugin-env azure-arc-platform.HTTP_PROXY="http://:" +# --plugin-env azure-arc-platform.NO_PROXY="kubernetes.default.svc," + +# In case your outbound proxy is setup with certificate authentication, follow the below steps: +# Create a Kubernetes generic secret with the name sonobuoy-proxy-cert with key proxycert in any namespace: +# kubectl create secret generic sonobuoy-proxy-cert --from-file=proxycert= +# By default we check for the secret in the default namespace. In case you have created the secret in some other namespace, please add the following variables in the sonobuoy run command: +# --plugin-env azure-arc-platform.PROXY_CERT_NAMESPACE="" +# --plugin-env azure-arc-agent-cleanup.PROXY_CERT_NAMESPACE="namespace of sonobuoy secret" + +credential = ClientSecretCredential(tenant_id=AZ_TENANT_ID, client_id=AZ_CLIENT_ID, client_secret=AZ_CLIENT_SECRET) + +subscription_client = SubscriptionClient(credential) + +subscription = next(subscription_client.subscriptions.list()) +print(subscription.subscription_id) + +def make_tarfile(output_filename, source_dir): + with tarfile.open(output_filename, "w:gz") as tar: + tar.add(source_dir, arcname=os.path.basename(source_dir)) + +optputFolderName = "results" +with open("testsuite/aak8sSupportPolicy.txt", "r") as f: + arc_platform_version = [line.rstrip() for line in f] + +print(arc_platform_version) + +for version in arc_platform_version: + print("Running the test suite for Arc for Kubernetes version:",version ) + + sonobuoyRunCommand = f'sonobuoy run --wait ' \ + '--plugin testsuite/arc-k8s-platform/platform.yaml ' \ + '--plugin-env azure-arc-platform.TENANT_ID={AZ_TENANT_ID} ' \ + '--plugin-env azure-arc-platform.SUBSCRIPTION_ID={AZ_SUBSCRIPTION_ID} ' \ + '--plugin-env azure-arc-platform.RESOURCE_GROUP={RESOURCE_GROUP} ' \ + '--plugin-env azure-arc-platform.CLUSTER_NAME={CLUSTERNAME} ' \ + '--plugin-env azure-arc-platform.LOCATION={LOCATION} ' \ + '--plugin-env azure-arc-platform.CLIENT_ID={AZ_CLIENT_ID} ' \ + '--plugin-env azure-arc-platform.CLIENT_SECRET={AZ_CLIENT_SECRET} ' \ + '--plugin-env azure-arc-platform.HELMREGISTRY=mcr.microsoft.com/azurearck8s/batch1/stable/azure-arc-k8sagents:{version} ' \ + '--plugin testsuite/arc-k8s-platform/cleanup.yaml ' \ + '--plugin-env azure-arc-agent-cleanup.TENANT_ID={AZ_TENANT_ID} ' \ + '--plugin-env azure-arc-agent-cleanup.SUBSCRIPTION_ID={AZ_SUBSCRIPTION_ID} ' \ + '--plugin-env azure-arc-agent-cleanup.RESOURCE_GROUP={RESOURCE_GROUP} ' \ + '--plugin-env azure-arc-agent-cleanup.CLUSTER_NAME={CLUSTERNAME} ' \ + '--plugin-env azure-arc-agent-cleanup.CLEANUP_TIMEOUT={CLEANUP_TIMEOUT} ' \ + '--plugin-env azure-arc-agent-cleanup.CLIENT_ID={AZ_CLIENT_ID} ' \ + '--plugin-env azure-arc-agent-cleanup.CLIENT_SECRET={AZ_CLIENT_SECRET}' + + print("Test execution completed..Retrieving results") + + sonobuoyRunCommandResult = subprocess.run(sonobuoyRunCommand) + + sonobuoyretrieveCommand = "sonobuoy retrieve" + sonobuoyresultFile = subprocess.run(sonobuoyretrieveCommand,capture_output=True, text=True).stdout.strip("\n") + + sonobuoyResultsCommand = f"sonobuoy results {sonobuoyresultFile}" + sonobuoyResultsCommandResult = subprocess.run(sonobuoyResultsCommand) + + os.makedirs(optputFolderName) + shutil.move(sonobuoyresultFile, optputFolderName) + shutil.copy("testsuite/partner-metadata.md",optputFolderName) + tarFileName = f"conformance-results-{version}.tar.gz" + make_tarfile(tarFileName,optputFolderName) + shutil.rmtree(optputFolderName) + + print("Publishing results..") + versionArry = version.split('.') + + containerString = f"conformance-results-major-{versionArry[0]}-minor-{versionArry[1]}-patch-{versionArry[2]}" + + sas_url = f"https://{AZ_STORAGE_ACCOUNT}.blob.core.windows.net/{containerString}{AZ_STORAGE_ACCOUNT_SAS}" + container = ContainerClient.from_container_url(sas_url) + + if not container.exists(): + container.create_container() + + blobName = f"conformance-results-{OFFERING_NAME}.tar.gz" + + blob_client = container.get_blob_client(blobName) + # Upload the created file + with open(tarFileName, "rb") as data: + blob_client.upload_blob(data,blob_type="BlockBlob") + + print("Cleaning the cluster..") + + subprocess.run("sonobuoy delete --wait") \ No newline at end of file From 8c43659458977eb4549d6c778721c157c2aec4a5 Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Tue, 5 Oct 2021 13:53:47 -0700 Subject: [PATCH 10/15] removed secret keys --- testsuite/k8s-conformance-test-suite.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/testsuite/k8s-conformance-test-suite.py b/testsuite/k8s-conformance-test-suite.py index 614b14e..7409234 100644 --- a/testsuite/k8s-conformance-test-suite.py +++ b/testsuite/k8s-conformance-test-suite.py @@ -16,16 +16,16 @@ connectedClustedId = ''.join(random.choices(string.ascii_uppercase + string.digits, k = 7)) -AZ_TENANT_ID="8548a469-8c0e-4aa4-b534-ac75ca1e02f7" # tenant field of the service principal, please add it within the quotes -AZ_SUBSCRIPTION_ID="3959ec86-5353-4b0c-b5d7-3877122861a0" # subscription id of the azure subscription (will be provided), please add it within the quotes -AZ_CLIENT_ID="27eb2e73-6520-4676-9f36-8dcc4b07efe3" # appid field of the service principal, please add it within the quotes -AZ_CLIENT_SECRET="GnxI5n2AZltrqIfW2.tV4_THYLKGPgqHzB" # password field of the service principal, please add it within the quotes -AZ_STORAGE_ACCOUNT="arcvalidationsa" # name of your storage account, please add it within the quotes -AZ_STORAGE_ACCOUNT_SAS="?sv=2020-08-04&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-10-09T14:59:39Z&st=2021-10-05T06:59:39Z&spr=https&sig=YxYm%2FKdmEfpQJybs4DC0%2FQTB%2B%2BersVC0nK3XuNaK5k0%3D" # sas token for your storage account, please replace with the actual value -RESOURCE_GROUP="external-test" # resource group name; set this to the resource group provided to you; please add it within the quotes -OFFERING_NAME="suvankartest123" # name of the partner offering; use this variable to distinguish between the results tar for different offerings -CLUSTERNAME="arc-partner-test"+connectedClustedId # name of the arc connected cluster -LOCATION="eastus" # location of the arc connected cluster +AZ_TENANT_ID="" # tenant field of the service principal, please add it within the quotes +AZ_SUBSCRIPTION_ID="" # subscription id of the azure subscription (will be provided), please add it within the quotes +AZ_CLIENT_ID="" # appid field of the service principal, please add it within the quotes +AZ_CLIENT_SECRET="" # password field of the service principal, please add it within the quotes +AZ_STORAGE_ACCOUNT="" # name of your storage account, please add it within the quotes +AZ_STORAGE_ACCOUNT_SAS="" # sas token for your storage account, please replace with the actual value +RESOURCE_GROUP="" # resource group name; set this to the resource group provided to you; please add it within the quotes +OFFERING_NAME="" # name of the partner offering; use this variable to distinguish between the results tar for different offerings +CLUSTERNAME=""+connectedClustedId # name of the arc connected cluster +LOCATION="" # location of the arc connected cluster # Platform Cleanup Plugin CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out From 9a258504f003f3c9f94f2aba5d83223a6d7d1ace Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Wed, 6 Oct 2021 18:24:02 -0700 Subject: [PATCH 11/15] conformance test python script updated --- testsuite/k8s-conformance-test-suite.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/testsuite/k8s-conformance-test-suite.py b/testsuite/k8s-conformance-test-suite.py index 7409234..13c41ae 100644 --- a/testsuite/k8s-conformance-test-suite.py +++ b/testsuite/k8s-conformance-test-suite.py @@ -24,8 +24,8 @@ AZ_STORAGE_ACCOUNT_SAS="" # sas token for your storage account, please replace with the actual value RESOURCE_GROUP="" # resource group name; set this to the resource group provided to you; please add it within the quotes OFFERING_NAME="" # name of the partner offering; use this variable to distinguish between the results tar for different offerings -CLUSTERNAME=""+connectedClustedId # name of the arc connected cluster -LOCATION="" # location of the arc connected cluster +CLUSTERNAME="arc-partner-test"+connectedClustedId # name of the arc connected cluster +LOCATION="eastus" # location of the arc connected cluster # Platform Cleanup Plugin CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out @@ -83,13 +83,13 @@ def make_tarfile(output_filename, source_dir): print("Test execution completed..Retrieving results") - sonobuoyRunCommandResult = subprocess.run(sonobuoyRunCommand) + sonobuoyRunCommandResult = subprocess.run(sonobuoyRunCommand,shell=True) sonobuoyretrieveCommand = "sonobuoy retrieve" - sonobuoyresultFile = subprocess.run(sonobuoyretrieveCommand,capture_output=True, text=True).stdout.strip("\n") + sonobuoyresultFile = subprocess.run(sonobuoyretrieveCommand,shell=True, capture_output=True, text=True).stdout.strip("\n") sonobuoyResultsCommand = f"sonobuoy results {sonobuoyresultFile}" - sonobuoyResultsCommandResult = subprocess.run(sonobuoyResultsCommand) + sonobuoyResultsCommandResult = subprocess.run(sonobuoyResultsCommand,shell=True) os.makedirs(optputFolderName) shutil.move(sonobuoyresultFile, optputFolderName) @@ -116,6 +116,11 @@ def make_tarfile(output_filename, source_dir): with open(tarFileName, "rb") as data: blob_client.upload_blob(data,blob_type="BlockBlob") - print("Cleaning the cluster..") + print("Cleaning the cluster..") - subprocess.run("sonobuoy delete --wait") \ No newline at end of file + subprocess.run("sonobuoy delete --wait",shell=True) + + + + + \ No newline at end of file From 67c0efa08d4a45cffb8d13bf2efdb0823e0999b1 Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Thu, 7 Oct 2021 15:17:30 -0700 Subject: [PATCH 12/15] python script executation details updated --- testsuite/running-tests.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testsuite/running-tests.md b/testsuite/running-tests.md index 3df77d7..5085995 100644 --- a/testsuite/running-tests.md +++ b/testsuite/running-tests.md @@ -10,6 +10,7 @@ This document will enumerate everything you need to do run the sonobuoy based co 3. Address the [network requirements](https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster#meet-network-requirements) on your cluster for the Arc agents to communicate with Azure. 4. Download and install [git](https://git-scm.com/downloads). 5. Download and install [az cli](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). +6. Download and install [python](https://www.python.org/downloads/) and [pip](https://packaging.python.org/tutorials/ installing-packages/#use-pip-for-installing). ### Additional Prerequisites for Arc enabled Data Services @@ -29,6 +30,7 @@ This document will enumerate everything you need to do run the sonobuoy based co 5. The test suite will take the storage account details as environment variables and will handle publishing the results in the right format. *The above script is **bash only**. Please use the [`k8s-conformance-test-suite.ps1`](k8s-conformance-test-suite.ps1) script for windows hosts. +**Please use the [`k8s-conformance-test-suite.py`](k8s-conformance-test-suite.py) script for both windows and linux hosts.To execute the script create a virtual environment under project root directory and install the following packages using pip [azure-identity](https://pypi.org/project/azure-identity/),[azure-mgmt-resource](https://pypi.org/project/azure-mgmt-resource/) and azure-storage-blob(https://pypi.org/project/azure-storage-blob/). ### Arc enabled Data Services 1. Edit the [`ds-conformance-test-suite.sh`](ds-conformance-test-suite.sh) file and set the values for the required environment variables. From 583821b9f719cb7304c1b4a6bc07aca6c10b65b2 Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Thu, 7 Oct 2021 15:22:05 -0700 Subject: [PATCH 13/15] python script execution details updated --- testsuite/running-tests.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/running-tests.md b/testsuite/running-tests.md index 5085995..5ff28db 100644 --- a/testsuite/running-tests.md +++ b/testsuite/running-tests.md @@ -10,7 +10,7 @@ This document will enumerate everything you need to do run the sonobuoy based co 3. Address the [network requirements](https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/quickstart-connect-cluster#meet-network-requirements) on your cluster for the Arc agents to communicate with Azure. 4. Download and install [git](https://git-scm.com/downloads). 5. Download and install [az cli](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). -6. Download and install [python](https://www.python.org/downloads/) and [pip](https://packaging.python.org/tutorials/ installing-packages/#use-pip-for-installing). +6. Download and install [python](https://www.python.org/downloads/) and [pip](https://packaging.python.org/tutorials/installing-packages/#use-pip-for-installing). ### Additional Prerequisites for Arc enabled Data Services @@ -30,7 +30,8 @@ This document will enumerate everything you need to do run the sonobuoy based co 5. The test suite will take the storage account details as environment variables and will handle publishing the results in the right format. *The above script is **bash only**. Please use the [`k8s-conformance-test-suite.ps1`](k8s-conformance-test-suite.ps1) script for windows hosts. -**Please use the [`k8s-conformance-test-suite.py`](k8s-conformance-test-suite.py) script for both windows and linux hosts.To execute the script create a virtual environment under project root directory and install the following packages using pip [azure-identity](https://pypi.org/project/azure-identity/),[azure-mgmt-resource](https://pypi.org/project/azure-mgmt-resource/) and azure-storage-blob(https://pypi.org/project/azure-storage-blob/). + +**Please use the [`k8s-conformance-test-suite.py`](k8s-conformance-test-suite.py) script for both windows and linux hosts.To execute the script create a virtual environment under project root directory and install the following packages using pip [azure-identity](https://pypi.org/project/azure-identity/),[azure-mgmt-resource](https://pypi.org/project/azure-mgmt-resource/) and [azure-storage-blob](https://pypi.org/project/azure-storage-blob/). ### Arc enabled Data Services 1. Edit the [`ds-conformance-test-suite.sh`](ds-conformance-test-suite.sh) file and set the values for the required environment variables. From 4fba40505a87dcd80531976a0032d56ecd91631a Mon Sep 17 00:00:00 2001 From: Suvankar Bera Date: Thu, 7 Oct 2021 15:24:03 -0700 Subject: [PATCH 14/15] python script execution details updated --- testsuite/running-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/running-tests.md b/testsuite/running-tests.md index 5ff28db..ec8b30c 100644 --- a/testsuite/running-tests.md +++ b/testsuite/running-tests.md @@ -31,7 +31,7 @@ This document will enumerate everything you need to do run the sonobuoy based co *The above script is **bash only**. Please use the [`k8s-conformance-test-suite.ps1`](k8s-conformance-test-suite.ps1) script for windows hosts. -**Please use the [`k8s-conformance-test-suite.py`](k8s-conformance-test-suite.py) script for both windows and linux hosts.To execute the script create a virtual environment under project root directory and install the following packages using pip [azure-identity](https://pypi.org/project/azure-identity/),[azure-mgmt-resource](https://pypi.org/project/azure-mgmt-resource/) and [azure-storage-blob](https://pypi.org/project/azure-storage-blob/). +**Please use the [`k8s-conformance-test-suite.py`](k8s-conformance-test-suite.py) script for both windows and linux hosts.To execute the script create a virtual environment under project root directory and install the following dependent packages using pip [azure-identity](https://pypi.org/project/azure-identity/), [azure-mgmt-resource](https://pypi.org/project/azure-mgmt-resource/) and [azure-storage-blob](https://pypi.org/project/azure-storage-blob/). ### Arc enabled Data Services 1. Edit the [`ds-conformance-test-suite.sh`](ds-conformance-test-suite.sh) file and set the values for the required environment variables. From 4d2121f46ad9e39cac87bdaaa66141a2865ee49b Mon Sep 17 00:00:00 2001 From: v-suvbera <90410011+v-suvbera@users.noreply.github.com> Date: Mon, 11 Oct 2021 19:07:08 +0530 Subject: [PATCH 15/15] merge issue resolved --- testsuite/k8s-conformance-test-suite.ps1 | 91 ------------------------ 1 file changed, 91 deletions(-) diff --git a/testsuite/k8s-conformance-test-suite.ps1 b/testsuite/k8s-conformance-test-suite.ps1 index 2219394..1148166 100644 --- a/testsuite/k8s-conformance-test-suite.ps1 +++ b/testsuite/k8s-conformance-test-suite.ps1 @@ -1,93 +1,3 @@ - -# Set the following environment variables to run the test suite - -# Common Variables -# Some of the variables need to be populated from the service principal and storage account details provided to you by Microsoft -$connectedClustedId=-join (((48..57)+(65..90)+(97..122)) * 80 |Get-Random -Count 7 |%{[char]$_}) -$AZ_TENANT_ID="" # tenant field of the service principal, please add it within the quotes -$AZ_SUBSCRIPTION_ID="" # subscription id of the azure subscription (will be provided), please add it within the quotes -$AZ_CLIENT_ID="" # appid field of the service principal, please add it within the quotes -$AZ_CLIENT_SECRET="" # password field of the service principal, please add it within the quotes -$AZ_STORAGE_ACCOUNT="" # name of your storage account, please add it within the quotes -$AZ_STORAGE_ACCOUNT_SAS="`"`"" # sas token for your storage account, please replace with the actual value -$RESOURCE_GROUP="" # resource group name; set this to the resource group provided to you; please add it within the quotes -$OFFERING_NAME="" # name of the partner offering; use this variable to distinguish between the results tar for different offerings -$CLUSTERNAME="arc-partner-test"+$connectedClustedId # name of the arc connected cluster -$LOCATION="eastus" # location of the arc connected cluster - -# Platform Cleanup Plugin -$CLEANUP_TIMEOUT=1500 # time in seconds after which the platform cleanup plugin times out - -# In case your cluster is behind an outbound proxy, please add the following environment variables in the below command -# --plugin-env azure-arc-platform.HTTPS_PROXY="http://:" -# --plugin-env azure-arc-platform.HTTP_PROXY="http://:" -# --plugin-env azure-arc-platform.NO_PROXY="kubernetes.default.svc," - -# In case your outbound proxy is setup with certificate authentication, follow the below steps: -# Create a Kubernetes generic secret with the name sonobuoy-proxy-cert with key proxycert in any namespace: -# kubectl create secret generic sonobuoy-proxy-cert --from-file=proxycert= -# By default we check for the secret in the default namespace. In case you have created the secret in some other namespace, please add the following variables in the sonobuoy run command: -# --plugin-env azure-arc-platform.PROXY_CERT_NAMESPACE="" -# --plugin-env azure-arc-agent-cleanup.PROXY_CERT_NAMESPACE="namespace of sonobuoy secret" - -az login --service-principal --username $AZ_CLIENT_ID --password $AZ_CLIENT_SECRET --tenant $AZ_TENANT_ID -az account set -s $AZ_SUBSCRIPTION_ID - - -$arc_platform_version = Get-Content -Path @("aak8sSupportPolicy.txt") - -foreach($version in $arc_platform_version) -{ - Write-Host "Running the test suite for Arc for Kubernetes version: ${version}" - - sonobuoy run --wait ` - --plugin arc-k8s-platform/platform.yaml ` - --plugin-env azure-arc-platform.TENANT_ID=$AZ_TENANT_ID ` - --plugin-env azure-arc-platform.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` - --plugin-env azure-arc-platform.RESOURCE_GROUP=$RESOURCE_GROUP ` - --plugin-env azure-arc-platform.CLUSTER_NAME=$CLUSTERNAME ` - --plugin-env azure-arc-platform.LOCATION=$LOCATION ` - --plugin-env azure-arc-platform.CLIENT_ID=$AZ_CLIENT_ID ` - --plugin-env azure-arc-platform.CLIENT_SECRET=$AZ_CLIENT_SECRET ` - --plugin arc-k8s-platform/cleanup.yaml ` - --plugin-env azure-arc-platform.HELMREGISTRY=mcr.microsoft.com/azurearck8s/batch1/stable/azure-arc-k8sagents:$version ` - --plugin-env azure-arc-agent-cleanup.TENANT_ID=$AZ_TENANT_ID ` - --plugin-env azure-arc-agent-cleanup.SUBSCRIPTION_ID=$AZ_SUBSCRIPTION_ID ` - --plugin-env azure-arc-agent-cleanup.RESOURCE_GROUP=$RESOURCE_GROUP ` - --plugin-env azure-arc-agent-cleanup.CLUSTER_NAME=$CLUSTERNAME ` - --plugin-env azure-arc-agent-cleanup.CLEANUP_TIMEOUT=$CLEANUP_TIMEOUT ` - --plugin-env azure-arc-agent-cleanup.CLIENT_ID=$AZ_CLIENT_ID ` - --plugin-env azure-arc-agent-cleanup.CLIENT_SECRET=$AZ_CLIENT_SECRET - - Write-Host "Test execution completed..Retrieving results" - - $sonobuoyResults=$(sonobuoy retrieve) - - sonobuoy results $sonobuoyResults - - New-Item -Path . -Name "results" -ItemType "directory" - Move-Item -Path $sonobuoyResults -Destination results\$sonobuoyResults - - Copy-Item .\partner-metadata.md -Destination results\partner-metadata.md - - tar -czvf conformance-results-$version.tar.gz results - - Remove-Item .\results -Recurse - - Write-Host "Publishing results.." - - $versionArry=$version.Split(".") - - $containerString="conformance-results-major-"+$versionArry[0]+"-minor-"+$versionArry[1]+"-patch-"+$versionArry[2] - - az storage container create -n $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS - az storage blob upload --file conformance-results-$version.tar.gz --name conformance-results-$OFFERING_NAME.tar.gz --container-name $containerString --account-name $AZ_STORAGE_ACCOUNT --sas-token $AZ_STORAGE_ACCOUNT_SAS - - Write-Host "Cleaning the cluster.." - sonobuoy delete --wait - -} - # Set the following environment variables to run the test suite # Common Variables @@ -178,4 +88,3 @@ foreach($version in $arc_platform_version) Write-Host "Buffer wait 5 minutes.." Start-Sleep -s 300 } -