Skip to content

. #25

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 16 commits into from
Jun 18, 2015
Merged

. #25

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
336 changes: 0 additions & 336 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.18.2-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Sql">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.26.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.28.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -149,8 +149,12 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="ScenarioTests\DatabaseActivationTests.cs" />
<Compile Include="ScenarioTests\DatabaseCrudTests.cs" />
<Compile Include="ScenarioTests\DataMaskingTests.cs" />
<None Include="ScenarioTests\DatabaseActivationTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\RecommendedElasticPoolTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -165,6 +169,7 @@
<Compile Include="ScenarioTests\SqlTestsBase.cs" />
<Compile Include="ScenarioTests\TransparentDataEncryptionCrudTests.cs" />
<Compile Include="UnitTests\AzureSqlCmdletBaseAttributeTests.cs" />
<Compile Include="UnitTests\AzureSqlDatabaseActivationAttributeTest.cs" />
<Compile Include="UnitTests\AzureSqlDatabaseAttributeTests.cs" />
<Compile Include="UnitTests\AzureSqlDatabaseServerServiceObjectiveAttributeTests.cs" />
<Compile Include="UnitTests\AzureSqlDatabaseServerFirewallRuleAttributeTests.cs" />
Expand Down Expand Up @@ -326,6 +331,12 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestUseServerDefault.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseActivationTests\TestDatabasePauseResume.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseActivationTests\TestDatabasePauseResumePiped.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseCreate.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ScenarioTest.SqlTests;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

namespace Microsoft.Azure.Commands.Sql.Test.ScenarioTests
{
public class DatabaseActivationTests : SqlTestsBase
{
[Fact]
[Trait(Category.Sql, Category.CheckIn)]
public void TestDatabasePauseResume()
{
RunPowerShellTest("Test-DatabasePauseResume");
}

[Fact]
[Trait(Category.Sql, Category.CheckIn)]
public void TestDatabasePauseResumePiped()
{
RunPowerShellTest("Test-DatabasePauseResumePiped");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Test pasuing and resuming database.
#>
function Test-DatabasePauseResume
{
# Setup
$location = "Southeast Asia"
$serverVersion = "12.0";
$rg = Create-ResourceGroupForTest
$server = Create-ServerForTest $rg $serverVersion $location

# Create data warehouse database with all parameters.
$databaseName = Get-DatabaseName
$collationName = "SQL_Latin1_General_CP1_CI_AS"
$maxSizeBytes = 250GB
$dwdb = New-AzureSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
-CollationName $collationName -MaxSizeBytes $maxSizeBytes -Edition DataWarehouse -RequestedServiceObjectiveName DW100

try
{
# Pause the database. Make sure the database specs remain the same and its Status is Paused.
$dwdb2 = Suspend-AzureSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $dwdb.DatabaseName
Assert-AreEqual $dwdb2.DatabaseName $databaseName
Assert-AreEqual $dwdb2.MaxSizeBytes $maxSizeBytes
Assert-AreEqual $dwdb2.Edition DataWarehouse
Assert-AreEqual $dwdb2.CurrentServiceObjectiveName DW100
Assert-AreEqual $dwdb2.CollationName $collationName
Assert-AreEqual $dwdb2.Status "Paused"

# Resume the database. Make sure the database specs remain the same and its Status is Online.
$dwdb3 = Resume-AzureSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $dwdb.DatabaseName
Assert-AreEqual $dwdb3.DatabaseName $databaseName
Assert-AreEqual $dwdb3.MaxSizeBytes $maxSizeBytes
Assert-AreEqual $dwdb3.Edition DataWarehouse
Assert-AreEqual $dwdb3.CurrentServiceObjectiveName DW100
Assert-AreEqual $dwdb3.CollationName $collationName
Assert-AreEqual $dwdb3.Status "Online"
}
finally
{
Remove-ResourceGroupForTest $rg
}
}

<#
.SYNOPSIS
Test pasuing and resuming database via piped cmdlets.
#>
function Test-DatabasePauseResumePiped
{
# Setup
$location = "Japan East"
$serverVersion = "12.0";
$rg = Create-ResourceGroupForTest

try
{
$server = Create-ServerForTest $rg $serverVersion $location

# Create data warehouse database with all parameters.
$databaseName = Get-DatabaseName
$collationName = "SQL_Latin1_General_CP1_CI_AS"
$maxSizeBytes = 250GB
$dwdb = New-AzureSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $databaseName `
-CollationName $collationName -MaxSizeBytes $maxSizeBytes -Edition DataWarehouse -RequestedServiceObjectiveName DW100


# Pause the database. Make sure the database specs remain the same and its Status is Paused.
$dwdb2 = $dwdb | Suspend-AzureSqlDatabase
Assert-AreEqual $dwdb2.DatabaseName $databaseName
Assert-AreEqual $dwdb2.MaxSizeBytes $maxSizeBytes
Assert-AreEqual $dwdb2.Edition DataWarehouse
Assert-AreEqual $dwdb2.CurrentServiceObjectiveName DW100
Assert-AreEqual $dwdb2.CollationName $collationName
Assert-AreEqual $dwdb2.Status "Paused"

# Resume the database. Make sure the database specs remain the same and its Status is Online.
$dwdb3 = $dwdb2 | Resume-AzureSqlDatabase
Assert-AreEqual $dwdb3.DatabaseName $databaseName
Assert-AreEqual $dwdb3.MaxSizeBytes $maxSizeBytes
Assert-AreEqual $dwdb3.Edition DataWarehouse
Assert-AreEqual $dwdb3.CurrentServiceObjectiveName DW100
Assert-AreEqual $dwdb3.CollationName $collationName
Assert-AreEqual $dwdb3.Status "Online"
}
finally
{
Remove-ResourceGroupForTest $rg
}
}
Loading