Skip to content

. #310

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 11 commits into from
Jan 8, 2016
Merged

. #310

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,15 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.LocationCapabilitiesTests\TestLocationCapabilities.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ServerCommunicationLinkCrudTests\TestServerCommunicationLinkCreate.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ServerCommunicationLinkCrudTests\TestServerCommunicationLinkGet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ServerCommunicationLinkCrudTests\TestServerCommunicationLinkRemove.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\sql-audit-test-env-setup-storageV2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,21 @@ namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
{
public class ServerCommunicationLinkCrudTests : SqlTestsBase
{
// TODO: adumitr: re-enable the tests when feature is fully enabled in the region the tests use
// [Fact]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkCreate()
{
RunPowerShellTest("Test-CreateServerCommunicationLink");
}

// TODO: adumitr: re-enable the tests when feature is fully enabled in the region the tests use
// [Fact]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkGet()
{
RunPowerShellTest("Test-GetServerCommunicationLink");
}

// TODO: adumitr: re-enable the tests when feature is fully enabled in the region the tests use
// [Fact]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestServerCommunicationLinkRemove()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
function Test-CreateServerCommunicationLink
{
# Setup
$rg = Create-ResourceGroupForTest
$server = Create-ServerForTest $rg "Japan East"
$server2 = Create-ServerForTest $rg "Japan East"
$locationOverride = "North Europe"
$serverVersion = "12.0"
$rg = Create-ResourceGroupForTest $locationOverride
$server1 = Create-ServerForTest $rg $serverVersion $locationOverride
$server2 = Create-ServerForTest $rg $serverVersion $locationOverride

try
{
Expand All @@ -30,6 +32,7 @@ function Test-CreateServerCommunicationLink
-LinkName $linkName -PartnerServer $server2.ServerName

Assert-NotNull $ep1
Assert-AreEqual $linkName $ep1.Name
Assert-AreEqual $server2.ServerName $ep1.PartnerServer
}
finally
Expand All @@ -45,23 +48,28 @@ function Test-CreateServerCommunicationLink
function Test-GetServerCommunicationLink
{
# Setup
$rg = Create-ResourceGroupForTest
$server = Create-ServerForTest $rg "Japan East"
$server2 = Create-ServerForTest $rg "Japan East"
$locationOverride = "North Europe"
$serverVersion = "12.0"
$rg = Create-ResourceGroupForTest $locationOverride
$server1 = Create-ServerForTest $rg $serverVersion $locationOverride
$server2 = Create-ServerForTest $rg $serverVersion $locationOverride

$linkName = Get-ElasticPoolName
$ep1 = New-AzureRmSqlServerCommunicationLink -ServerName $server1.ServerName -ResourceGroupName $rg.ResourceGroupName `
-LinkName $linkName -PartnerServer $server2.ServerName
Assert-NotNull $ep1
Assert-AreEqual $linkName $ep1.Name
Assert-AreEqual $server2.ServerName $ep1.PartnerServer

try
{
$gep1 = Get-AzureRmSqlServerCommunicationLink -ServerName $server1.ServerName -ResourceGroupName $rg.ResourceGroupName `
-LinkName $ep1.LinkName
Assert-NotNull $ep1
Assert-AreEqual $server2.ServerName $ep1.PartnerServer
-LinkName $ep1.Name
Assert-NotNull $gep1
Assert-AreEqual $linkName $gep1.Name
Assert-AreEqual $server2.ServerName $gep1.PartnerServer

$all = $server | Get-AzureRmSqlServerCommunicationLink
$all = $server1 | Get-AzureRmSqlServerCommunicationLink
Assert-AreEqual $all.Count 1
}
finally
Expand All @@ -77,9 +85,11 @@ function Test-GetServerCommunicationLink
function Test-RemoveServerCommunicationLink
{
# Setup
$rg = Create-ResourceGroupForTest
$server1 = Create-ServerForTest $rg "Japan East"
$server2 = Create-ServerForTest $rg "Japan East"
$locationOverride = "North Europe"
$serverVersion = "12.0"
$rg = Create-ResourceGroupForTest $locationOverride
$server1 = Create-ServerForTest $rg $serverVersion $locationOverride
$server2 = Create-ServerForTest $rg $serverVersion $locationOverride

$linkName = Get-ElasticPoolName
$ep1 = New-AzureRmSqlServerCommunicationLink -ServerName $server1.ServerName -ResourceGroupName $rg.ResourceGroupName `
Expand All @@ -88,9 +98,9 @@ function Test-RemoveServerCommunicationLink

try
{
Remove-AzureRmSqlServerCommunicationLink -ServerName $server1.ServerName -ResourceGroupName $rg.ResourceGroupName -LinkName $ep1.LinkName -Force
Remove-AzureRmSqlServerCommunicationLink -ServerName $server1.ServerName -ResourceGroupName $rg.ResourceGroupName -LinkName $ep1.Name -Force

$all = $server | Get-AzureRmSqlServerCommunicationLink
$all = $server1 | Get-AzureRmSqlServerCommunicationLink
Assert-AreEqual $all.Count 0
}
finally
Expand Down
Loading