diff --git a/scripts/linux/runE2ETest.sh b/scripts/linux/runE2ETest.sh index 4ad66340e6c..2ca74075b65 100755 --- a/scripts/linux/runE2ETest.sh +++ b/scripts/linux/runE2ETest.sh @@ -479,6 +479,14 @@ function process_args() { echo 'Required parameters are provided' } +function get_hash() { + # TODO: testHelper.sh needs to be shared across build pipelines + local length=$1 + local hash=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c $length) + + echo "$hash" +} + function run_all_tests() { local funcRet=0 @@ -698,7 +706,7 @@ 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" + 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" @@ -776,7 +784,7 @@ 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" + 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" diff --git a/scripts/windows/test/Run-E2ETest.ps1 b/scripts/windows/test/Run-E2ETest.ps1 index c6b26090f29..0e507eb0212 100644 --- a/scripts/windows/test/Run-E2ETest.ps1 +++ b/scripts/windows/test/Run-E2ETest.ps1 @@ -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") @@ -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 `` @@ -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 ``