Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 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
6 changes: 6 additions & 0 deletions examples/virtual-hard-disk/02-VirtualHardDisks.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Param(
[string]$resourceGroupName,
[string]$resourceGroupLocation
)

Write-Host "Skip"
17 changes: 17 additions & 0 deletions examples/virtual-hard-disk/02-VirtualHardDisks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e
printf "\n=== Managing Virtual Hard Disks in Azure Compute ===\n"

printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName" "$location"
azure group create -n "$groupName" --location "$location"

printf "\n2. Creating a new storage account"
result=`azure storage account new --resourcegroupname "$groupName" --name "$groupName" --location "$location" --type "$storageAccountType"`

printf "\n3. Uploading a virtual hard disk"
result=`azure vhd add -o --resourcegroupname "$groupName" --destination https://"$groupName".blob.core.windows.net/test/test.vhd --localfilepath $(dirname $0)/test.vhd`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the $(dirname $0)/test.vhd to $BASEDIR/virtual-hard-disk/test.vhd


printf "\n4. Downloading a virtual hard disk"

printf "\n5. Removing resource group: %s.\n" "$groupName"
azure group remove -n "$groupName" -f
Binary file added examples/virtual-hard-disk/test.vhd
Binary file not shown.
15 changes: 15 additions & 0 deletions src/CLU/CLUCoreCLR.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Co
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.ScenarioTest.CLU", "Microsoft.ScenarioTests.CLU\Microsoft.ScenarioTest.CLU.xproj", "{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "VhdManagement", "VhdManagement\VhdManagement.xproj", "{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Sync", "Sync\Sync.xproj", "{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}"
ProjectSection(ProjectDependencies) = postProject
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9} = {094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -147,6 +154,14 @@ Global
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91422B55-28A5-48DE-BCA0-30C3E30FFB1C}.Release|Any CPU.Build.0 = Release|Any CPU
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{094A32EA-BABC-4A0C-9B6C-3CF7F6EABEC9}.Release|Any CPU.Build.0 = Release|Any CPU
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EDCB32A-8420-48FC-99CE-94BEA12D2FD2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 4 additions & 0 deletions src/CLU/Commands.Common.ScenarioTest/ExampleScriptRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class ExampleScriptRunner
const string ResourceGroupNameKey = "groupName";
const string locationKey = "location";
const string SessionKey = "CmdletSessionID";
const string storageAccountTypeKey = "storageAccountType";
const string DefaultStorageAccountType = "Standard_GRS";

public ExampleScriptRunner(string sessionId) : this(new Random(), sessionId)
{
Expand Down Expand Up @@ -104,6 +106,8 @@ public string RunScript(string testName)
process.EnvironmentVariables[SessionKey] = _sessionId;
process.EnvironmentVariables[ResourceGroupNameKey] = _resourceGroupName;
process.EnvironmentVariables[locationKey] = DefaultLocation;
process.EnvironmentVariables[locationKey] = DefaultLocation;
process.EnvironmentVariables[storageAccountTypeKey] = DefaultStorageAccountType;
foreach (var helper in _context.EnvironmentHelpers)
{
helper.TrySetupScriptEnvironment(_context, _clientFactory, process.EnvironmentVariables);
Expand Down
7 changes: 7 additions & 0 deletions src/CLU/Commands.Common.ScenarioTest/SampleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,19 @@ public SampleTest(ScenarioTestFixture fixture)
{
_collectionState = fixture;
}

[Fact]
public void RunSampleTest()
{
var helper = _collectionState.GetRunner("resource-management");
helper.RunScript("01-ResourceGroups");
}

[Fact]
public void RunVirtualHardDiskTest()
{
var helper = _collectionState.GetRunner("virtual-hard-disk");
helper.RunScript("02-VirtualHardDisks");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Loading