Skip to content

Commit

Permalink
Merge pull request #29 from Azure/dev
Browse files Browse the repository at this point in the history
pr from parent
  • Loading branch information
sethusrinivasan committed Jul 22, 2015
2 parents 2c2d061 + 29f3208 commit 89df986
Show file tree
Hide file tree
Showing 25 changed files with 2,109 additions and 709 deletions.
710 changes: 374 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 @@ -39,9 +39,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.27-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.BackupServicesManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.Azure.Management.BackupServicesManagement, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.0-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.1-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.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 @@ -124,6 +124,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ScenarioTests\AzureBackupContainerTests.cs" />
<Compile Include="ScenarioTests\AzureBackupTestBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScenarioTests\AzureBackupVaultTests.cs">
Expand Down Expand Up @@ -154,9 +155,15 @@
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="ScenarioTests\AzureBackupContainerTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\AzureBackupVaultTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests\AzureBackupMarsContainerScenarioTests.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupVaultTests\AzureBackupVaultScenarioTests.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// ----------------------------------------------------------------------------------
//
// 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.WindowsAzure.Commands.ScenarioTest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests
{
public class AzureBackupContainerTests : AzureBackupTestsBase
{
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void AzureBackupMarsContainerScenarioTests()
{
this.RunPowerShellTest("Test-AzureBackupMarsContainerScenario");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------

$ResourceGroupName = "backuprg"
$ResourceName = "backuprn1"
$ContainerName = "DPMDRSCALEINT1.DPMDOM02.SELFHOST.CORP.MICROSOFT.COM"
$ContainerType = "Windows"
$ContainerId = "10034"
$ContainerStatus = "Registered"

function Test-AzureBackupMarsContainerScenario
{
$vault = Get-AzureBackupVault -ResourceGroupName $ResourceGroupName -Name $ResourceName

$containers = Get-AzureBackupContainer -vault $vault -type $ContainerType
Assert-AreEqual $containers[0].ContainerType $ContainerType;
Assert-AreEqual $containers[0].Id $ContainerId;
Assert-AreEqual $containers[0].Location $vault.Region;
Assert-AreEqual $containers[0].Name $ContainerName;
Assert-AreEqual $containers[0].ResourceGroupName $vault.ResourceGroupName;
Assert-AreEqual $containers[0].ResourceName $vault.Name;
Assert-AreEqual $containers[0].Status $ContainerStatus;

$namedContainers = Get-AzureBackupContainer -vault $vault -type $ContainerType -name $ContainerName
$container = $namedContainers[0];
Assert-AreEqual $container.ContainerType $ContainerType;
Assert-AreEqual $container.Id $ContainerId;
Assert-AreEqual $container.Location $vault.Region;
Assert-AreEqual $container.Name $ContainerName;
Assert-AreEqual $container.ResourceGroupName $vault.ResourceGroupName;
Assert-AreEqual $container.ResourceName $vault.Name;
Assert-AreEqual $container.Status $ContainerStatus;

Unregister-AzureBackupContainer -Container $container -Force

$unregContainers = Get-AzureBackupContainer -vault $vault -type $ContainerType -name $ContainerName
Assert-AreEqual $unregContainers.Count 0;
}
Loading

0 comments on commit 89df986

Please sign in to comment.