PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ServiceManagement/Common/Commands.ScenarioTest/WebsitesTests/WebsitesTests.cs

https://gitlab.com/jslee1/azure-powershell
C# | 476 lines | 395 code | 68 blank | 13 comment | 0 complexity | 0a64bee7aeffb10340b190d6367c5ffa MD5 | raw file
  1. // ----------------------------------------------------------------------------------
  2. //
  3. // Copyright Microsoft Corporation
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. // ----------------------------------------------------------------------------------
  14. using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
  15. using Microsoft.WindowsAzure.ServiceManagemenet.Common.Models;
  16. using Xunit;
  17. using Xunit.Abstractions;
  18. namespace Microsoft.WindowsAzure.Commands.ScenarioTest.WebsitesTests
  19. {
  20. public class WebsitesTests : WebsitesTestsBase
  21. {
  22. #region Remove-AzureWebsite Scenario Tests
  23. public WebsitesTests(ITestOutputHelper output)
  24. {
  25. XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
  26. }
  27. [Fact]
  28. [Trait(Category.RunType, Category.LiveOnly)]
  29. [Trait(Category.AcceptanceType, Category.BVT)]
  30. [Trait(Category.Service, Category.Websites)]
  31. [Trait(Category.Environment, Category.WAPack)]
  32. public void TestRemoveAzureWebsiteWithInvalidCredentials()
  33. {
  34. RunPowerShellTest("Run-WebsiteTest {Test-WithInvalidCredentials {Remove-AzureWebsite $(Get-WebsiteName) -Force }} 'TestRemoveAzureWebsiteWithInvalidCredentials'");
  35. }
  36. [Fact]
  37. [Trait(Category.RunType, Category.LiveOnly)]
  38. [Trait(Category.AcceptanceType, Category.BVT)]
  39. [Trait(Category.Service, Category.Websites)]
  40. [Trait(Category.Environment, Category.WAPack)]
  41. public void TestRemoveAzureServiceWithValidName()
  42. {
  43. RunPowerShellTest("Run-WebsiteTest {Test-RemoveAzureServiceWithValidName} 'TestRemoveAzureServiceWithValidName'");
  44. }
  45. [Fact]
  46. [Trait(Category.RunType, Category.LiveOnly)]
  47. [Trait(Category.AcceptanceType, Category.BVT)]
  48. [Trait(Category.Service, Category.Websites)]
  49. [Trait(Category.Environment, Category.WAPack)]
  50. public void TestRemoveAzureServiceWithNonExistingName()
  51. {
  52. RunPowerShellTest("Run-WebsiteTest {Test-RemoveAzureServiceWithNonExistingName} 'TestRemoveAzureServiceWithNonExistingName'");
  53. }
  54. [Fact]
  55. [Trait(Category.RunType, Category.LiveOnly)]
  56. [Trait(Category.AcceptanceType, Category.BVT)]
  57. [Trait(Category.Service, Category.Websites)]
  58. [Trait(Category.Environment, Category.WAPack)]
  59. public void TestRemoveAzureServiceWithWhatIf()
  60. {
  61. RunPowerShellTest("Run-WebsiteTest {Test-RemoveAzureServiceWithWhatIf} 'TestRemoveAzureServiceWithWhatIf'");
  62. }
  63. #endregion Remove-AzureWebsite Scenario Tests
  64. #region Get-AzureWebsiteLog Scenario Tests
  65. [Fact]
  66. [Trait(Category.RunType, Category.LiveOnly)]
  67. [Trait(Category.AcceptanceType, Category.BVT)]
  68. [Trait(Category.Service, Category.Websites)]
  69. [Trait(Category.Environment, Category.WAPack)]
  70. public void TestGetAzureWebsiteLogWithInvalidCredentials()
  71. {
  72. RunPowerShellTest("Run-WebsiteTest {Test-WithInvalidCredentials { Get-AzureWebsiteLog -Tail -Name $(Get-WebsiteName) }} 'TestGetAzureWebsiteLogWithInvalidCredentials'");
  73. }
  74. [Fact(Skip = "TODO: Fix the failing tests.")]
  75. [Trait(Category.RunType, Category.LiveOnly)]
  76. [Trait(Category.Service, Category.Websites)]
  77. [Trait(Category.Environment, Category.WAPack)]
  78. public void TestGetAzureWebsiteLogTail()
  79. {
  80. RunPowerShellTest("Test-GetAzureWebsiteLogTail");
  81. }
  82. [Fact(Skip = "TODO: Fix the failing tests.")]
  83. [Trait(Category.RunType, Category.LiveOnly)]
  84. [Trait(Category.Service, Category.Websites)]
  85. [Trait(Category.Environment, Category.WAPack)]
  86. public void TestGetAzureWebsiteLogTailPath()
  87. {
  88. RunPowerShellTest("Test-GetAzureWebsiteLogTailPath");
  89. }
  90. [Fact(Skip = "TODO: Fix the failing tests.")]
  91. [Trait(Category.RunType, Category.LiveOnly)]
  92. [Trait(Category.Service, Category.Websites)]
  93. [Trait(Category.Environment, Category.WAPack)]
  94. public void TestGetAzureWebsiteLogTailUriEncoding()
  95. {
  96. RunPowerShellTest("Test-GetAzureWebsiteLogTailUriEncoding");
  97. }
  98. [Fact(Skip = "TODO: Fix the failing tests.")]
  99. [Trait(Category.RunType, Category.LiveOnly)]
  100. [Trait(Category.Service, Category.Websites)]
  101. [Trait(Category.Environment, Category.WAPack)]
  102. public void TestGetAzureWebsiteLogListPath()
  103. {
  104. RunPowerShellTest("Test-GetAzureWebsiteLogListPath");
  105. }
  106. #endregion Get-AzureWebsiteLog Scenario Tests
  107. #region Get-AzureWebsite Scenario Tests
  108. [Fact]
  109. [Trait(Category.RunType, Category.LiveOnly)]
  110. [Trait(Category.AcceptanceType, Category.BVT)]
  111. [Trait(Category.Service, Category.Websites)]
  112. [Trait(Category.Environment, Category.WAPack)]
  113. public void TestGetAzureWebsite()
  114. {
  115. RunPowerShellTest("Run-WebsiteTest {Test-GetAzureWebsite} 'TestGetAzureWebsite'");
  116. }
  117. [Fact]
  118. [Trait(Category.RunType, Category.LiveOnly)]
  119. [Trait(Category.AcceptanceType, Category.BVT)]
  120. [Trait(Category.Service, Category.Websites)]
  121. [Trait(Category.Environment, Category.WAPack)]
  122. public void TestGetAzureWebsiteWithStoppedSite()
  123. {
  124. RunPowerShellTest("Run-WebsiteTest {Test-GetAzureWebsiteWithStoppedSite} 'TestGetAzureWebsiteWithStoppedSite'");
  125. }
  126. #endregion Get-AzureWebsite Scenario Tests
  127. #region Start-AzureWebsite Scenario Tests
  128. [Fact]
  129. [Trait(Category.RunType, Category.LiveOnly)]
  130. [Trait(Category.AcceptanceType, Category.BVT)]
  131. [Trait(Category.Service, Category.Websites)]
  132. [Trait(Category.Environment, Category.WAPack)]
  133. public void TestStartAzureWebsite()
  134. {
  135. RunPowerShellTest("Run-WebsiteTest {Test-StartAzureWebsite} 'TestStartAzureWebsite'");
  136. }
  137. #endregion Start-AzureWebsite Scenario Tests
  138. #region Stop-AzureWebsite Scenario Tests
  139. [Fact]
  140. [Trait(Category.RunType, Category.LiveOnly)]
  141. [Trait(Category.AcceptanceType, Category.BVT)]
  142. [Trait(Category.Service, Category.Websites)]
  143. [Trait(Category.Environment, Category.WAPack)]
  144. public void TestStopAzureWebsite()
  145. {
  146. RunPowerShellTest("Run-WebsiteTest {Test-StopAzureWebsite} 'TestStopAzureWebsite'");
  147. }
  148. #endregion Stop-AzureWebsite Scenario Tests
  149. #region Restart-AzureWebsite Scenario Tests
  150. [Fact]
  151. [Trait(Category.RunType, Category.LiveOnly)]
  152. [Trait(Category.AcceptanceType, Category.BVT)]
  153. [Trait(Category.Service, Category.Websites)]
  154. [Trait(Category.Environment, Category.WAPack)]
  155. public void TestRestartAzureWebsite()
  156. {
  157. RunPowerShellTest("Run-WebsiteTest {Test-RestartAzureWebsite} 'TestRestartAzureWebsite'");
  158. }
  159. #endregion Restart-AzureWebsite Scenario Tests
  160. #region Enable-AzureWebsiteApplicationDiagnostic Scenario Tests
  161. [Fact]
  162. [Trait(Category.RunType, Category.LiveOnly)]
  163. [Trait(Category.AcceptanceType, Category.BVT)]
  164. [Trait(Category.Service, Category.Websites)]
  165. public void TestEnableApplicationDiagnosticOnTableStorage()
  166. {
  167. RunPowerShellTest("Run-WebsiteTest {Test-EnableApplicationDiagnosticOnTableStorage} 'TestEnableApplicationDiagnosticOnTableStorage'");
  168. }
  169. [Fact]
  170. [Trait(Category.RunType, Category.LiveOnly)]
  171. [Trait(Category.AcceptanceType, Category.BVT)]
  172. [Trait(Category.Service, Category.Websites)]
  173. public void TestEnableApplicationDiagnosticOnBlobStorage()
  174. {
  175. RunPowerShellTest("Run-WebsiteTest {Test-EnableApplicationDiagnosticOnBlobStorage} 'TestEnableApplicationDiagnosticOnBlobStorage'");
  176. }
  177. [Fact]
  178. [Trait(Category.RunType, Category.LiveOnly)]
  179. [Trait(Category.Service, Category.Websites)]
  180. [Trait(Category.AcceptanceType, Category.BVT)]
  181. [Trait(Category.Environment, Category.WAPack)]
  182. public void TestEnableApplicationDiagnosticOnFileSystem()
  183. {
  184. RunPowerShellTest("Run-WebsiteTest {Test-EnableApplicationDiagnosticOnFileSystem} 'TestEnableApplicationDiagnosticOnFileSystem'");
  185. }
  186. [Fact]
  187. [Trait(Category.RunType, Category.LiveOnly)]
  188. [Trait(Category.AcceptanceType, Category.BVT)]
  189. [Trait(Category.Service, Category.Websites)]
  190. [Trait(Category.Environment, Category.WAPack)]
  191. public void TestUpdateTheDiagnositicLogLevel()
  192. {
  193. RunPowerShellTest("Run-WebsiteTest {Test-UpdateTheDiagnositicLogLevel} 'TestUpdateTheDiagnositicLogLevel'");
  194. }
  195. [Fact]
  196. [Trait(Category.RunType, Category.LiveOnly)]
  197. [Trait(Category.AcceptanceType, Category.BVT)]
  198. [Trait(Category.Service, Category.Websites)]
  199. public void TestReconfigureStorageAppDiagnostics()
  200. {
  201. RunPowerShellTest("Run-WebsiteTest {Test-ReconfigureStorageAppDiagnostics} 'TestReconfigureStorageAppDiagnostics'");
  202. }
  203. [Fact]
  204. [Trait(Category.RunType, Category.LiveOnly)]
  205. [Trait(Category.AcceptanceType, Category.BVT)]
  206. [Trait(Category.Service, Category.Websites)]
  207. public void TestThrowsForInvalidStorageAccountName()
  208. {
  209. RunPowerShellTest("Run-WebsiteTest {Test-ThrowsForInvalidStorageAccountName} 'TestThrowsForInvalidStorageAccountName'");
  210. }
  211. #endregion Enable-AzureWebsiteApplicationDiagnostic Scenario Tests
  212. #region Disable-AzureWebsiteApplicationDiagnostic Scenario Tests
  213. [Fact]
  214. [Trait(Category.RunType, Category.LiveOnly)]
  215. [Trait(Category.AcceptanceType, Category.BVT)]
  216. [Trait(Category.Service, Category.Websites)]
  217. public void TestDisableApplicationDiagnosticOnTableStorage()
  218. {
  219. RunPowerShellTest("Run-WebsiteTest {Test-DisableApplicationDiagnosticOnTableStorage} 'TestDisableApplicationDiagnosticOnTableStorage'");
  220. }
  221. [Fact]
  222. [Trait(Category.RunType, Category.LiveOnly)]
  223. [Trait(Category.AcceptanceType, Category.BVT)]
  224. [Trait(Category.Service, Category.Websites)]
  225. [Trait(Category.Environment, Category.WAPack)]
  226. public void TestDisableApplicationDiagnosticOnFileSystem()
  227. {
  228. RunPowerShellTest("Run-WebsiteTest {Test-DisableApplicationDiagnosticOnFileSystem} 'TestDisableApplicationDiagnosticOnFileSystem'");
  229. }
  230. [Fact]
  231. [Trait(Category.RunType, Category.LiveOnly)]
  232. [Trait(Category.AcceptanceType, Category.BVT)]
  233. [Trait(Category.Service, Category.Websites)]
  234. public void TestDisableApplicationDiagnosticOnTableStorageAndFile()
  235. {
  236. RunPowerShellTest("Run-WebsiteTest {Test-DisableApplicationDiagnosticOnTableStorageAndFile} 'TestDisableApplicationDiagnosticOnTableStorageAndFile'");
  237. }
  238. [Fact]
  239. [Trait(Category.RunType, Category.LiveOnly)]
  240. [Trait(Category.AcceptanceType, Category.BVT)]
  241. [Trait(Category.Service, Category.Websites)]
  242. public void TestDisablesFileOnly()
  243. {
  244. RunPowerShellTest("Run-WebsiteTest {Test-DisablesFileOnly} 'TestDisablesFileOnly'");
  245. }
  246. [Fact]
  247. [Trait(Category.RunType, Category.LiveOnly)]
  248. [Trait(Category.AcceptanceType, Category.BVT)]
  249. [Trait(Category.Service, Category.Websites)]
  250. public void TestDisablesStorageOnly()
  251. {
  252. RunPowerShellTest("Run-WebsiteTest {Test-DisablesStorageOnly} 'TestDisablesStorageOnly'");
  253. }
  254. [Fact]
  255. [Trait(Category.RunType, Category.LiveOnly)]
  256. [Trait(Category.AcceptanceType, Category.BVT)]
  257. [Trait(Category.Service, Category.Websites)]
  258. public void TestDisablesBothByDefault()
  259. {
  260. RunPowerShellTest("Run-WebsiteTest {Test-DisablesBothByDefault} 'TestDisablesBothByDefault'");
  261. }
  262. #endregion Disable-AzureWebsiteApplicationDiagnostic Scenario Tests
  263. #region Get-AzureWebsiteLocation Scenario Tests
  264. [Fact]
  265. [Trait(Category.RunType, Category.LiveOnly)]
  266. [Trait(Category.AcceptanceType, Category.BVT)]
  267. [Trait(Category.Service, Category.Websites)]
  268. [Trait(Category.Environment, Category.WAPack)]
  269. public void TestGetAzureWebsiteLocation()
  270. {
  271. RunPowerShellTest("Run-WebsiteTest {Test-GetAzureWebsiteLocation} 'TestGetAzureWebsiteLocation'");
  272. }
  273. [Fact]
  274. [Trait(Category.RunType, Category.LiveOnly)]
  275. [Trait(Category.AcceptanceType, Category.BVT)]
  276. [Trait(Category.Service, Category.Websites)]
  277. [Trait(Category.Environment, Category.WAPack)]
  278. public void TestKuduAppsExpressApp()
  279. {
  280. RunPowerShellTest("Run-WebsiteTest {Test-KuduAppsExpressApp} 'TestKuduAppsExpressApp'");
  281. }
  282. [Fact]
  283. [Trait(Category.RunType, Category.LiveOnly)]
  284. [Trait(Category.AcceptanceType, Category.BVT)]
  285. [Trait(Category.Service, Category.Websites)]
  286. [Trait(Category.Environment, Category.WAPack)]
  287. public void TestGetAzureWebSiteListNone()
  288. {
  289. RunPowerShellTest("Run-WebsiteTest {Test-GetAzureWebSiteListNone} 'TestGetAzureWebSiteListNone'");
  290. }
  291. [Fact]
  292. [Trait(Category.RunType, Category.LiveOnly)]
  293. [Trait(Category.AcceptanceType, Category.BVT)]
  294. [Trait(Category.Service, Category.Websites)]
  295. [Trait(Category.Environment, Category.WAPack)]
  296. public void TestAzureWebSiteListAll()
  297. {
  298. RunPowerShellTest("Run-WebsiteTest {Test-AzureWebSiteListAll} 'TestAzureWebSiteListAll'");
  299. }
  300. [Fact]
  301. [Trait(Category.RunType, Category.LiveOnly)]
  302. [Trait(Category.AcceptanceType, Category.BVT)]
  303. [Trait(Category.Service, Category.Websites)]
  304. [Trait(Category.Environment, Category.WAPack)]
  305. public void TestAzureWebSiteShowSingleSite()
  306. {
  307. RunPowerShellTest("Run-WebsiteTest {Test-AzureWebSiteShowSingleSite} 'TestAzureWebSiteShowSingleSite'");
  308. }
  309. #endregion Get-AzureWebsiteLocation Scenario Tests
  310. #region AzureWebSiteGitHubAllParms Scenario Tests
  311. [Fact]
  312. [Trait(Category.RunType, Category.LiveOnly)]
  313. [Trait(Category.AcceptanceType, Category.BVT)]
  314. [Trait(Category.Service, Category.Websites)]
  315. [Trait(Category.Environment, Category.WAPack)]
  316. public void TestNewAzureWebSiteMultipleCreds()
  317. {
  318. RunPowerShellTest("Run-WebsiteTest {Test-NewAzureWebSiteMultipleCreds} 'TestNewAzureWebSiteMultipleCreds'");
  319. }
  320. [Fact(Skip = "TODO: Fix failing test.")]
  321. [Trait(Category.RunType, Category.LiveOnly)]
  322. [Trait(Category.Service, Category.Websites)]
  323. [Trait(Category.Environment, Category.WAPack)]
  324. public void TestNewAzureWebSiteGitHubAllParms()
  325. {
  326. RunPowerShellTest("Test-NewAzureWebSiteGitHubAllParms");
  327. }
  328. [Fact]
  329. [Trait(Category.RunType, Category.LiveOnly)]
  330. [Trait(Category.AcceptanceType, Category.BVT)]
  331. [Trait(Category.Service, Category.Websites)]
  332. [Trait(Category.Environment, Category.WAPack)]
  333. public void TestNewAzureWebSiteUpdateGit()
  334. {
  335. RunPowerShellTest("Run-WebsiteTest {Test-NewAzureWebSiteUpdateGit} 'TestNewAzureWebSiteUpdateGit'");
  336. }
  337. #endregion AzureWebSiteGitHubAllParms Scenario Tests
  338. #region Set-AzureWebSite Scenario Tests
  339. [Fact]
  340. [Trait(Category.RunType, Category.LiveOnly)]
  341. [Trait(Category.AcceptanceType, Category.BVT)]
  342. [Trait(Category.Service, Category.Websites)]
  343. [Trait(Category.Environment, Category.WAPack)]
  344. public void TestSetAzureWebsite()
  345. {
  346. RunPowerShellTest("Run-WebsiteTest {Test-SetAzureWebsite} 'TestSetAzureWebsite'");
  347. }
  348. #endregion Set-AzureWebSite Scenario Tests
  349. #region WebJob Scenario Tests
  350. [Fact]
  351. [Trait(Category.RunType, Category.LiveOnly)]
  352. [Trait(Category.AcceptanceType, Category.BVT)]
  353. [Trait(Category.Service, Category.Websites)]
  354. public void TestRemoveAzureWebsiteTriggeredJob()
  355. {
  356. RunPowerShellTest("Run-WebsiteTest {Test-RemoveAzureWebsiteTriggeredJob} 'TestRemoveAzureWebsiteTriggeredJob'");
  357. }
  358. [Fact(Skip = "TODO: Fix failing test.")]
  359. [Trait(Category.RunType, Category.LiveOnly)]
  360. [Trait(Category.AcceptanceType, Category.BVT)]
  361. [Trait(Category.Service, Category.Websites)]
  362. public void TestRemoveAzureWebsiteContinuousJob()
  363. {
  364. RunPowerShellTest("Run-WebsiteTest {Test-RemoveAzureWebsiteContinuousJob} 'TestRemoveAzureWebsiteContinuousJob'");
  365. }
  366. [Fact]
  367. [Trait(Category.RunType, Category.LiveOnly)]
  368. [Trait(Category.AcceptanceType, Category.BVT)]
  369. [Trait(Category.Service, Category.Websites)]
  370. public void TestRemoveNonExistingAzureWebsiteJob()
  371. {
  372. RunPowerShellTest("Run-WebsiteTest {Test-RemoveNonExistingAzureWebsiteJob} 'TestRemoveNonExistingAzureWebsiteJob'");
  373. }
  374. [Fact]
  375. [Trait(Category.RunType, Category.LiveOnly)]
  376. [Trait(Category.AcceptanceType, Category.BVT)]
  377. [Trait(Category.Service, Category.Websites)]
  378. public void TestStartAzureWebsiteTriggeredJob()
  379. {
  380. RunPowerShellTest("Run-WebsiteTest {Test-StartAzureWebsiteTriggeredJob} 'TestStartAzureWebsiteTriggeredJob'");
  381. }
  382. [Fact]
  383. [Trait(Category.RunType, Category.LiveOnly)]
  384. [Trait(Category.AcceptanceType, Category.BVT)]
  385. [Trait(Category.Service, Category.Websites)]
  386. public void TestStartAndStopAzureWebsiteContinuousJob()
  387. {
  388. RunPowerShellTest("Run-WebsiteTest {Test-StartAndStopAzureWebsiteContinuousJob} 'TestStartAndStopAzureWebsiteContinuousJob'");
  389. }
  390. [Fact]
  391. [Trait(Category.RunType, Category.LiveOnly)]
  392. [Trait(Category.AcceptanceType, Category.BVT)]
  393. [Trait(Category.Service, Category.Websites)]
  394. public void GettingWebsiteJobs()
  395. {
  396. RunPowerShellTest("Run-WebsiteTest {Test-GettingWebsiteJobs} 'GettingWebsiteJobs'");
  397. }
  398. [Fact]
  399. [Trait(Category.RunType, Category.LiveOnly)]
  400. [Trait(Category.AcceptanceType, Category.BVT)]
  401. [Trait(Category.Service, Category.Websites)]
  402. public void TestGetsJobHistory()
  403. {
  404. RunPowerShellTest("Run-WebsiteTest {Test-GettingJobHistory} 'TestGetsJobHistory'");
  405. }
  406. #endregion WebJob Scenario Tests
  407. }
  408. }