Enabled SFTP E2E tests based on test framework changes (#101)
This commit is contained in:
parent
0d1b232d3b
commit
589f2db723
|
@ -140,7 +140,12 @@ WARNING: Following changes will be made to OpenSSH configuration
|
|||
}
|
||||
|
||||
Install-OpenSSHTestDependencies
|
||||
|
||||
|
||||
if(-not (Test-path $TestDataPath -PathType Container))
|
||||
{
|
||||
New-Item -ItemType Directory -Path $TestDataPath -Force -ErrorAction SilentlyContinue | out-null
|
||||
}
|
||||
|
||||
#Backup existing OpenSSH configuration
|
||||
$backupConfigPath = Join-Path $script:OpenSSHBinPath sshd_config.ori
|
||||
if (-not (Test-Path $backupConfigPath -PathType Leaf)) {
|
||||
|
|
|
@ -27,6 +27,14 @@ Run-OpenSSHUnitTest
|
|||
C:\git\openssh-portable\regress\pesterTests\SCP.Tests.ps1
|
||||
C:\git\openssh-portable\bin\x64\Release\unittest-bitmap\unittest-bitmap.exe
|
||||
```
|
||||
|
||||
#### To verify / modify (Ex- DebugMode) the Test setup environment
|
||||
|
||||
```powershell
|
||||
$OpenSSHTestInfo
|
||||
$OpenSSHTestInfo["DebugMode"] = $true
|
||||
```
|
||||
|
||||
#### To revert what's done in Setup-OpenSSHTestEnvironment:
|
||||
|
||||
```powershell
|
||||
|
|
|
@ -96,14 +96,11 @@ Describe "Tests for scp command" -Tags "CI" {
|
|||
}
|
||||
)
|
||||
|
||||
# for the first time, delete the existing log files.
|
||||
if ($OpenSSHTestInfo['DebugMode'])
|
||||
{
|
||||
Stop-Service ssh-agent -Force
|
||||
Start-Sleep 2
|
||||
# Fix this - pick up logs from ssh installation dir, not test directory
|
||||
Remove-Item "$($OpenSSHTestInfo['OpenSSHDir'])\logs\ssh-agent.log" -Force -ErrorAction ignore
|
||||
Remove-Item "$($OpenSSHTestInfo['OpenSSHDir'])\logs\sshd.log" -Force -ErrorAction ignore
|
||||
Start-Service sshd
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent.log" -Force -ErrorAction ignore
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd.log" -Force -ErrorAction ignore
|
||||
}
|
||||
|
||||
function CheckTarget {
|
||||
|
@ -112,9 +109,14 @@ Describe "Tests for scp command" -Tags "CI" {
|
|||
{
|
||||
if( $OpenSSHTestInfo["DebugMode"])
|
||||
{
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHDir'])\logs\ssh-agent.log" "$($OpenSSHTestInfo['OpenSSHDir'])\logs\failedagent$script:logNum.log" -Force
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHDir'])\logs\sshd.log" "$($OpenSSHTestInfo['OpenSSHDir'])\logs\failedsshd$script:logNum.log" -Force
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent.log" "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\failedagent$script:logNum.log" -Force
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd.log" "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\failedsshd$script:logNum.log" -Force
|
||||
|
||||
$script:logNum++
|
||||
|
||||
# clear the ssh-agent, sshd logs so that next testcase will get fresh logs.
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent.log" -Force -ErrorAction ignore
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd.log" -Force -ErrorAction ignore
|
||||
}
|
||||
|
||||
return $false
|
||||
|
|
|
@ -1,46 +1,55 @@
|
|||
Describe "SFTP Testcases" -Tags "Scenario" {
|
||||
Describe "SFTP Test Cases" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$rootDirectory = $TestDrive
|
||||
if($OpenSSHTestInfo -eq $null)
|
||||
{
|
||||
Throw "`$OpenSSHTestInfo is null. Please run Setup-OpenSSHTestEnvironment to setup test environment."
|
||||
}
|
||||
|
||||
if(-not (Test-Path $OpenSSHTestInfo["TestDataPath"]))
|
||||
{
|
||||
$null = New-Item $OpenSSHTestInfo["TestDataPath"] -ItemType directory -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$rootDirectory = "$($OpenSSHTestInfo["TestDataPath"])\SFTP"
|
||||
|
||||
$outputFileName = "output.txt"
|
||||
$batchFileName = "sftp-batchcmds.txt"
|
||||
$outputFilePath = Join-Path $rootDirectory $outputFileName
|
||||
$batchFilePath = Join-Path $rootDirectory $batchFileName
|
||||
|
||||
|
||||
$tempFileName = "tempFile.txt"
|
||||
$tempFilePath = Join-Path $rootDirectory $tempFileName
|
||||
|
||||
|
||||
$tempUnicodeFileName = "tempFile_язык.txt"
|
||||
$tempUnicodeFilePath = Join-Path $rootDirectory $tempUnicodeFileName
|
||||
|
||||
|
||||
$clientDirectory = Join-Path $rootDirectory 'client_dir'
|
||||
$serverDirectory = Join-Path $rootDirectory 'server_dir'
|
||||
|
||||
|
||||
$null = New-Item $clientDirectory -ItemType directory -Force
|
||||
$null = New-Item $serverDirectory -ItemType directory -Force
|
||||
$null = New-Item $batchFilePath -ItemType file -Force
|
||||
$null = New-Item $outputFilePath -ItemType file -Force
|
||||
$null = New-Item $tempFilePath -ItemType file -Force -value "temp file data"
|
||||
$null = New-Item $tempUnicodeFilePath -ItemType file -Force -value "temp file data"
|
||||
|
||||
$expectedOutputDelimiter = "#DL$"
|
||||
|
||||
[Machine] $client = [Machine]::new([MachineRole]::Client)
|
||||
[Machine] $server = [Machine]::new([MachineRole]::Server)
|
||||
|
||||
|
||||
$server = $OpenSSHTestInfo["Target"]
|
||||
$port = $OpenSSHTestInfo["Port"]
|
||||
$ssouser = $OpenSSHTestInfo["SSOUser"]
|
||||
$script:testId = 1
|
||||
|
||||
$testData1 = @(
|
||||
@{
|
||||
title = "put, ls for non-unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "put $tempFilePath $serverDirectory
|
||||
ls $serverDirectory"
|
||||
expectedoutput = (join-path $serverdirectory $tempFileName)
|
||||
|
||||
},
|
||||
@{
|
||||
title = "get, ls for non-unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "get $tempFilePath $clientDirectory
|
||||
ls $clientDirectory"
|
||||
|
@ -48,7 +57,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "mput, ls for non-unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "mput $tempFilePath $serverDirectory
|
||||
ls $serverDirectory"
|
||||
|
@ -56,7 +65,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "mget, ls for non-unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "mget $tempFilePath $clientDirectory
|
||||
ls $clientDirectory"
|
||||
|
@ -64,7 +73,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "mkdir, cd, pwd for non-unicode directory names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "cd $serverdirectory
|
||||
mkdir server_test_dir
|
||||
|
@ -74,7 +83,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
Title = "lmkdir, lcd, lpwd for non-unicode directory names"
|
||||
LogonStr = "$($server.ssouser)@$($server.MachineName)"
|
||||
LogonStr = "$($ssouser)@$($server)"
|
||||
Options = ''
|
||||
Commands = "lcd $clientDirectory
|
||||
lmkdir client_test_dir
|
||||
|
@ -84,7 +93,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "put, ls for unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "put $tempUnicodeFilePath $serverDirectory
|
||||
ls $serverDirectory"
|
||||
|
@ -92,7 +101,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "get, ls for unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "get $tempUnicodeFilePath $clientDirectory
|
||||
ls $clientDirectory"
|
||||
|
@ -100,7 +109,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "mput, ls for unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "mput $tempUnicodeFilePath $serverDirectory
|
||||
ls $serverDirectory"
|
||||
|
@ -108,7 +117,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "mget, ls for unicode file names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "mget $tempUnicodeFilePath $clientDirectory
|
||||
ls $clientDirectory"
|
||||
|
@ -116,7 +125,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "mkdir, cd, pwd for unicode directory names"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = ''
|
||||
commands = "cd $serverdirectory
|
||||
mkdir server_test_dir_язык
|
||||
|
@ -126,7 +135,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
Title = "lmkdir, lcd, lpwd for unicode directory names"
|
||||
LogonStr = "$($server.ssouser)@$($server.MachineName)"
|
||||
LogonStr = "$($ssouser)@$($server)"
|
||||
Options = ''
|
||||
Commands = "lcd $clientDirectory
|
||||
lmkdir client_test_dir_язык
|
||||
|
@ -140,8 +149,8 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
$testData2 = @(
|
||||
@{
|
||||
title = "rm, rmdir, rename for unicode file, directory"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
options = 'b $batchFilePath'
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = '-b $batchFilePath'
|
||||
|
||||
tmpFileName1 = $tempUnicodeFileName
|
||||
tmpFilePath1 = $tempUnicodeFilePath
|
||||
|
@ -155,7 +164,7 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
},
|
||||
@{
|
||||
title = "rm, rmdir, rename for non-unicode file, directory"
|
||||
logonstr = "$($server.ssouser)@$($server.machinename)"
|
||||
logonstr = "$($ssouser)@$($server)"
|
||||
options = '-b $batchFilePath'
|
||||
|
||||
tmpFileName1 = $tempFileName
|
||||
|
@ -169,89 +178,110 @@ Describe "SFTP Testcases" -Tags "Scenario" {
|
|||
tmpDirectoryPath2 = (join-path $serverDirectory "test_dir_2")
|
||||
}
|
||||
)
|
||||
|
||||
# for the first time, delete the existing log files.
|
||||
if ($OpenSSHTestInfo['DebugMode'])
|
||||
{
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent.log" -Force -ErrorAction ignore
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd.log" -Force -ErrorAction ignore
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sftp-server.log" -Force -ErrorAction ignore
|
||||
}
|
||||
|
||||
function CopyDebugLogs {
|
||||
if($OpenSSHTestInfo["DebugMode"])
|
||||
{
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent.log" "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent_$script:testId.log" -Force
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd.log" "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd_$script:testId.log" -Force
|
||||
Copy-Item "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sftp-server.log" "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sftp-server_$script:testId.log" -Force
|
||||
|
||||
$script:testId++
|
||||
|
||||
# clear the ssh-agent, sshd logs so that next testcase will get fresh logs.
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\ssh-agent.log" -Force -ErrorAction ignore
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sshd.log" -Force -ErrorAction ignore
|
||||
Clear-Content "$($OpenSSHTestInfo['OpenSSHBinPath'])\logs\sftp-server.log" -Force -ErrorAction ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
}
|
||||
|
||||
Context "SFTP Test Cases" {
|
||||
BeforeAll {
|
||||
}
|
||||
AfterAll {
|
||||
if(!$OpenSSHTestInfo["DebugMode"])
|
||||
{
|
||||
Get-Item $rootDirectory | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
Get-ChildItem $serverDirectory | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Get-ChildItem $clientDirectory | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item $batchFilePath
|
||||
Remove-Item $outputFilePath
|
||||
}
|
||||
|
||||
It '<Title>' -TestCases:$testData1 {
|
||||
param([string]$Title, $LogonStr, $Options, $Commands, $ExpectedOutput, $SkipVerification = $false)
|
||||
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $Commands
|
||||
Write-Host "sftp -P 47002 $($Options) -b $batchFilePath $($LogonStr) > $outputFilePath"
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P 47002 $($Options) -b $batchFilePath $($LogonStr) > $outputFilePath")
|
||||
$client.RunCmd($str)
|
||||
BeforeEach {
|
||||
Get-ChildItem $serverDirectory | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Get-ChildItem $clientDirectory | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item $batchFilePath
|
||||
Remove-Item $outputFilePath
|
||||
}
|
||||
|
||||
#validate file content.
|
||||
$($ExpectedOutput).split($expectedOutputDelimiter) | foreach {
|
||||
Test-Path ($_) | Should be $true
|
||||
}
|
||||
}
|
||||
|
||||
It '<Title>' -TestCases:$testData2 {
|
||||
param([string]$Title, $LogonStr, $Options, $tmpFileName1, $tmpFilePath1, $tmpFileName2, $tmpFilePath2, $tmpDirectoryName1, $tmpDirectoryPath1, $tmpDirectoryName2, $tmpDirectoryPath2, $SkipVerification = $false)
|
||||
|
||||
#rm (remove file)
|
||||
$commands = "mkdir $tmpDirectoryPath1
|
||||
put $tmpFilePath1 $tmpDirectoryPath1
|
||||
ls $tmpDirectoryPath1"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P 47002 $($Options) $($LogonStr) > $outputFilePath")
|
||||
$client.RunCmd($str)
|
||||
Test-Path (join-path $tmpDirectoryPath1 $tmpFileName1) | Should be $true
|
||||
|
||||
$commands = "rm $tmpDirectoryPath1\*
|
||||
ls $tmpDirectoryPath1
|
||||
pwd
|
||||
"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P 47002 $($Options) $($LogonStr) > $outputFilePath")
|
||||
$client.RunCmd($str)
|
||||
Test-Path (join-path $tmpDirectoryPath1 $tmpFileName1) | Should be $false
|
||||
|
||||
#rename file
|
||||
Remove-Item $outputFilePath
|
||||
Copy-Item $tmpFilePath1 -destination $tmpDirectoryPath1
|
||||
$commands = "rename $tmpDirectoryPath1\$tmpFileName1 $tmpDirectoryPath1\$tmpFileName2
|
||||
ls $tmpDirectoryPath1
|
||||
pwd"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P 47002 $($Options) $($LogonStr) > $outputFilePath")
|
||||
$client.RunCmd($str)
|
||||
Test-Path (join-path $tmpDirectoryPath1 $tmpFileName2) | Should be $true
|
||||
|
||||
#rename directory
|
||||
Remove-Item $outputFilePath
|
||||
$commands = "rm $tmpDirectoryPath1\*
|
||||
rename $tmpDirectoryPath1 $tmpDirectoryPath2
|
||||
ls $serverDirectory"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P 47002 $($Options) $($LogonStr) > $outputFilePath")
|
||||
$client.RunCmd($str)
|
||||
Test-Path $tmpDirectoryPath2 | Should be $true
|
||||
|
||||
#rmdir (remove directory)
|
||||
Remove-Item $outputFilePath
|
||||
$commands = "rmdir $tmpDirectoryPath2
|
||||
ls $serverDirectory"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P 47002 $($Options) $($LogonStr) > $outputFilePath")
|
||||
$client.RunCmd($str)
|
||||
Test-Path $tmpDirectoryPath2 | Should be $false
|
||||
}
|
||||
AfterEach {
|
||||
CopyDebugLogs
|
||||
}
|
||||
|
||||
It '<Title>' -TestCases:$testData1 {
|
||||
param([string]$Title, $LogonStr, $Options, $Commands, $ExpectedOutput)
|
||||
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $Commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P $port $($Options) -b $batchFilePath $($LogonStr) > $outputFilePath")
|
||||
iex $str
|
||||
|
||||
#validate file content.
|
||||
Test-Path $ExpectedOutput | Should be $true
|
||||
}
|
||||
|
||||
It '<Title>' -TestCases:$testData2 {
|
||||
param([string]$Title, $LogonStr, $Options, $tmpFileName1, $tmpFilePath1, $tmpFileName2, $tmpFilePath2, $tmpDirectoryName1, $tmpDirectoryPath1, $tmpDirectoryName2, $tmpDirectoryPath2)
|
||||
|
||||
#rm (remove file)
|
||||
$commands = "mkdir $tmpDirectoryPath1
|
||||
put $tmpFilePath1 $tmpDirectoryPath1
|
||||
ls $tmpDirectoryPath1"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P $port $($Options) $($LogonStr) > $outputFilePath")
|
||||
iex $str
|
||||
Test-Path (join-path $tmpDirectoryPath1 $tmpFileName1) | Should be $true
|
||||
|
||||
$commands = "rm $tmpDirectoryPath1\*
|
||||
ls $tmpDirectoryPath1
|
||||
pwd
|
||||
"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P $port $($Options) $($LogonStr) > $outputFilePath")
|
||||
iex $str
|
||||
Test-Path (join-path $tmpDirectoryPath1 $tmpFileName1) | Should be $false
|
||||
|
||||
#rename file
|
||||
Remove-Item $outputFilePath
|
||||
Copy-Item $tmpFilePath1 -destination $tmpDirectoryPath1
|
||||
$commands = "rename $tmpDirectoryPath1\$tmpFileName1 $tmpDirectoryPath1\$tmpFileName2
|
||||
ls $tmpDirectoryPath1
|
||||
pwd"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P $port $($Options) $($LogonStr) > $outputFilePath")
|
||||
iex $str
|
||||
Test-Path (join-path $tmpDirectoryPath1 $tmpFileName2) | Should be $true
|
||||
|
||||
#rename directory
|
||||
Remove-Item $outputFilePath
|
||||
$commands = "rm $tmpDirectoryPath1\*
|
||||
rename $tmpDirectoryPath1 $tmpDirectoryPath2
|
||||
ls $serverDirectory"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P $port $($Options) $($LogonStr) > $outputFilePath")
|
||||
iex $str
|
||||
Test-Path $tmpDirectoryPath2 | Should be $true
|
||||
|
||||
#rmdir (remove directory)
|
||||
Remove-Item $outputFilePath
|
||||
$commands = "rmdir $tmpDirectoryPath2
|
||||
ls $serverDirectory"
|
||||
Set-Content $batchFilePath -Encoding UTF8 -value $commands
|
||||
$str = $ExecutionContext.InvokeCommand.ExpandString("sftp -P $port $($Options) $($LogonStr) > $outputFilePath")
|
||||
iex $str
|
||||
Test-Path $tmpDirectoryPath2 | Should be $false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ AuthorizedKeysFile .ssh/authorized_keys
|
|||
#Banner none
|
||||
|
||||
# override default of no subsystems
|
||||
Subsystem sftp sftp-server.exe
|
||||
Subsystem sftp sftp-server.exe -l DEBUG3
|
||||
|
||||
# Example of overriding settings on a per-user basis
|
||||
#Match User anoncvs
|
||||
|
|
Loading…
Reference in New Issue