Skip to content

Commit e861afe

Browse files
committed
VHD Tests
1 parent 3fc5f35 commit e861afe

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Param(
2+
[string]$resourceGroupName,
3+
[string]$resourceGroupLocation
4+
)
5+
6+
Write-Host "Skip"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -e
3+
printf "\n=== Managing Virtual Hard Disks in Azure Compute ===\n"
4+
5+
printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName" "$location"
6+
azure group create -n "$groupName" --location "$location"
7+
8+
printf "\n2. Creating a new storage account"
9+
azure storage account new --resourcegroupname "$groupName" --name "$groupName" --location "$location" --type "$storageAccountType"
10+
11+
printf "\n3. Uploading a virtual hard disk"
12+
azure vhd add --resourcegroupname "$groupName" --destination https://"$groupName".blob.core.windows.net/test/test.vhd --localfilepath $(dirname $0)/test.vhd
13+
14+
printf "\n4. Downloading a virtual hard disk"
15+
16+
printf "\n5. Removing resource group: %s.\n" "$groupName"
17+
azure group remove -n "$groupName" -f

examples/virtual-hard-disk/test.vhd

26.1 MB
Binary file not shown.

src/CLU/Commands.Common.ScenarioTest/ExampleScriptRunner.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class ExampleScriptRunner
4040
const string ResourceGroupNameKey = "groupName";
4141
const string locationKey = "location";
4242
const string SessionKey = "CmdletSessionID";
43+
const string storageAccountTypeKey = "storageAccountType";
44+
const string DefaultStorageAccountType = "Standard_GRS";
4345

4446
public ExampleScriptRunner(string sessionId) : this(new Random(), sessionId)
4547
{
@@ -104,6 +106,8 @@ public string RunScript(string testName)
104106
process.EnvironmentVariables[SessionKey] = _sessionId;
105107
process.EnvironmentVariables[ResourceGroupNameKey] = _resourceGroupName;
106108
process.EnvironmentVariables[locationKey] = DefaultLocation;
109+
process.EnvironmentVariables[locationKey] = DefaultLocation;
110+
process.EnvironmentVariables[storageAccountTypeKey] = DefaultStorageAccountType;
107111
foreach (var helper in _context.EnvironmentHelpers)
108112
{
109113
helper.TrySetupScriptEnvironment(_context, _clientFactory, process.EnvironmentVariables);

src/CLU/Commands.Common.ScenarioTest/SampleTest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ public SampleTest(ScenarioTestFixture fixture)
3131
{
3232
_collectionState = fixture;
3333
}
34+
3435
[Fact]
3536
public void RunSampleTest()
3637
{
3738
var helper = _collectionState.GetRunner("resource-management");
3839
helper.RunScript("01-ResourceGroups");
3940
}
4041

42+
[Fact]
43+
public void RunVirtualHardDiskTest()
44+
{
45+
var helper = _collectionState.GetRunner("virtual-hard-disk");
46+
helper.RunScript("02-VirtualHardDisks");
47+
}
4148
}
4249
}

0 commit comments

Comments
 (0)