-
Notifications
You must be signed in to change notification settings - Fork 4k
Some test fixes for AzureRT tests. #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<TestSettings | ||
id="bbc9ef85-493f-459f-bc76-434f1966c32c" | ||
name="AzureRTSeq" | ||
enableDefaultDataCollectors="false" | ||
xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> | ||
<Description>These are test settings for AzureRT test run.</Description> | ||
<Deployment> | ||
<DeploymentItem filename="ServiceManagement\Compute\Commands.ServiceManagement.Test\Resources\" /> | ||
<DeploymentItem filename="Package\Debug\" /> | ||
</Deployment> | ||
<Execution parallelTestCount="1"> | ||
<Timeouts testTimeout="3000000" /> | ||
</Execution> | ||
</TestSettings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model; | ||
using Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests.ConfigDataInfo; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note line breaks & order for the |
||
using System.Threading; | ||
|
||
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests | ||
{ | ||
[TestClass] | ||
|
@@ -72,7 +74,9 @@ public void CreateReservedIPThenPaaSVM() | |
string reservedIpLabel1 = Utilities.GetUniqueShortName("ResrvdIPLbl", 5); | ||
string reservedIpLabel2 = Utilities.GetUniqueShortName("ResrvdIPLbl", 5); | ||
string dnsName = Utilities.GetUniqueShortName("Dns"); | ||
string deploymentName = Utilities.GetUniqueShortName("Depl"); | ||
string deploymentName1 = Utilities.GetUniqueShortName("Depl"); | ||
string deploymentName2 = Utilities.GetUniqueShortName("Depl"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it's better to also have a different prefix, i.e. |
||
|
||
var input1 = new ReservedIPContext() | ||
{ | ||
DeploymentName = string.Empty, | ||
|
@@ -95,48 +99,41 @@ public void CreateReservedIPThenPaaSVM() | |
|
||
// Reserve a new IP | ||
Utilities.ExecuteAndLog(() => vmPowershellCmdlets.NewAzureReservedIP(reservedIpName1, locationName, reservedIpLabel1), "Reserve a new IP"); | ||
|
||
//Get the reserved ip and verify the reserved Ip properties. | ||
VerifyReservedIpNotInUse(input1); | ||
|
||
// Reserve a new IP | ||
Utilities.ExecuteAndLog(() => vmPowershellCmdlets.NewAzureReservedIP(reservedIpName2, locationName, reservedIpLabel2), "Reserve a new IP"); | ||
|
||
//Get the reserved ip and verify the reserved Ip properties. | ||
VerifyReservedIpNotInUse(input2); | ||
|
||
vmPowershellCmdlets.NewAzureService(serviceName, locationName); | ||
|
||
|
||
var _packageName = Convert.ToString(TestContext.DataRow["packageName"]); | ||
var _configName1 = Convert.ToString(TestContext.DataRow["configName1"]); | ||
var _configName2 = Convert.ToString(TestContext.DataRow["configName2"]); | ||
var _configName1update = Convert.ToString(TestContext.DataRow["updateConfig1"]); | ||
var _configName2update = Convert.ToString(TestContext.DataRow["updateConfig2"]); | ||
|
||
var _packagePath = new FileInfo(Directory.GetCurrentDirectory() + "\\" + _packageName); | ||
var _configPath1 = new FileInfo(Directory.GetCurrentDirectory() + "\\" + _configName1); | ||
var _configPath2 = new FileInfo(Directory.GetCurrentDirectory() + "\\" + _configName2); | ||
var _configPath1update = new FileInfo(Directory.GetCurrentDirectory() + "\\" + _configName1update); | ||
var _configPath2update = new FileInfo(Directory.GetCurrentDirectory() + "\\" + _configName2update); | ||
|
||
|
||
vmPowershellCmdlets.NewAzureDeployment(serviceName, _packagePath.FullName, _configPath1.FullName, | ||
DeploymentSlotType.Production, "label", deploymentName, false, false); | ||
|
||
vmPowershellCmdlets.NewAzureDeployment(serviceName, _packagePath.FullName, _configPath2.FullName, | ||
DeploymentSlotType.Staging, "label", deploymentName, false, false); | ||
var _configName = Convert.ToString(TestContext.DataRow["configName"]); | ||
var _configNameupdate = Convert.ToString(TestContext.DataRow["updateConfig"]); | ||
|
||
string _packagePath = (new FileInfo(Directory.GetCurrentDirectory() + "\\" + _packageName)).FullName; | ||
string _configPath1 = StoreConfigFileWithReservedIp(_configName, reservedIpName1); | ||
string _configPath2 = StoreConfigFileWithReservedIp(_configName, reservedIpName2); | ||
string _configPath1update = StoreConfigFileWithReservedIp(_configNameupdate, reservedIpName1); | ||
string _configPath2update = StoreConfigFileWithReservedIp(_configNameupdate, reservedIpName2); | ||
|
||
vmPowershellCmdlets.NewAzureDeployment(serviceName, _packagePath, _configPath1, | ||
DeploymentSlotType.Production, "label", deploymentName1, false, false); | ||
|
||
vmPowershellCmdlets.NewAzureDeployment(serviceName, _packagePath, _configPath2, | ||
DeploymentSlotType.Staging, "label", deploymentName2, false, false); | ||
|
||
vmPowershellCmdlets.MoveAzureDeployment(serviceName); | ||
|
||
vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Production); | ||
vmPowershellCmdlets.GetAzureDeployment(serviceName, DeploymentSlotType.Staging); | ||
|
||
vmPowershellCmdlets.SetAzureDeploymentConfig(serviceName, DeploymentSlotType.Production, _configPath1update.FullName); | ||
vmPowershellCmdlets.SetAzureDeploymentConfig(serviceName, DeploymentSlotType.Staging, _configPath2update.FullName); | ||
|
||
|
||
vmPowershellCmdlets.SetAzureDeploymentConfig(serviceName, DeploymentSlotType.Production, _configPath1update); | ||
vmPowershellCmdlets.SetAzureDeploymentConfig(serviceName, DeploymentSlotType.Staging, _configPath2update); | ||
|
||
pass = true; | ||
} | ||
|
@@ -148,6 +145,17 @@ public void CreateReservedIPThenPaaSVM() | |
} | ||
} | ||
|
||
private string StoreConfigFileWithReservedIp(string configFileName, string reservedIpName) | ||
{ | ||
var originalConfigPath = new FileInfo(Directory.GetCurrentDirectory() + "\\" + configFileName); | ||
var tempConfigPath = new FileInfo(Directory.GetCurrentDirectory() + "\\" + Utilities.GetUniqueShortName(configFileName)); | ||
|
||
string _config1_format = File.ReadAllText(originalConfigPath.FullName); | ||
|
||
File.WriteAllText(tempConfigPath.FullName, string.Format(_config1_format, reservedIpName)); | ||
return tempConfigPath.FullName; | ||
} | ||
|
||
[TestMethod(), Priority(0), TestProperty("Feature", "IaaS"), TestCategory(Category.Network), Owner("hylee"), Description("Test the cmdlets (New-AzureReservedIP,Get-AzureReservedIP,Remove-AzureReservedIP)")] | ||
public void CreateReservedIPThenWindowsVM() | ||
{ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files will be copied to, for example,
.\bin\Debug\Resources\
folder, not.\bin\Debug\
.