@@ -61,6 +61,96 @@ public void Cleanup()
61
61
Utilities . ExecuteAndLog ( ( ) => CleanupService ( serviceName ) , "Delete service" ) ;
62
62
}
63
63
64
+ [ TestMethod ( ) , Priority ( 0 ) , TestProperty ( "Feature" , "IaaS" ) , TestCategory ( Category . Network ) , Owner ( "hylee" ) , Description ( "Test the cmdlets (New-AzureReservedIP,Get-AzureReservedIP,Remove-AzureReservedIP)" ) ]
65
+ [ DataSource ( "Microsoft.VisualStudio.TestTools.DataSource.CSV" , "|DataDirectory|\\ Resources\\ packageReservedIP.csv" , "package#csv" , DataAccessMethod . Sequential ) ]
66
+ public void CreateReservedIPThenPaaSVM ( )
67
+ {
68
+ try
69
+ {
70
+ string reservedIpName1 = "ResrvdIP1" ;
71
+ string reservedIpName2 = "ResrvdIP2" ;
72
+ string reservedIpLabel1 = Utilities . GetUniqueShortName ( "ResrvdIPLbl" , 5 ) ;
73
+ string reservedIpLabel2 = Utilities . GetUniqueShortName ( "ResrvdIPLbl" , 5 ) ;
74
+ string dnsName = Utilities . GetUniqueShortName ( "Dns" ) ;
75
+ //string vmName = Utilities.GetUniqueShortName(vmNamePrefix);
76
+ string deploymentName = Utilities . GetUniqueShortName ( "Depl" ) ;
77
+ var input1 = new ReservedIPContext ( )
78
+ {
79
+ //Address = string.Empty,
80
+ DeploymentName = string . Empty ,
81
+ Label = reservedIpLabel1 ,
82
+ InUse = false ,
83
+ Location = locationName ,
84
+ ReservedIPName = reservedIpName1 ,
85
+ State = "Created"
86
+ } ;
87
+
88
+ var input2 = new ReservedIPContext ( )
89
+ {
90
+ //Address = string.Empty,
91
+ DeploymentName = string . Empty ,
92
+ Label = reservedIpLabel2 ,
93
+ InUse = false ,
94
+ Location = locationName ,
95
+ ReservedIPName = reservedIpName2 ,
96
+ State = "Created"
97
+ } ;
98
+
99
+ // Reserve a new IP
100
+ Utilities . ExecuteAndLog ( ( ) => vmPowershellCmdlets . NewAzureReservedIP ( reservedIpName1 , locationName , reservedIpLabel1 ) , "Reserve a new IP" ) ;
101
+ //Get the reserved ip and verify the reserved Ip properties.
102
+ VerifyReservedIpNotInUse ( input1 ) ;
103
+
104
+ // Reserve a new IP
105
+ Utilities . ExecuteAndLog ( ( ) => vmPowershellCmdlets . NewAzureReservedIP ( reservedIpName2 , locationName , reservedIpLabel2 ) , "Reserve a new IP" ) ;
106
+ //Get the reserved ip and verify the reserved Ip properties.
107
+ VerifyReservedIpNotInUse ( input2 ) ;
108
+
109
+ vmPowershellCmdlets . NewAzureService ( serviceName , locationName ) ;
110
+
111
+
112
+ var _packageName = Convert . ToString ( TestContext . DataRow [ "packageName" ] ) ;
113
+ var _configName1 = Convert . ToString ( TestContext . DataRow [ "configName1" ] ) ;
114
+ var _configName2 = Convert . ToString ( TestContext . DataRow [ "configName2" ] ) ;
115
+ var _configName1update = Convert . ToString ( TestContext . DataRow [ "updateConfig1" ] ) ;
116
+ var _configName2update = Convert . ToString ( TestContext . DataRow [ "updateConfig2" ] ) ;
117
+
118
+ var _packagePath = new FileInfo ( Directory . GetCurrentDirectory ( ) + "\\ " + _packageName ) ;
119
+ var _configPath1 = new FileInfo ( Directory . GetCurrentDirectory ( ) + "\\ " + _configName1 ) ;
120
+ var _configPath2 = new FileInfo ( Directory . GetCurrentDirectory ( ) + "\\ " + _configName2 ) ;
121
+ var _configPath1update = new FileInfo ( Directory . GetCurrentDirectory ( ) + "\\ " + _configName1update ) ;
122
+ var _configPath2update = new FileInfo ( Directory . GetCurrentDirectory ( ) + "\\ " + _configName2update ) ;
123
+
124
+
125
+ vmPowershellCmdlets . NewAzureDeployment ( serviceName , _packagePath . FullName , _configPath1 . FullName ,
126
+ DeploymentSlotType . Production , "label" , deploymentName , false , false ) ;
127
+
128
+ vmPowershellCmdlets . NewAzureDeployment ( serviceName , _packagePath . FullName , _configPath2 . FullName ,
129
+ DeploymentSlotType . Staging , "label" , deploymentName , false , false ) ;
130
+
131
+
132
+
133
+
134
+ vmPowershellCmdlets . MoveAzureDeployment ( serviceName ) ;
135
+
136
+ vmPowershellCmdlets . GetAzureDeployment ( serviceName , DeploymentSlotType . Production ) ;
137
+ vmPowershellCmdlets . GetAzureDeployment ( serviceName , DeploymentSlotType . Staging ) ;
138
+
139
+ vmPowershellCmdlets . SetAzureDeploymentConfig ( serviceName , DeploymentSlotType . Production , _configPath1update . FullName ) ;
140
+ vmPowershellCmdlets . SetAzureDeploymentConfig ( serviceName , DeploymentSlotType . Staging , _configPath2update . FullName ) ;
141
+
142
+
143
+
144
+ pass = true ;
145
+ }
146
+ catch ( Exception ex )
147
+ {
148
+ pass = false ;
149
+ Console . WriteLine ( ex . ToString ( ) ) ;
150
+ throw ;
151
+ }
152
+ }
153
+
64
154
[ TestMethod ( ) , Priority ( 0 ) , TestProperty ( "Feature" , "IaaS" ) , TestCategory ( Category . Network ) , Owner ( "hylee" ) , Description ( "Test the cmdlets (New-AzureReservedIP,Get-AzureReservedIP,Remove-AzureReservedIP)" ) ]
65
155
public void CreateReservedIPThenWindowsVM ( )
66
156
{
0 commit comments