Skip to content

Commit

Permalink
Seanmcd/e2e devicename2 (#1698) (#2280)
Browse files Browse the repository at this point in the history
fix devicename length issue

Co-authored-by: Sean McDowell <seanmcd@microsoft.com>
  • Loading branch information
philipktlin and seanmcd-msft authored Jan 9, 2020
1 parent bfc87a8 commit 1923155
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions scripts/windows/test/Run-E2ETest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,11 @@ Function RunLeafDeviceTest
[bool]$useSecondaryCredential = $False
)
{

if ($leafDeviceId.Length -gt 64) {
throw "can't generate cert. asn1 device name length of 64 exceeded. $leafDeviceId"
}

$testCommand = $null
switch ($authType) {
"sas"
Expand Down Expand Up @@ -1304,23 +1309,25 @@ Function RunTransparentGatewayTest
# run the various leaf device tests
$deviceId = "e2e-${ReleaseLabel}-Win-${Architecture}"

RunLeafDeviceTest "sas" "Mqtt" "$deviceId-mqtt-sas-noscope-leaf" $null
RunLeafDeviceTest "sas" "Amqp" "$deviceId-amqp-sas-noscope-leaf" $null
# NOTE: device name cannot be > 64 chars because of asn1 limits for certs
# thus we're abbreviating noscope/inscope as no/in and leaf as lf, x509ca as x5c, x509th as x5t, pri as p, sec as s.
RunLeafDeviceTest "sas" "Mqtt" "$deviceId-mqtt-sas-no-lf" $null
RunLeafDeviceTest "sas" "Amqp" "$deviceId-amqp-sas-no-lf" $null

RunLeafDeviceTest "sas" "Mqtt" "$deviceId-mqtt-sas-inscope-leaf" $edgeDeviceId
RunLeafDeviceTest "sas" "Amqp" "$deviceId-amqp-sas-inscope-leaf" $edgeDeviceId
RunLeafDeviceTest "sas" "Mqtt" "$deviceId-mqtt-sas-in-lf" $edgeDeviceId
RunLeafDeviceTest "sas" "Amqp" "$deviceId-amqp-sas-in-lf" $edgeDeviceId

RunLeafDeviceTest "x509CA" "Mqtt" "$deviceId-mqtt-x509ca-inscope-leaf" $edgeDeviceId
RunLeafDeviceTest "x509CA" "Amqp" "$deviceId-amqp-x509ca-inscope-leaf" $edgeDeviceId
RunLeafDeviceTest "x509CA" "Mqtt" "$deviceId-mqtt-x5c-in-lf" $edgeDeviceId
RunLeafDeviceTest "x509CA" "Amqp" "$deviceId-amqp-x5c-in-lf" $edgeDeviceId

# run thumbprint test using primary cert with MQTT
RunLeafDeviceTest "x509Thumprint" "Mqtt" "$deviceId-mqtt-pri-x509th-inscope-leaf" $edgeDeviceId
RunLeafDeviceTest "x509Thumprint" "Mqtt" "$deviceId-mqtt-p-x5t-in-lf" $edgeDeviceId
# run thumbprint test using secondary cert with MQTT
RunLeafDeviceTest "x509Thumprint" "Mqtt" "$deviceId-mqtt-sec-x509th-inscope-leaf" $edgeDeviceId $True
RunLeafDeviceTest "x509Thumprint" "Mqtt" "$deviceId-mqtt-s-x5t-in-lf" $edgeDeviceId $True
# run thumbprint test using primary cert with AMQP
RunLeafDeviceTest "x509Thumprint" "Amqp" "$deviceId-amqp-pri-x509th-inscope-leaf" $edgeDeviceId
RunLeafDeviceTest "x509Thumprint" "Amqp" "$deviceId-amqp-p-x5t-in-lf" $edgeDeviceId
# run thumbprint test using secondary cert with AMQP
RunLeafDeviceTest "x509Thumprint" "Amqp" "$deviceId-amqp-sec-x509th-inscope-leaf" $edgeDeviceId $True
RunLeafDeviceTest "x509Thumprint" "Amqp" "$deviceId-amqp-s-x5t-in-lf" $edgeDeviceId $True

Return $testExitCode
}
Expand Down

0 comments on commit 1923155

Please sign in to comment.