File tree Expand file tree Collapse file tree
resources/sshdconfig/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,5 +212,23 @@ PasswordAuthentication yes
212212
213213 Remove-Item - Path $stderrFile - Force - ErrorAction SilentlyContinue
214214 }
215+
216+ It ' Should default to _exist=true when not specified explicitly' {
217+ $inputConfig = @ {
218+ _metadata = @ {
219+ filepath = $TestConfigPath
220+ }
221+ subsystem = @ {
222+ name = " testExistDefault"
223+ value = " /path/to/subsystem"
224+ }
225+ } | ConvertTo-Json
226+
227+ $output = sshdconfig set -- input $inputConfig - s sshd- config- repeat 2> $null
228+ $LASTEXITCODE | Should - Be 0
229+ # verify subsystem was added (defaulting to _exist=true)
230+ $subsystems = Get-Content $TestConfigPath | Where-Object { $_ -match ' ^\s*subsystem\s+' }
231+ $subsystems | Should - Contain " subsystem testExistDefault /path/to/subsystem"
232+ }
215233 }
216234}
You can’t perform that action at this time.
0 commit comments