Pester tests updated to reflect changes in 7.8

This commit is contained in:
Manoj Ampalam 2018-10-05 16:11:58 -07:00
parent 68719a25df
commit f7ea7ca04c
2 changed files with 3 additions and 17 deletions

View File

@ -133,7 +133,7 @@ Describe "Tests for host keys file permission" -Tags "CI" {
WaitForValidation -LogPath $logPath -Length 1100
#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)" {
@ -146,22 +146,8 @@ Describe "Tests for host keys file permission" -Tags "CI" {
WaitForValidation -LogPath $logPath -Length 1100
#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"
}
}
}

View File

@ -314,7 +314,7 @@ Describe "E2E scenarios for ssh key management" -Tags "CI" {
$o[1] | Should Be $entry
$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.count | Should Be 3