mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
Pester tests updated to reflect changes in 7.8
This commit is contained in:
parent
68719a25df
commit
f7ea7ca04c
@ -133,7 +133,7 @@ Describe "Tests for host keys file permission" -Tags "CI" {
|
|||||||
WaitForValidation -LogPath $logPath -Length 1100
|
WaitForValidation -LogPath $logPath -Length 1100
|
||||||
|
|
||||||
#validate file content contains unprotected info.
|
#validate file content contains unprotected info.
|
||||||
$logPath | Should Contain "key_load_private: bad permissions"
|
$logPath | Should Contain "bad permissions"
|
||||||
}
|
}
|
||||||
|
|
||||||
It "$tC.$tI-Host keys-negative (the private key has wrong owner)" {
|
It "$tC.$tI-Host keys-negative (the private key has wrong owner)" {
|
||||||
@ -146,22 +146,8 @@ Describe "Tests for host keys file permission" -Tags "CI" {
|
|||||||
WaitForValidation -LogPath $logPath -Length 1100
|
WaitForValidation -LogPath $logPath -Length 1100
|
||||||
|
|
||||||
#validate file content contains unprotected info.
|
#validate file content contains unprotected info.
|
||||||
$logPath | Should Contain "key_load_private: bad permissions"
|
$logPath | Should Contain "bad permissions"
|
||||||
}
|
}
|
||||||
|
|
||||||
#skip on win7 because Set-Acl failed due to issue on win7 when user does not have write permission on the file
|
|
||||||
It "$tC.$tI-Host keys-negative (the running process does not have read access to public key)" -skip:$skip {
|
|
||||||
#setup to have ssouser as owner and grant it full control
|
|
||||||
Repair-FilePermission -Filepath $hostKeyFilePath -Owners $systemSid -FullAccessNeeded $systemSid,$adminsSid -confirm:$false
|
|
||||||
Repair-FilePermission -Filepath "$hostKeyFilePath.pub" -Owners $systemSid -FullAccessNeeded $systemSid -confirm:$false
|
|
||||||
Set-FilePermission -Filepath "$hostKeyFilePath.pub" -UserSid $adminsSid -Action Delete
|
|
||||||
|
|
||||||
#Run
|
|
||||||
Start-Process -FilePath sshd.exe -WorkingDirectory $($OpenSSHTestInfo['OpenSSHBinPath']) -ArgumentList @("-d", "-p $port", "-h $hostKeyFilePath", "-E $logPath") -NoNewWindow
|
|
||||||
WaitForValidation -LogPath $logPath -Length 1100
|
|
||||||
|
|
||||||
#validate file content contains unprotected info.
|
|
||||||
$logPath | Should Contain "key_load_public: Permission denied"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" {
|
|||||||
$o[1] | Should Be $entry
|
$o[1] | Should Be $entry
|
||||||
|
|
||||||
$o = ssh-keygen -H -F [localhost]:47002 -f $kh
|
$o = ssh-keygen -H -F [localhost]:47002 -f $kh
|
||||||
$o.StartsWith("|1|") | Should Be $true
|
$o[1].StartsWith("|1|") | Should Be $true
|
||||||
|
|
||||||
$o = ssh-keygen -R [localhost]:47002 -f $kh
|
$o = ssh-keygen -R [localhost]:47002 -f $kh
|
||||||
$o.count | Should Be 3
|
$o.count | Should Be 3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user