sftpd: add Readlink support

This commit is contained in:
Nicola Murino
2020-08-22 14:52:17 +02:00
parent 5208e4a4ca
commit 02e35ee002
16 changed files with 183 additions and 38 deletions

View File

@@ -229,6 +229,17 @@ func TestReadWriteErrors(t *testing.T) {
assert.NoError(t, err)
}
func TestUnsupportedListOP(t *testing.T) {
fs := vfs.NewOsFs("", os.TempDir(), nil)
conn := common.NewBaseConnection("", common.ProtocolSFTP, dataprovider.User{}, fs)
sftpConn := Connection{
BaseConnection: conn,
}
request := sftp.NewRequest("Unsupported", "")
_, err := sftpConn.Filelist(request)
assert.EqualError(t, err, sftp.ErrSSHFxOpUnsupported.Error())
}
func TestTransferCancelFn(t *testing.T) {
testfile := "testfile"
file, err := os.Create(testfile)