File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed
src/ServiceManagement/Common/Commands.ScenarioTest
Resources/ServiceManagement Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 231
231
<None Include =" Resources\ServiceManagement\Files\dSMSTest.cspkg" >
232
232
<CopyToOutputDirectory >Always</CopyToOutputDirectory >
233
233
</None >
234
- <None Include =" Resources\ServiceManagement\Files\example.pfx" >
235
- <CopyToOutputDirectory >Always</CopyToOutputDirectory >
236
- </None >
237
234
<None Include =" Resources\SqlIaaSExtension\SqlIaaSExtensionTests.ps1" >
238
235
<CopyToOutputDirectory >Always</CopyToOutputDirectory >
239
236
</None >
Original file line number Diff line number Diff line change 16
16
<Setting name =" DummySetting" value =" Foo" />
17
17
</ConfigurationSettings >
18
18
<Certificates >
19
- <Certificate name =" ThumbprintCert" thumbprint =" 6CAE49B8166D5ADA04EDA09616CEDC88A091289E " thumbprintAlgorithm =" sha1" />
19
+ <Certificate name =" ThumbprintCert" thumbprint =" {{PLACEHOLDER}} " thumbprintAlgorithm =" sha1" />
20
20
<Certificate name =" dSMSCert" sourceLocation =" /genevacustomers/monitoring/prod/warmpath/test/auxweb/certificates/chained/portaldogfoodmdscert.pfx" />
21
21
</Certificates >
22
22
</Role >
Original file line number Diff line number Diff line change @@ -320,18 +320,23 @@ function Run-DSMSHostedServiceTest
320
320
}
321
321
$cscfg = " $TestOutputRoot \Resources\ServiceManagement\Files\dSMSTest.cscfg" ;
322
322
$cscfgChanged = " $TestOutputRoot \Resources\ServiceManagement\Files\dSMSTest-changed.cscfg" ;
323
- $certFile = " $TestOutputRoot \Resources\ServiceManagement\Files\example.pfx" ;
323
+
324
+ # Create a temporary self-signed cert
325
+ $cert = New-SelfSignedCertificate - DnsName " example.local" - CertStoreLocation " Cert:\CurrentUser\My" ;
326
+ $certPath = " Cert:\CurrentUser\My\$ ( $cert.Thumbprint ) "
327
+ # Update the cscfg to use the new cert
328
+ (Get-Content $cscfg ) | ForEach-Object {$_ -replace " \{\{PLACEHOLDER\}\}" , $cert.Thumbprint } | Set-Content $cscfgChanged ;
324
329
325
330
try
326
331
{
327
332
# Create Hosted Service
328
333
$result = New-AzureService - ServiceName $svcName - Location $location - Label $svcName - Description $svcName ;
329
334
330
335
# Upload the certificate
331
- Add-AzureCertificate - ServiceName $svcName - CertToDeploy $certFile - Password " pass@word1* " ;
336
+ Add-AzureCertificate - ServiceName $svcName - CertToDeploy $cert ;
332
337
333
338
# Deploy to staging
334
- $result = New-AzureDeployment - ServiceName $svcName - Package $cspkg - Configuration $cscfg - Label $svcName - Slot Staging;
339
+ $result = New-AzureDeployment - ServiceName $svcName - Package $cspkg - Configuration $cscfgChanged - Label $svcName - Slot Staging;
335
340
336
341
# Get Deployment
337
342
$deploy = Get-AzureDeployment - ServiceName $svcName - Slot Staging;
@@ -352,6 +357,10 @@ function Run-DSMSHostedServiceTest
352
357
{
353
358
Remove-Item $cscfgChanged ;
354
359
}
360
+ if (Test-Path $certPath )
361
+ {
362
+ Remove-Item $certPath
363
+ }
355
364
}
356
365
}
357
366
You can’t perform that action at this time.
0 commit comments