Skip to content

Bug fix in New direct peering connection #10010

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

Merged
merged 4 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,15 @@ public void TestNewDirectConnectionWrongV6()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWrongV6");
}

/// <summary>
/// The test new direct connection with microsoft ip address
/// </summary>
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewDirectConnectionWithMicrosoftIpProvidedAddress()
{
TestController.NewInstance.RunPowerShellTest(this.logger, "Test-NewDirectConnectionWithMicrosoftIpProvidedAddress");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ function Test-NewDirectConnectionWithV4V6
Assert-AreEqual $facilityId $createdConnection.PeeringDBFacilityId
Assert-AreEqual $sessionv4 $createdConnection.BgpSession.SessionPrefixV4
Assert-AreEqual $sessionv6 $createdConnection.BgpSession.SessionPrefixV6
Assert-AreEqual $false $createdConnection.UseForPeeringService
Assert-AreEqual "Peer" $createdConnection.SessionAddressProvider
}
<#
.SYNOPSIS
Expand Down Expand Up @@ -71,6 +73,8 @@ function Test-NewDirectConnectionWithV4
Assert-AreEqual $facilityId $createdConnection.PeeringDBFacilityId
Assert-AreEqual $sessionv4 $createdConnection.BgpSession.SessionPrefixV4
Assert-Null $createdConnection.BgpSession.SessionPrefixV6
Assert-AreEqual $false $createdConnection.UseForPeeringService
Assert-AreEqual "Peer" $createdConnection.SessionAddressProvider
}
<#
.SYNOPSIS
Expand Down Expand Up @@ -100,10 +104,12 @@ function Test-NewDirectConnectionWithV6
Assert-AreEqual $facilityId $createdConnection.PeeringDBFacilityId
Assert-Null $createdConnection.BgpSession.SessionPrefixV4
Assert-AreEqual $sessionv6 $createdConnection.BgpSession.SessionPrefixV6
Assert-AreEqual $false $createdConnection.UseForPeeringService
Assert-AreEqual "Peer" $createdConnection.SessionAddressProvider
}
<#
.SYNOPSIS
NewDirectConnectionNoSession should fail with null value
NewDirectConnectionNoSession should pass with null value
#>
function Test-NewDirectConnectionNoSession
{
Expand All @@ -125,8 +131,12 @@ function Test-NewDirectConnectionNoSession
$maxv6 = maxAdvertisedIpv6
Write-Debug "Created maxAdvertised $maxv4 $maxv6"
#create Connection
Assert-ThrowsContains { New-AzPeeringDirectConnectionObject -PeeringDbFacilityId $facilityId -MaxPrefixesAdvertisedIPv4 $maxv4 -BandwidthInMbps $bandwidth -MD5AuthenticationKey $md5 } "Cannot process command because of one or more missing mandatory parameters: SessionPrefixV4."
}
$createdConnection = New-AzPeeringDirectConnectionObject -PeeringDbFacilityId $facilityId -BandwidthInMbps $bandwidth -UseForPeeringService
Assert-AreEqual $bandwidth $createdConnection.BandwidthInMbps
Assert-AreEqual $facilityId $createdConnection.PeeringDBFacilityId
Assert-Null $createdConnection.BgpSession
Assert-AreEqual $true $createdConnection.UseForPeeringService
Assert-AreEqual "Peer" $createdConnection.SessionAddressProvider}
<#
.SYNOPSIS
NewDirectConnectionWithV6 should fail with high BandwidthInMbps message
Expand Down Expand Up @@ -237,4 +247,27 @@ function Test-NewDirectConnectionWrongV4
Write-Debug "Created maxAdvertised $maxv4 $maxv6"
#create Connection
Assert-ThrowsContains {New-AzPeeringDirectConnectionObject -PeeringDbFacilityId $facilityId -SessionPrefixV4 $wrongv4 -MaxPrefixesAdvertisedIPv4 $maxv4 -BandwidthInMbps $bandwidth -MD5AuthenticationKey $md5.ToString} "Invalid Prefix: $wrongv4, must be "
}

<#
.SYNOPSIS
Microsoft Provided IP address
#>
function Test-NewDirectConnectionWithMicrosoftIpProvidedAddress
{
#Hard Coded locations becuase of limitations in locations
$kind = isDirect $true;
$loc = "Los Angeles"
$peeringLocation = getPeeringLocation $kind $loc;
$facilityId = $peeringLocation[0].PeeringDBFacilityId
#Create some data for the object
$bandwidth = getBandwidth
Write-Debug "Creating Connection at $facilityId"
#create Connection
$createdConnection = New-AzPeeringDirectConnectionObject -PeeringDbFacilityId $facilityId -MicrosoftProvidedIPAddress -BandwidthInMbps $bandwidth -UseForPeeringService
Assert-AreEqual $bandwidth $createdConnection.BandwidthInMbps
Assert-AreEqual $facilityId $createdConnection.PeeringDBFacilityId
Assert-AreEqual $null $createdConnection.BgpSession
Assert-AreEqual $true $createdConnection.UseForPeeringService
Assert-AreEqual "Microsoft" $createdConnection.SessionAddressProvider
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"4f5b5221-06fc-4ca0-8919-c30189a12565"
"ae250049-8277-4745-a1a3-eff028c25600"
],
"Accept-Language": [
"en-US"
Expand All @@ -27,16 +27,16 @@
"no-cache"
],
"x-ms-request-id": [
"dc5c0213-7b23-4f04-8276-33d474b6e32d"
"db61bbf3-6788-4e84-b7b7-646434dac1bb"
],
"x-ms-ratelimit-remaining-subscription-resource-requests": [
"598"
"596"
],
"x-ms-correlation-request-id": [
"491b787f-6cbd-4756-81f5-4d035d834882"
"98c4da14-aa25-42d7-b2c1-9d904988ad5a"
],
"x-ms-routing-request-id": [
"NORTHEUROPE:20190829T183238Z:491b787f-6cbd-4756-81f5-4d035d834882"
"NORTHEUROPE:20190911T170957Z:98c4da14-aa25-42d7-b2c1-9d904988ad5a"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -45,7 +45,7 @@
"nosniff"
],
"Date": [
"Thu, 29 Aug 2019 18:32:38 GMT"
"Wed, 11 Sep 2019 17:09:56 GMT"
],
"Content-Length": [
"68896"
Expand All @@ -64,9 +64,9 @@
"Names": {},
"Variables": {
"SubscriptionId": "3e919f9a-4e26-4736-aa8d-d596d9a49239",
"bandwidth": "40000",
"Hash": "e1335d26ccc4ac2872d3deb12158460d",
"MaxPrefixV4": "5904",
"MaxPrefixV6": "1342"
"bandwidth": "70000",
"Hash": "199af1237016b0b65e69bb1f915e7009",
"MaxPrefixV4": "18612",
"MaxPrefixV6": "52"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"04294a29-7b86-4bb8-bb2b-642a4848f494"
"c309e564-d633-4387-8f5b-9c1be1b8db24"
],
"Accept-Language": [
"en-US"
Expand All @@ -27,16 +27,16 @@
"no-cache"
],
"x-ms-request-id": [
"2c16ddfc-b787-492f-9ef4-65dabecad849"
"620b8309-c83d-4f60-87d6-c51853977a40"
],
"x-ms-ratelimit-remaining-subscription-resource-requests": [
"598"
"593"
],
"x-ms-correlation-request-id": [
"a68feae6-a795-489a-8a37-236fe50615f3"
"92faa76e-46ba-4a3f-9782-f3a2846776d3"
],
"x-ms-routing-request-id": [
"NORTHEUROPE:20190829T183232Z:a68feae6-a795-489a-8a37-236fe50615f3"
"NORTHEUROPE:20190911T170951Z:92faa76e-46ba-4a3f-9782-f3a2846776d3"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -45,7 +45,7 @@
"nosniff"
],
"Date": [
"Thu, 29 Aug 2019 18:32:32 GMT"
"Wed, 11 Sep 2019 17:09:50 GMT"
],
"Content-Length": [
"68896"
Expand All @@ -64,8 +64,8 @@
"Names": {},
"Variables": {
"SubscriptionId": "3e919f9a-4e26-4736-aa8d-d596d9a49239",
"Hash": "189321a39bac466b9de9ad74df8879da",
"MaxPrefixV4": "11013",
"MaxPrefixV6": "1528"
"Hash": "7799df9754393ba18ad855bd1bdcde76",
"MaxPrefixV4": "10008",
"MaxPrefixV6": "1857"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"5c6d6845-e8df-4fe3-84c5-593431341b55"
"005189d9-e096-4181-9668-dc7abe52f3c8"
],
"Accept-Language": [
"en-US"
Expand All @@ -27,16 +27,16 @@
"no-cache"
],
"x-ms-request-id": [
"21073f80-380c-4de5-9c50-f77420e82ef2"
"7214cb96-aba3-43f3-befe-720accc7510b"
],
"x-ms-ratelimit-remaining-subscription-resource-requests": [
"597"
"589"
],
"x-ms-correlation-request-id": [
"af5ec4b7-14a0-402a-8886-4f16812fa85d"
"29543863-13f8-4772-a88d-977672048c0e"
],
"x-ms-routing-request-id": [
"NORTHEUROPE:20190829T183244Z:af5ec4b7-14a0-402a-8886-4f16812fa85d"
"NORTHEUROPE:20190911T171001Z:29543863-13f8-4772-a88d-977672048c0e"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -45,7 +45,7 @@
"nosniff"
],
"Date": [
"Thu, 29 Aug 2019 18:32:43 GMT"
"Wed, 11 Sep 2019 17:10:01 GMT"
],
"Content-Length": [
"68896"
Expand All @@ -64,9 +64,9 @@
"Names": {},
"Variables": {
"SubscriptionId": "3e919f9a-4e26-4736-aa8d-d596d9a49239",
"bandwidth": "30000",
"Hash": "47ee06a21f5d4ab950a330cd2099684b",
"MaxPrefixV4": "1105",
"MaxPrefixV6": "435"
"bandwidth": "60000",
"Hash": "9c6b6006fabb6b796e5551382cf47ea2",
"MaxPrefixV4": "12983",
"MaxPrefixV6": "1279"
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"6a732cdf-9b14-442d-9df3-eb1f3e2a2350"
"67b477c8-ee3e-4e9b-b009-3929e42aee5f"
],
"Accept-Language": [
"en-US"
Expand All @@ -27,16 +27,16 @@
"no-cache"
],
"x-ms-request-id": [
"027ccbcb-412e-4299-86d2-8e2b5fe11307"
"fe50951a-81dc-46b0-bda7-62e4da45a3bf"
],
"x-ms-ratelimit-remaining-subscription-resource-requests": [
"597"
"595"
],
"x-ms-correlation-request-id": [
"2fd23693-cb6f-4d40-a551-698d07ce2177"
"2e9dedbe-ed6d-42b2-b316-c16583337ec5"
],
"x-ms-routing-request-id": [
"NORTHEUROPE:20190829T183250Z:2fd23693-cb6f-4d40-a551-698d07ce2177"
"NORTHEUROPE:20190911T171006Z:2e9dedbe-ed6d-42b2-b316-c16583337ec5"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -45,7 +45,7 @@
"nosniff"
],
"Date": [
"Thu, 29 Aug 2019 18:32:50 GMT"
"Wed, 11 Sep 2019 17:10:05 GMT"
],
"Content-Length": [
"68896"
Expand All @@ -67,7 +67,7 @@
"RequestBody": "",
"RequestHeaders": {
"x-ms-client-request-id": [
"19ed3fba-93eb-42aa-bf0e-3da048e60249"
"7f4b8760-6d5a-4cb4-8d5c-71e730bae6ad"
],
"Accept-Language": [
"en-US"
Expand All @@ -87,16 +87,16 @@
"no-cache"
],
"x-ms-request-id": [
"49421e56-92c3-4876-8f60-af35ab8eaeda"
"1953632b-b9de-48bb-800a-5bfcdfa9f228"
],
"x-ms-ratelimit-remaining-subscription-resource-requests": [
"598"
"599"
],
"x-ms-correlation-request-id": [
"f5e976f3-444b-4b8d-97df-f057cafba99e"
"04d7ce43-9f0f-4edd-ad62-3b3753c14348"
],
"x-ms-routing-request-id": [
"NORTHEUROPE:20190829T183251Z:f5e976f3-444b-4b8d-97df-f057cafba99e"
"NORTHEUROPE:20190911T171006Z:04d7ce43-9f0f-4edd-ad62-3b3753c14348"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
Expand All @@ -105,10 +105,10 @@
"nosniff"
],
"Date": [
"Thu, 29 Aug 2019 18:32:51 GMT"
"Wed, 11 Sep 2019 17:10:06 GMT"
],
"Content-Length": [
"2944"
"1621"
],
"Content-Type": [
"application/json; charset=utf-8"
Expand All @@ -117,15 +117,15 @@
"-1"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 65000,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\",\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"2342432433295\"\r\n ]\r\n },\r\n \"peerName\": \"AS65000-Global9263\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"65000-Global9908\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/65000-Global9908\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n },\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 65000,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\",\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"23424324333927\"\r\n ]\r\n },\r\n \"peerName\": \"AS65000-Global9354\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"65000-Global8757\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/65000-Global8757\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n },\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 11164,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\",\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"23424324333010\"\r\n ]\r\n },\r\n \"peerName\": \"AS11164-Global1279\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"11164-Global9635\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/11164-Global9635\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n },\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 65000,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\",\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"23424324333206\"\r\n ]\r\n },\r\n \"peerName\": \"AS65000-Global3318\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"65000-Global7990\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/65000-Global7990\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n },\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 65000,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\",\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"23424324339258\"\r\n ]\r\n },\r\n \"peerName\": \"AS65000-Global276\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"65000-Global3928\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/65000-Global3928\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n }\r\n ]\r\n}",
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 11164,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"323223\"\r\n ]\r\n },\r\n \"peerName\": \"Global9635\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"11164-Global9635\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/11164-Global9635\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n },\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 8088,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\",\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"23424324337527\"\r\n ]\r\n },\r\n \"peerName\": \"AS8088-Global8787\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"8088-Global9053\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/8088-Global9053\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n },\r\n {\r\n \"properties\": {\r\n \"peerAsn\": 8088,\r\n \"peerContactInfo\": {\r\n \"emails\": [\r\n \"[email protected]\"\r\n ],\r\n \"phone\": [\r\n \"9090909909\"\r\n ]\r\n },\r\n \"peerName\": \"8088-Global3917\",\r\n \"validationState\": \"Approved\"\r\n },\r\n \"name\": \"8088-Global3917\",\r\n \"id\": \"/subscriptions/3e919f9a-4e26-4736-aa8d-d596d9a49239/providers/Microsoft.Peering/peerAsns/8088-Global3917\",\r\n \"type\": \"Microsoft.Peering/peerAsns\"\r\n }\r\n ]\r\n}",
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "3e919f9a-4e26-4736-aa8d-d596d9a49239",
"bandwidth": "80000",
"Hash": "6f9813318eedc9bf9599ce6be9cc811a",
"MaxPrefixV4": "1043"
"bandwidth": "70000",
"Hash": "452aef880b0dc75ae3f965c2d4fef6cf",
"MaxPrefixV4": "16255"
}
}
Loading