Skip to content

Commit

Permalink
Add Stress and Longhaul tests for Windows IoT Core x64 (Azure#1312)
Browse files Browse the repository at this point in the history
Add Stress and Longhaul tests for Windows IoT Core x64; and new Setup-Env.ps1 script to handle IoT Core scenario.
  • Loading branch information
SlavyMihov authored and philipktlin committed Jun 26, 2019
1 parent 5121d47 commit 35db2a4
Show file tree
Hide file tree
Showing 7 changed files with 333 additions and 21 deletions.
69 changes: 68 additions & 1 deletion builds/e2e/longhaul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ jobs:
$(images.artifact.name.windows)/e2e_deployment_files/long_haul_deployment.template.windows.json
$(images.artifact.name.windows)/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
$(images.artifact.name.windows)/scripts/windows/test/Run-E2ETest.ps1
$(images.artifact.name.windows)/scripts/windows/test/Setup-Env.ps1
$(images.artifact.name.windows)/artifactInfo.txt
# Deploy long haul
- template: templates/longhaul-deploy-windows.yaml
Expand Down Expand Up @@ -329,6 +330,7 @@ jobs:
$(images.artifact.name.windows)/e2e_deployment_files/long_haul_deployment.template.windows.json
$(images.artifact.name.windows)/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
$(images.artifact.name.windows)/scripts/windows/test/Run-E2ETest.ps1
$(images.artifact.name.windows)/scripts/windows/test/Setup-Env.ps1
$(images.artifact.name.windows)/artifactInfo.txt
# Deploy long haul
- template: templates/longhaul-deploy-windows.yaml
Expand All @@ -346,4 +348,69 @@ jobs:
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'


################################################################################
- job: iotuap_amd64_moby
################################################################################
displayName: Windows IoT Core AMD64 Moby
condition: eq(variables['run.iotuap.amd64.moby'], 'true')
pool:
name: $(pool.name)
demands:
#- longhaul_iotuap_x64 -equals true
- run-long-haul -equals true
- runner-os-name -equals WinIoTCore_x64
variables:
edgelet.artifact.name: 'iotedged-windows'
steps:
- checkout: none
- task: AzureKeyVault@1
displayName: 'Access Key Vault Secrets'
inputs:
azureSubscription: $(azure.subscription)
KeyVaultName: $(azure.keyVault)
SecretsFilter: 'edgebuilds-azurecr-io-username,edgebuilds-azurecr-io-pwd,IotHubStressConnString,EventHubStressConnStr,StorageAccountMasterKeyStress,SnitchLongHaulAlertUrl'
- task: DownloadBuildArtifacts@0
displayName: 'Download Edgelet Artifacts'
inputs:
buildType: specific
project: $(vsts.project)
pipeline: $(edgelet.package.build)
branchName: $(edgelet.package.branchName)
buildVersionToDownload: latestFromBranch
downloadPath: '$(Build.StagingDirectory)'
artifactName: $(edgelet.artifact.name)
- task: DownloadBuildArtifacts@0
displayName: 'Download Images Artifacts'
inputs:
buildType: specific
project: $(vsts.project)
pipeline: $(images.build)
branchName: $(images.branchName)
buildVersionToDownload: latestFromBranch
downloadPath: '$(Build.StagingDirectory)'
artifactName: $(images.artifact.name.windows)
itemPattern: |
$(images.artifact.name.windows)/IotEdgeQuickstart/x64/*
$(images.artifact.name.windows)/e2e_deployment_files/long_haul_deployment.template.windows.json
$(images.artifact.name.windows)/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
$(images.artifact.name.windows)/scripts/windows/test/Run-E2ETest.ps1
$(images.artifact.name.windows)/scripts/windows/test/Setup-Env.ps1
$(images.artifact.name.windows)/artifactInfo.txt
# Deploy LongHaul test
- template: templates/deploy-iotuap.yaml
parameters:
testName: 'LongHaul'
release.label: 'iotuap-lh'
edgelet.artifact.name: '$(edgelet.artifact.name)'
images.artifact.name: '$(images.artifact.name.windows)'
container.registry: '$(container.registry)'
container.registry.username: '$(edgebuilds-azurecr-io-username)'
container.registry.password: '$(edgebuilds-azurecr-io-pwd)'
iotHub.connectionString: '$(IotHubStressConnString)'
eventHub.connectionString: '$(EventHubStressConnStr)'
snitch.build.number: '$(snitch.build.number)'
snitch.alert.url: '$(SnitchLongHaulAlertUrl)'
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
68 changes: 68 additions & 0 deletions builds/e2e/stresstest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ jobs:
$(images.artifact.name.windows)/e2e_deployment_files/stress_deployment.template.windows.json
$(images.artifact.name.windows)/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
$(images.artifact.name.windows)/scripts/windows/test/Run-E2ETest.ps1
$(images.artifact.name.windows)/scripts/windows/test/Setup-Env.ps1
$(images.artifact.name.windows)/artifactInfo.txt
# Deploy stress test
- template: templates/stresstest-deploy-windows.yaml
Expand Down Expand Up @@ -329,6 +330,7 @@ jobs:
$(images.artifact.name.windows)/e2e_deployment_files/stress_deployment.template.windows.json
$(images.artifact.name.windows)/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
$(images.artifact.name.windows)/scripts/windows/test/Run-E2ETest.ps1
$(images.artifact.name.windows)/scripts/windows/test/Setup-Env.ps1
$(images.artifact.name.windows)/artifactInfo.txt
# Deploy stress test
- template: templates/stresstest-deploy-windows.yaml
Expand All @@ -345,4 +347,70 @@ jobs:
snitch.alert.url: '$(SnitchStressAlertUrl)'
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'

################################################################################
- job: iotuap_amd64_moby
################################################################################
displayName: Windows IoT Core AMD64 Moby
condition: eq(variables['run.iotuap.amd64.moby'], 'true')
pool:
name: $(pool.name)
demands:
#- stress_iotuap_x64 -equals true
- run-stress -equals true
- runner-os-name -equals WinIoTCore_x64
variables:
edgelet.artifact.name: 'iotedged-windows'
steps:
- checkout: none
- task: AzureKeyVault@1
displayName: 'Access Key Vault SEcrets'
inputs:
azureSubscription: $(azure.subscription)
KeyVaultName: $(azure.keyVault)
SecretsFilter: 'edgebuilds-azurecr-io-username,edgebuilds-azurecr-io-pwd,IotHubStressConnString,EventHubStressConnStr,StorageAccountMasterKeyStress,SnitchStressAlertUrl'
- task: DownloadBuildArtifacts@0
displayName: 'Download Edgelet Artifacts'
inputs:
buildType: specific
project: $(vsts.project)
pipeline: $(edgelet.package.build)
branchName: $(edgelet.package.branchName)
buildVersionToDownload: latestFromBranch
downloadPath: '$(Build.StagingDirectory)'
artifactName: $(edgelet.artifact.name)
- task: DownloadBuildArtifacts@0
displayName: 'Download Images Artifacts'
inputs:
buildType: specific
project: $(vsts.project)
pipeline: $(images.build)
branchName: $(images.branchName)
buildVersionToDownload: latestFromBranch
downloadPath: '$(Build.StagingDirectory)'
artifactName: $(images.artifact.name.windows)
itemPattern: |
$(images.artifact.name.windows)/IotEdgeQuickstart/x64/*
$(images.artifact.name.windows)/e2e_deployment_files/stress_deployment.template.windows.json
$(images.artifact.name.windows)/scripts/windows/setup/IotEdgeSecurityDaemon.ps1
$(images.artifact.name.windows)/scripts/windows/test/Run-E2ETest.ps1
$(images.artifact.name.windows)/scripts/windows/test/Setup-Env.ps1
$(images.artifact.name.windows)/artifactInfo.txt
# Deploy Stress test
- template: templates/deploy-iotuap.yaml
parameters:
testName: 'Stress'
release.label: 'iotuap-st'
edgelet.artifact.name: '$(edgelet.artifact.name)'
images.artifact.name: '$(images.artifact.name.windows)'
container.registry: '$(container.registry)'
container.registry.username: '$(edgebuilds-azurecr-io-username)'
container.registry.password: '$(edgebuilds-azurecr-io-pwd)'
iotHub.connectionString: '$(IotHubStressConnString)'
eventHub.connectionString: '$(EventHubStressConnStr)'
snitch.build.number: '$(snitch.build.number)'
snitch.alert.url: '$(SnitchStressAlertUrl)'
snitch.storage.account: '$(snitch.storage.account)'
snitch.storage.masterKey: '$(StorageAccountMasterKeyStress)'
loadGen.message.frequency: '$(loadGen.message.frequency.amd64)'
72 changes: 72 additions & 0 deletions builds/e2e/templates/deploy-iotuap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
parameters:
testName: ''
release.label: ''
edgelet.artifact.name: ''
images.artifact.name: ''
container.registry: ''
container.registry.username: ''
container.registry.password: ''
iotHub.connectionString: ''
eventHub.connectionString: ''
snitch.build.number: ''
snitch.alert.url: ''
snitch.storage.account: ''
snitch.storage.masterKey: ''
amqp.settings.enabled: 'true'
mqtt.settings.enabled: 'true'
loadGen.message.frequency: ''
loadGen1.transportType: 'Amqp_Tcp_Only'
loadGen2.transportType: 'Amqp_WebSocket_Only'
loadGen3.transportType: 'Mqtt_Tcp_Only'
loadGen4.transportType: 'Mqtt_WebSocket_Only'

steps:
- task: CopyFiles@2
displayName: 'Copy Edgelet Artifact to $(iotuap-x64-machine)'
inputs:
SourceFolder: "$(Build.StagingDirectory)/${{ parameters['edgelet.artifact.name'] }}"
TargetFolder: "\\\\$(iotuap-x64-machine)\\c$\\Data\\e2etests\\artifacts\\${{ parameters['edgelet.artifact.name'] }}"
#CleanTargetFolder: true
- task: CopyFiles@2
displayName: 'Copy Images Artifact to $(iotuap-x64-machine)'
inputs:
SourceFolder: "$(Build.StagingDirectory)/${{ parameters['images.artifact.name'] }}"
TargetFolder: "\\\\$(iotuap-x64-machine)\\c$\\Data\\e2etests\\artifacts\\${{ parameters['images.artifact.name'] }}"
#CleanTargetFolder: true
- task: PowerShellOnTargetMachines@3
displayName: 'Environment Setup/Cleanup ($(iotuap-x64-machine))'
inputs:
Machines: '$(iotuap-x64-machine)'
UserName: '$(iotuap-x64-login)'
UserPassword: '$(iotuap-x64-password)'
InlineScript: |
#Requires -RunAsAdministrator
$ArtifactInfo=convertfrom-stringdata (get-content C:\Data\e2etests\artifacts\${{ parameters['images.artifact.name'] }}\artifactInfo.txt -raw)
C:\Data\e2etests\artifacts\${{ parameters['images.artifact.name'] }}\scripts\windows\test\Setup-Env.ps1 -E2ETestFolder "C:\Data\e2etests" -ArtifactImageBuildNumber "$($ArtifactInfo.BuildNumber)"
CommunicationProtocol: Http
- powershell: |
$startDateTime = Get-Date
$timeoutMinutes = 5
Write-Host "Waiting device $(iotuap-x64-machine) to become online (for up to $timeoutMinutes minutes)..."
Do { $Ping = Test-Connection $(iotuap-x64-machine) -quiet }
Until ($Ping -eq "True" -or (Get-Date) -gt $startDateTime.AddMinutes($timeoutMinutes))
If ($Ping -eq "True") { Write-Host "Device $(iotuap-x64-machine) is online." }
Else { Write-Host "Time out, device $(iotuap-x64-machine) is offline." }
Exit $Ping -ne "True"
displayName: 'Wait for $(iotuap-x64-machine) to boot up'
- task: PowerShellOnTargetMachines@3
displayName: "Run ${{ parameters['testName'] }} Test on $(iotuap-x64-machine)"
inputs:
Machines: '$(iotuap-x64-machine)'
UserName: '$(iotuap-x64-login)'
UserPassword: '$(iotuap-x64-password)'
InlineScript: |
#Requires -RunAsAdministrator
$ArtifactInfo=convertfrom-stringdata (get-content C:\Data\e2etests\artifacts\${{ parameters['images.artifact.name'] }}\artifactInfo.txt -raw)
C:\Data\e2etests\artifacts\${{ parameters['images.artifact.name'] }}\scripts\windows\test\Run-E2ETest.ps1 -E2ETestFolder "C:\Data\e2etests" -ReleaseLabel "${{ parameters['release.label'] }}" -ArtifactImageBuildNumber "$($ArtifactInfo.BuildNumber)" -TestName "${{ parameters['testName'] }}" -ContainerRegistry "${{ parameters['container.registry'] }}" -ContainerRegistryUsername "${{ parameters['container.registry.username'] }}" -ContainerRegistryPassword "${{ parameters['container.registry.password'] }}" -IoTHubConnectionString "${{ parameters['iotHub.connectionString'] }}" -EventHubConnectionString "${{ parameters['eventHub.connectionString'] }}" -SnitchBuildNumber "${{ parameters['snitch.build.number'] }}" -SnitchStorageAccount "${{ parameters['snitch.storage.account'] }}" -SnitchStorageMasterKey "${{ parameters['snitch.storage.masterKey'] }}" -SnitchAlertUrl "${{ parameters['snitch.alert.url'] }}" -LoadGen1TransportType "${{ parameters['loadGen1.transportType'] }}" -LoadGen2TransportType "${{ parameters['loadGen2.transportType'] }}" -LoadGen3TransportType "${{ parameters['loadGen3.transportType'] }}" -LoadGen4TransportType "${{ parameters['loadGen4.transportType'] }}" -AmqpSettingsEnabled "${{ parameters['amqp.settings.enabled'] }}" -MqttSettingsEnabled "${{ parameters['mqtt.settings.enabled'] }}" -LoadGenMessageFrequency "${{ parameters['loadGen.message.frequency'] }}" -BypassEdgeInstallation
CommunicationProtocol: Http
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"createOptions": ""
}
},
// Work needed to enable snitcher for Windows
// Work needed to enable snitcher for Windows Enterprise/Server x64, Windows IoT Core x64 and Windows IoT Core arm32
// "snitcher": {
// "version": "2.0",
// "type": "docker",
Expand Down Expand Up @@ -218,7 +218,7 @@
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"15000/tcp\":[{\"HostPort\":\"15000\"}]}}}"
}
},
// No windows version of influxdb
// No windows version of influxdb (Windows Enterprise/Server x64, Windows IoT Core x64 and Windows IoT Core arm32)
// "influxdb": {
// "version": "1.0",
// "type": "docker",
Expand Down
4 changes: 2 additions & 2 deletions e2e_deployment_files/stress_deployment.template.windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"createOptions": ""
}
},
// Work needed to enable snitcher for Windows
// Work needed to enable snitcher for Windows Enterprise/Server x64, Windows IoT Core x64 and Windows IoT Core arm32
// "snitcher": {
// "version": "2.0",
// "type": "docker",
Expand Down Expand Up @@ -188,7 +188,7 @@
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"15000/tcp\":[{\"HostPort\":\"15000\"}]}}}"
}
}
// No windows version of influxdb
// No windows version of influxdb (Windows Enterprise/Server x64, Windows IoT Core x64 and Windows IoT Core arm32)
// "influxdb": {
// "version": "1.0",
// "type": "docker",
Expand Down
25 changes: 9 additions & 16 deletions scripts/windows/test/Run-E2ETest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,6 @@ Function AppendInstallationOption([string] $testCommand)
Return $testCommand += " -a `"$IoTEdgedWorkingFolder`""
}

Function CleanUp
{
PrintHighlightedMessage "Test Clean Up"

Write-Host "Uninstall iotedged"
Invoke-Expression $InstallationScriptPath
Uninstall-IoTEdge -Force

# This may require once IoT Edge created its only bridge network
#Write-Host "Remove nat VM switch"
#Remove-VMSwitch -Force 'nat' -ErrorAction SilentlyContinue
#Write-Host "Restart Host Network Service"
#Restart-Service -name hns
}

Function GetArchitecture
{
$processorArchitecture = $ENV:PROCESSOR_ARCHITECTURE
Expand Down Expand Up @@ -1153,10 +1138,16 @@ Function SetEnvironmentVariable

Function TestSetup
{
Write-Host "Environment setup..."
ValidateTestParameters
If (!$BypassEdgeInstallation)
{
CleanUp | Out-Host
# Cleanup/Setup
$testCommand = "&$EnvSetupScriptPath ``
-ArtifactImageBuildNumber `"$ArtifactImageBuildNumber`" ``
-E2ETestFolder `"$E2ETestFolder`""

Invoke-Expression $testCommand | Out-Host
}
InitializeWorkingFolder
PrepareTestFromArtifacts
Expand Down Expand Up @@ -1257,6 +1248,7 @@ If ($Architecture -eq "arm32v7")
}
$E2ETestFolder = (Resolve-Path $E2ETestFolder).Path
$DefaultOpensslInstallPath = "C:\vcpkg\installed\x64-windows\tools\openssl"
$EnvSetupScriptPath = Join-Path $E2ETestFolder "artifacts\core-windows\scripts\windows\test\Setup-Env.ps1"
$InstallationScriptPath = Join-Path $E2ETestFolder "artifacts\core-windows\scripts\windows\setup\IotEdgeSecurityDaemon.ps1"
$EdgeCertGenScriptDir = Join-Path $E2ETestFolder "artifacts\core-windows\CACertificates"
$EdgeCertGenScript = Join-Path $EdgeCertGenScriptDir "ca-certs.ps1"
Expand Down Expand Up @@ -1321,4 +1313,5 @@ Else

$retCode = RunTest
Write-Host "Exit test with code $retCode"

Exit $retCode -gt 0
Loading

0 comments on commit 35db2a4

Please sign in to comment.