Skip to content

Commit be4abd4

Browse files
committed
fix tests
1 parent 44836f2 commit be4abd4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

dsc/tests/dsc_extension_secret.tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,12 @@ Describe 'Tests for the secret() function and extensions' {
144144
type: Microsoft.DSC.Debug/Echo
145145
properties:
146146
output: "[parameters('myString')]"
147+
showSecrets: true
147148
'@
148149
$out = dsc -l trace config get -i $configYaml 2> $TestDrive/error.log | ConvertFrom-Json
149150
$LASTEXITCODE | Should -Be 0
150151
$out.results.Count | Should -Be 1
151-
$out.results[0].result.actualState.Output | Should -BeExactly 'Hello'
152+
$out.results[0].result.actualState.Output.secureString | Should -BeExactly 'Hello'
152153
}
153154

154155
It 'Allows to pass in secret() through variables' {

dsc/tests/dsc_parameters.tests.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,18 @@ Describe 'Parameters tests' {
274274
$out.results[0].result.inDesiredState | Should -BeTrue
275275
}
276276

277-
It 'secure types can be passed as objects to resources' {
277+
It 'secure types can be passed as objects to resources but redacted in output' {
278278
$out = dsc config -f $PSScriptRoot/../examples/secure_parameters.parameters.yaml get -f $PSScriptRoot/../examples/secure_parameters.dsc.yaml | ConvertFrom-Json
279279
$LASTEXITCODE | Should -Be 0
280-
$out.results[0].result.actualState.output | Should -BeExactly 'mySecret'
281-
$out.results[1].result.actualState.output | Should -BeExactly 'mySecretProperty'
280+
$out.results[0].result.actualState.output | Should -BeExactly '<secureValue>'
281+
$out.results[1].result.actualState.output | Should -BeExactly '<secureValue>'
282+
}
283+
284+
It 'secure types can be passed as objects to resources' {
285+
$out = dsc config -f $PSScriptRoot/../examples/secure_parameters_shown.parameters.yaml get -f $PSScriptRoot/../examples/secure_parameters.dsc.yaml | ConvertFrom-Json
286+
$LASTEXITCODE | Should -Be 0
287+
$out.results[0].result.actualState.output.secureString | Should -BeExactly 'mySecret'
288+
$out.results[1].result.actualState.output.secureString | Should -BeExactly 'mySecretProperty'
282289
}
283290

284291
It 'parameter types are validated for <type>' -TestCases @(

0 commit comments

Comments
 (0)