@@ -15,15 +15,121 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzFrontDoorCdnOrigin'))
15
15
}
16
16
17
17
Describe ' Get-AzFrontDoorCdnOrigin' {
18
- It ' List' - skip {
19
- { throw [System.NotImplementedException ] } | Should -Not - Throw
18
+ It ' List' {
19
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
20
+ try
21
+ {
22
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
23
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
24
+
25
+ $frontDoorCdnProfileName = ' fdp-' + (RandomString - allChars $false - len 6 );
26
+ Write-Host - ForegroundColor Green " Use frontDoorCdnProfileName : $ ( $frontDoorCdnProfileName ) "
27
+
28
+ $profileSku = " Standard_AzureFrontDoor" ;
29
+ New-AzFrontDoorCdnProfile - SkuName $profileSku - Name $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
30
+
31
+ $originGroupName = ' org' + (RandomString - allChars $false - len 6 );
32
+ New-AzFrontDoorCdnOriginGroup - OriginGroupName $originGroupName - ProfileName $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName `
33
+ - LoadBalancingSettingSampleSize 5 `
34
+ - LoadBalancingSettingSuccessfulSamplesRequired 4 `
35
+ - LoadBalancingSettingAdditionalLatencyInMillisecond 200 `
36
+ - HealthProbeSettingProbeIntervalInSecond 1 `
37
+ - HealthProbeSettingProbePath " /" `
38
+ - HealthProbeSettingProbeProtocol $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProbeProtocol ]::Https) `
39
+ - HealthProbeSettingProbeRequestType $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.HealthProbeRequestType ]::Get) `
40
+
41
+ Get-AzFrontDoorCdnOriginGroup - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName
42
+
43
+ $hostName = " en.wikipedia.org" ;
44
+ $originName = ' ori' + (RandomString - allChars $false - len 6 );
45
+ New-AzFrontDoorCdnOrigin - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName `
46
+ - OriginName $originName - OriginHostHeader $hostName - HostName $hostName `
47
+ - HttpPort 80 - HttpsPort 443 - Priority 1 - Weight 1000
48
+
49
+ $origins = Get-AzFrontDoorCdnOrigin - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName
50
+ $origins.Count | Should - Be 1
51
+ } Finally
52
+ {
53
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
54
+ }
20
55
}
21
56
22
- It ' Get' - skip {
23
- { throw [System.NotImplementedException ] } | Should -Not - Throw
57
+ It ' Get' {
58
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
59
+ try
60
+ {
61
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
62
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
63
+
64
+ $frontDoorCdnProfileName = ' fdp-' + (RandomString - allChars $false - len 6 );
65
+ Write-Host - ForegroundColor Green " Use frontDoorCdnProfileName : $ ( $frontDoorCdnProfileName ) "
66
+
67
+ $profileSku = " Standard_AzureFrontDoor" ;
68
+ New-AzFrontDoorCdnProfile - SkuName $profileSku - Name $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
69
+
70
+ $originGroupName = ' org' + (RandomString - allChars $false - len 6 );
71
+ New-AzFrontDoorCdnOriginGroup - OriginGroupName $originGroupName - ProfileName $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName `
72
+ - LoadBalancingSettingSampleSize 5 `
73
+ - LoadBalancingSettingSuccessfulSamplesRequired 4 `
74
+ - LoadBalancingSettingAdditionalLatencyInMillisecond 200 `
75
+ - HealthProbeSettingProbeIntervalInSecond 1 `
76
+ - HealthProbeSettingProbePath " /" `
77
+ - HealthProbeSettingProbeProtocol $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProbeProtocol ]::Https) `
78
+ - HealthProbeSettingProbeRequestType $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.HealthProbeRequestType ]::Get) `
79
+
80
+ Get-AzFrontDoorCdnOriginGroup - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName
81
+
82
+ $hostName = " en.wikipedia.org" ;
83
+ $originName = ' ori' + (RandomString - allChars $false - len 6 );
84
+ New-AzFrontDoorCdnOrigin - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName `
85
+ - OriginName $originName - OriginHostHeader $hostName - HostName $hostName `
86
+ - HttpPort 80 - HttpsPort 443 - Priority 1 - Weight 1000
87
+
88
+ $origin = Get-AzFrontDoorCdnOrigin - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName - OriginName $originName
89
+ $origin.Name | Should - Be $originName
90
+ } Finally
91
+ {
92
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
93
+ }
24
94
}
25
95
26
96
It ' GetViaIdentity' - skip {
27
- { throw [System.NotImplementedException ] } | Should -Not - Throw
97
+ $PSDefaultParameterValues [' Disabled' ] = $true
98
+ $ResourceGroupName = ' testps-rg-' + (RandomString - allChars $false - len 6 )
99
+ try
100
+ {
101
+ Write-Host - ForegroundColor Green " Create test group $ ( $ResourceGroupName ) "
102
+ New-AzResourceGroup - Name $ResourceGroupName - Location $env.location
103
+
104
+ $frontDoorCdnProfileName = ' fdp-' + (RandomString - allChars $false - len 6 );
105
+ Write-Host - ForegroundColor Green " Use frontDoorCdnProfileName : $ ( $frontDoorCdnProfileName ) "
106
+
107
+ $profileSku = " Standard_AzureFrontDoor" ;
108
+ New-AzFrontDoorCdnProfile - SkuName $profileSku - Name $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName - Location Global
109
+
110
+ $originGroupName = ' org' + (RandomString - allChars $false - len 6 );
111
+ New-AzFrontDoorCdnOriginGroup - OriginGroupName $originGroupName - ProfileName $frontDoorCdnProfileName - ResourceGroupName $ResourceGroupName `
112
+ - LoadBalancingSettingSampleSize 5 `
113
+ - LoadBalancingSettingSuccessfulSamplesRequired 4 `
114
+ - LoadBalancingSettingAdditionalLatencyInMillisecond 200 `
115
+ - HealthProbeSettingProbeIntervalInSecond 1 `
116
+ - HealthProbeSettingProbePath " /" `
117
+ - HealthProbeSettingProbeProtocol $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProbeProtocol ]::Https) `
118
+ - HealthProbeSettingProbeRequestType $ ([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.HealthProbeRequestType ]::Get) `
119
+
120
+ Get-AzFrontDoorCdnOriginGroup - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName
121
+
122
+ $hostName = " en.wikipedia.org" ;
123
+ $originName = ' ori' + (RandomString - allChars $false - len 6 );
124
+ New-AzFrontDoorCdnOrigin - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName `
125
+ - OriginName $originName - OriginHostHeader $hostName - HostName $hostName `
126
+ - HttpPort 80 - HttpsPort 443 - Priority 1 - Weight 1000
127
+
128
+ $origin = Get-AzFrontDoorCdnOrigin - ResourceGroupName $ResourceGroupName - ProfileName $frontDoorCdnProfileName - OriginGroupName $originGroupName - OriginName $originName | Get-AzFrontDoorCdnOrigin
129
+ $origin.Name | Should - Be $originName
130
+ } Finally
131
+ {
132
+ Remove-AzResourceGroup - Name $ResourceGroupName - NoWait
133
+ }
28
134
}
29
135
}
0 commit comments