Skip to content

Commit 7b5a79a

Browse files
author
Samuel Anudeep
committed
Merge pull request #71 from MabOneSdk/csp-artemis
CSP Artemis
2 parents 2afe8b3 + bf2bf42 commit 7b5a79a

20 files changed

+1734
-364
lines changed

setup/azurecmdfiles.wxi

Lines changed: 374 additions & 336 deletions
Large diffs are not rendered by default.

src/ResourceManager/AzureBackup/Commands.AzureBackup.Test/Commands.AzureBackup.Test.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</Reference>
4242
<Reference Include="Microsoft.Azure.Management.BackupServicesManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4343
<SpecificVersion>False</SpecificVersion>
44-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.BackupServices.1.0.0-preview\lib\net40\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
44+
<HintPath>..\Commands.AzureBackup\Resources\Microsoft.Azure.Management.BackupServicesManagement.dll</HintPath>
4545
</Reference>
4646
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4747
<SpecificVersion>False</SpecificVersion>
@@ -124,6 +124,7 @@
124124
</Reference>
125125
</ItemGroup>
126126
<ItemGroup>
127+
<Compile Include="ScenarioTests\AzureBackupContainerTests.cs" />
127128
<Compile Include="ScenarioTests\AzureBackupTestBase.cs" />
128129
<Compile Include="Properties\AssemblyInfo.cs" />
129130
<Compile Include="ScenarioTests\AzureBackupVaultTests.cs">
@@ -154,9 +155,15 @@
154155
<None Include="packages.config">
155156
<SubType>Designer</SubType>
156157
</None>
158+
<None Include="ScenarioTests\AzureBackupContainerTests.ps1">
159+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
160+
</None>
157161
<None Include="ScenarioTests\AzureBackupVaultTests.ps1">
158162
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
159163
</None>
164+
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupContainerTests\AzureBackupMarsContainerScenarioTests.json">
165+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
166+
</None>
160167
<None Include="SessionRecords\Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests.AzureBackupVaultTests\AzureBackupVaultScenarioTests.json">
161168
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
162169
</None>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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.WindowsAzure.Commands.ScenarioTest;
16+
using System;
17+
using System.Collections.Generic;
18+
using System.Linq;
19+
using System.Text;
20+
using System.Threading.Tasks;
21+
using Xunit;
22+
23+
namespace Microsoft.Azure.Commands.AzureBackup.Test.ScenarioTests
24+
{
25+
public class AzureBackupContainerTests : AzureBackupTestsBase
26+
{
27+
[Fact]
28+
[Trait(Category.AcceptanceType, Category.CheckIn)]
29+
public void AzureBackupMarsContainerScenarioTests()
30+
{
31+
this.RunPowerShellTest("Test-AzureBackupMarsContainerScenario");
32+
}
33+
}
34+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
$ResourceGroupName = "backuprg"
16+
$ResourceName = "backuprn1"
17+
$ContainerName = "DPMDRSCALEINT1.DPMDOM02.SELFHOST.CORP.MICROSOFT.COM"
18+
$ContainerType = "Windows"
19+
$ContainerId = "10034"
20+
$ContainerStatus = "Registered"
21+
22+
function Test-AzureBackupMarsContainerScenario
23+
{
24+
$vault = Get-AzureBackupVault -ResourceGroupName $ResourceGroupName -Name $ResourceName
25+
26+
$containers = Get-AzureBackupContainer -vault $vault -type $ContainerType
27+
Assert-AreEqual $containers[0].ContainerType $ContainerType;
28+
Assert-AreEqual $containers[0].Id $ContainerId;
29+
Assert-AreEqual $containers[0].Location $vault.Region;
30+
Assert-AreEqual $containers[0].Name $ContainerName;
31+
Assert-AreEqual $containers[0].ResourceGroupName $vault.ResourceGroupName;
32+
Assert-AreEqual $containers[0].ResourceName $vault.Name;
33+
Assert-AreEqual $containers[0].Status $ContainerStatus;
34+
35+
$namedContainers = Get-AzureBackupContainer -vault $vault -type $ContainerType -name $ContainerName
36+
$container = $namedContainers[0];
37+
Assert-AreEqual $container.ContainerType $ContainerType;
38+
Assert-AreEqual $container.Id $ContainerId;
39+
Assert-AreEqual $container.Location $vault.Region;
40+
Assert-AreEqual $container.Name $ContainerName;
41+
Assert-AreEqual $container.ResourceGroupName $vault.ResourceGroupName;
42+
Assert-AreEqual $container.ResourceName $vault.Name;
43+
Assert-AreEqual $container.Status $ContainerStatus;
44+
45+
Unregister-AzureBackupContainer -Container $container -Force
46+
47+
$unregContainers = Get-AzureBackupContainer -vault $vault -type $ContainerType -name $ContainerName
48+
Assert-AreEqual $unregContainers.Count 0;
49+
}

0 commit comments

Comments
 (0)