Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DeviceId collision in LH and Stress tests #3028

Merged
Merged
3 changes: 3 additions & 0 deletions builds/e2e/longhaul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
$(images.artifact.name.linux)/IotEdgeQuickstart.linux-x64.tar.gz
$(images.artifact.name.linux)/e2e_deployment_files/long_haul_deployment.template.json
$(images.artifact.name.linux)/scripts/linux/runE2ETest.sh
$(images.artifact.name.linux)/scripts/testHelper.sh
$(images.artifact.name.linux)/artifactInfo.txt
# Deploy long haul
- template: templates/longhaul-deploy.yaml
Expand Down Expand Up @@ -167,6 +168,7 @@ jobs:
$(images.artifact.name.linux)/IotEdgeQuickstart.linux-arm.tar.gz
$(images.artifact.name.linux)/e2e_deployment_files/long_haul_deployment.template.json
$(images.artifact.name.linux)/scripts/linux/runE2ETest.sh
$(images.artifact.name.linux)/scripts/testHelper.sh
$(images.artifact.name.linux)/artifactInfo.txt
# Deploy long haul
- template: templates/longhaul-deploy.yaml
Expand Down Expand Up @@ -252,6 +254,7 @@ jobs:
$(images.artifact.name.linux)/IotEdgeQuickstart.linux-arm64.tar.gz
$(images.artifact.name.linux)/e2e_deployment_files/long_haul_deployment.template.json
$(images.artifact.name.linux)/scripts/linux/runE2ETest.sh
$(images.artifact.name.linux)/scripts/testHelper.sh
$(images.artifact.name.linux)/artifactInfo.txt
# Deploy long haul
- template: templates/longhaul-deploy.yaml
Expand Down
10 changes: 8 additions & 2 deletions scripts/linux/runE2ETest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,10 @@ function run_longhaul_test() {
print_highlighted_message "Run Long Haul test for $image_architecture_label"
test_setup

local device_id="$RELEASE_LABEL-Linux-$image_architecture_label-longhaul"
# Import test-related functions
. $(dirname "$0")/testHelper.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testHelper.sh is not in the same folder as runE2ETest.sh in the iotedge repo. It is in the same folder only in the artifact. To simplify, just clone that method and put a TODO to share.


local device_id="$RELEASE_LABEL-Linux-$image_architecture_label-longhaul-$(get_hash 8)"

test_start_time="$(date '+%Y-%m-%d %H:%M:%S')"
print_highlighted_message "Run Long Haul test with -d '$device_id' started at $test_start_time"
Expand Down Expand Up @@ -776,7 +779,10 @@ function run_stress_test() {
print_highlighted_message "Run Stress test for $image_architecture_label"
test_setup

local device_id="$RELEASE_LABEL-Linux-$image_architecture_label-stress"
# Import test-related functions
. $(dirname "$0")/testHelper.sh

local device_id="$RELEASE_LABEL-Linux-$image_architecture_label-stress-$(get_hash 8)"

test_start_time="$(date '+%Y-%m-%d %H:%M:%S')"
print_highlighted_message "Run Stress test with -d '$device_id' started at $test_start_time"
Expand Down
9 changes: 7 additions & 2 deletions scripts/windows/test/Run-E2ETest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ Function GetImageArchitectureLabel
Throw "Can't find image architecture label for $Architecture"
}

Function GetHash
{
return -join ((48..57) + (65..90) + (97..122) | Get-Random -Count $args[0] | % {[char]$_})
}

Function GetLongHaulDeploymentFilename
{
If (GetImageArchitectureLabel -eq "amd64")
Expand Down Expand Up @@ -1022,7 +1027,7 @@ Function RunLongHaulTest
TestSetup

$testStartAt = Get-Date
$deviceId = "${ReleaseLabel}-Windows-${Architecture}-longHaul"
$deviceId = "${ReleaseLabel}-Windows-${Architecture}-longHaul-$(GetHash 8)"
PrintHighlightedMessage "Run Long Haul test with -d ""$deviceId"" started at $testStartAt"

$testCommand = "&$IotEdgeQuickstartExeTestPath ``
Expand Down Expand Up @@ -1054,7 +1059,7 @@ Function RunStressTest
TestSetup

$testStartAt = Get-Date
$deviceId = "${ReleaseLabel}-Windows-${Architecture}-stress"
$deviceId = "${ReleaseLabel}-Windows-${Architecture}-stress-$(GetHash 8)"
PrintHighlightedMessage "Run Stress test with -d ""$deviceId"" started at $testStartAt"

$testCommand = "&$IotEdgeQuickstartExeTestPath ``
Expand Down