diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.cs b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.cs index 7343e9362214..6420b7540024 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.cs +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.cs @@ -23,7 +23,7 @@ public partial class VirtualMachineTests [Trait(Category.AcceptanceType, Category.CheckIn)] public void TestVirtualMachine() { - ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachine"); + ComputeTestController.NewInstance.RunPsTest(@"Test-VirtualMachine $null"); } [Fact] diff --git a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 index 9069564869fd..cb42244dd881 100644 --- a/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 +++ b/src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 @@ -18,13 +18,17 @@ Test Virtual Machines #> function Test-VirtualMachine { + param ($loc) # Setup $rgname = Get-ComputeTestResourceName try { # Common - $loc = Get-ComputeVMLocation; + if ($loc -eq $null) + { + $loc = Get-ComputeVMLocation; + } New-AzureRmResourceGroup -Name $rgname -Location $loc -Force; # VM Profile & Hardware diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs index bd99b91f13f8..a302f1f7af14 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs @@ -1596,14 +1596,16 @@ public string GetAzureVMImageName(string[] keywords, bool exactMatch = true, int Collection vmImages = GetAzureVMImage(); foreach (SM.OSImageContext image in vmImages) { - if (Utilities.MatchKeywords(image.ImageName, keywords, exactMatch) >= 0 && - ((diskSize == null) || (image.LogicalSizeInGB <= diskSize))) + if (Utilities.MatchKeywords(image.ImageName, keywords, exactMatch) >= 0 + && ((diskSize == null) || (image.LogicalSizeInGB <= diskSize)) + && image.Location.Contains(CredentialHelper.Location)) return image.ImageName; } foreach (SM.OSImageContext image in vmImages) { - if (Utilities.MatchKeywords(image.OS, keywords, exactMatch) >= 0 && - ((diskSize == null) || (image.LogicalSizeInGB <= diskSize))) + if (Utilities.MatchKeywords(image.OS, keywords, exactMatch) >= 0 + && ((diskSize == null) || (image.LogicalSizeInGB <= diskSize)) + && image.Location.Contains(CredentialHelper.Location)) return image.ImageName; } return null; diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs index c0d4e43ced9b..9dbe5e1a4426 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs @@ -105,9 +105,9 @@ public static void SetDefaultStorage() { defaultAzureSubscription = vmPowershellCmdlets.SetAzureSubscription(defaultAzureSubscription.SubscriptionName, defaultAzureSubscription.SubscriptionId, CredentialHelper.DefaultStorageName); vmPowershellCmdlets.SelectAzureSubscription(defaultAzureSubscription.SubscriptionName, true); - storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(defaultAzureSubscription.CurrentStorageAccountName); - Assert.AreEqual(defaultAzureSubscription.CurrentStorageAccountName, storageAccountKey.StorageAccountName); - blobUrlRoot = (vmPowershellCmdlets.GetAzureStorageAccount(defaultAzureSubscription.CurrentStorageAccountName)[0].Endpoints.ToArray())[0]; + storageAccountKey = vmPowershellCmdlets.GetAzureStorageAccountKey(CredentialHelper.DefaultStorageName); + Assert.AreEqual(CredentialHelper.DefaultStorageName, storageAccountKey.StorageAccountName); + blobUrlRoot = (vmPowershellCmdlets.GetAzureStorageAccount(CredentialHelper.DefaultStorageName)[0].Endpoints.ToArray())[0]; } else {