Skip to content

Commit e69d502

Browse files
committed
Merge pull request #712 from dominiqa/dev
PR for SQL Database Replication Cmdlets
2 parents c0400e5 + d1f8f02 commit e69d502

39 files changed

+43348
-14
lines changed

setup/azurecmdfiles.wxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,9 @@
21222122
<Component Id="cmp499092B04619C0EDE4686B78E1128605" Guid="*">
21232123
<File Id="fil9E595049BBFB9413DD757D01D9D71D3E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Commands.Sql.dll-Help.xml" />
21242124
</Component>
2125+
<Component Id="cmpF23457BA331434DDB0815F84746FD1E7" Guid="*">
2126+
<File Id="fil1972DDA29C9A5FC7D61122B5F5E1D84B" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Commands.Sql.Types.ps1xml" />
2127+
</Component>
21252128
<Component Id="cmp4345BAF62C4935A6C763E439913D5EF1" Guid="*">
21262129
<File Id="fil7A2E85A4308692430EBF0FF8501B017A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Common.Authentication.dll" />
21272130
</Component>
@@ -5631,6 +5634,7 @@
56315634
<ComponentRef Id="cmp5746A3BAD258D8EA1473730146C01F1D" />
56325635
<ComponentRef Id="cmp56F52674BB946225BB64533814DCF37F" />
56335636
<ComponentRef Id="cmp499092B04619C0EDE4686B78E1128605" />
5637+
<ComponentRef Id="cmpF23457BA331434DDB0815F84746FD1E7" />
56345638
<ComponentRef Id="cmp4345BAF62C4935A6C763E439913D5EF1" />
56355639
<ComponentRef Id="cmpDA20E40FD1BE07A113851AFDBA89787D" />
56365640
<ComponentRef Id="cmp2C144B41FAE124CE1C9921E8B7DB9776" />

src/ResourceManager/Resources/Commands.Resources/AzureResourceManager.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ ScriptsToProcess = @()
5555

5656
# Type files (.ps1xml) to be loaded when importing this module
5757
TypesToProcess = @(
58-
'.\Compute\Microsoft.Azure.Commands.Compute.Types.ps1xml'
58+
'.\Compute\Microsoft.Azure.Commands.Compute.Types.ps1xml',
59+
'.\Sql\Microsoft.Azure.Commands.Sql.Types.ps1xml'
5960
)
6061

6162
# Format files (.ps1xml) to be loaded when importing this module

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
<SpecificVersion>False</SpecificVersion>
5252
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.19.2-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
5353
</Reference>
54-
<Reference Include="Microsoft.Azure.Management.Sql">
55-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.29.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
56-
</Reference>
5754
<Reference Include="Microsoft.Azure.Common">
5855
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
5956
</Reference>
@@ -67,8 +64,9 @@
6764
<Reference Include="Microsoft.Azure.Gallery">
6865
<HintPath>..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll</HintPath>
6966
</Reference>
70-
<Reference Include="Microsoft.Azure.Management.Sql">
71-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.32.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
67+
<Reference Include="Microsoft.Azure.Management.Sql, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.34.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
69+
<Private>True</Private>
7270
</Reference>
7371
<Reference Include="Microsoft.Azure.Management.Storage">
7472
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
@@ -185,8 +183,12 @@
185183
</Compile>
186184
<Compile Include="ScenarioTests\DatabaseActivationTests.cs" />
187185
<Compile Include="ScenarioTests\DatabaseBackupTests.cs" />
186+
<Compile Include="ScenarioTests\DatabaseReplicationTests.cs" />
188187
<Compile Include="ScenarioTests\DatabaseCrudTests.cs" />
189188
<Compile Include="ScenarioTests\DataMaskingTests.cs" />
189+
<None Include="ScenarioTests\DatabaseReplicationTests.ps1">
190+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
191+
</None>
190192
<None Include="ScenarioTests\ServiceTierAdvisorTests.ps1">
191193
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
192194
</None>
@@ -406,6 +408,14 @@
406408
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseUpdateV2.json">
407409
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
408410
</None>
411+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateDatabaseCopy.json" />
412+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateDatabaseCopyV2.json" />
413+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateSecondaryDatabase.json" />
414+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestCreateSecondaryDatabaseV2.json" />
415+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestGetReplicationLink.json" />
416+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestGetReplicationLinkV2.json" />
417+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestRemoveSecondaryDatabase.json" />
418+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseReplicationTests\TestRemoveSecondaryDatabaseV2.json" />
409419
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.ElasticPoolCrudTests\TestElasticPoolCreate.json">
410420
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
411421
</None>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/Common.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ function Get-ElasticPoolName
158158
.SYNOPSIS
159159
Creates a resource group for tests
160160
#>
161-
function Create-ResourceGroupForTest ()
161+
function Create-ResourceGroupForTest ($location = "Japan East")
162162
{
163-
$location = "Japan East"
164163
$rgName = Get-ResourceGroupName
165164

166165
$rg = New-AzureResourceGroup -Name $rgName -Location $location
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
19+
namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
20+
{
21+
public class DatabaseReplicationTests : SqlTestsBase
22+
{
23+
[Fact]
24+
[Trait(Category.Sql, Category.CheckIn)]
25+
public void TestCreateDatabaseCopy()
26+
{
27+
RunPowerShellTest("Test-CreateDatabaseCopy");
28+
}
29+
30+
[Fact]
31+
[Trait(Category.Sql, Category.CheckIn)]
32+
public void TestCreateDatabaseCopyV2()
33+
{
34+
RunPowerShellTest("Test-CreateDatabaseCopyV2");
35+
}
36+
37+
[Fact]
38+
[Trait(Category.Sql, Category.CheckIn)]
39+
public void TestCreateSecondaryDatabase()
40+
{
41+
RunPowerShellTest("Test-CreateSecondaryDatabase");
42+
}
43+
44+
[Fact]
45+
[Trait(Category.Sql, Category.CheckIn)]
46+
public void TestCreateSecondaryDatabaseV2()
47+
{
48+
RunPowerShellTest("Test-CreateSecondaryDatabaseV2");
49+
}
50+
51+
[Fact]
52+
[Trait(Category.Sql, Category.CheckIn)]
53+
public void TestGetReplicationLink()
54+
{
55+
RunPowerShellTest("Test-GetReplicationLink");
56+
}
57+
58+
[Fact]
59+
[Trait(Category.Sql, Category.CheckIn)]
60+
public void TestGetReplicationLinkV2()
61+
{
62+
RunPowerShellTest("Test-GetReplicationLinkV2");
63+
}
64+
65+
[Fact]
66+
[Trait(Category.Sql, Category.CheckIn)]
67+
public void TestRemoveSecondaryDatabase()
68+
{
69+
RunPowerShellTest("Test-RemoveSecondaryDatabase");
70+
}
71+
72+
[Fact]
73+
[Trait(Category.Sql, Category.CheckIn)]
74+
public void TestRemoveSecondaryDatabaseV2()
75+
{
76+
RunPowerShellTest("Test-RemoveSecondaryDatabaseV2");
77+
}
78+
}
79+
}

0 commit comments

Comments
 (0)