mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
add remote address to transfer and commands logs
This commit is contained in:
@@ -513,7 +513,7 @@ func TestClientVersion(t *testing.T) {
|
||||
connID := fmt.Sprintf("2_%v", mockCC.ID())
|
||||
user := dataprovider.User{}
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
common.Connections.Add(connection)
|
||||
@@ -530,7 +530,7 @@ func TestDriverMethodsNotImplemented(t *testing.T) {
|
||||
connID := fmt.Sprintf("2_%v", mockCC.ID())
|
||||
user := dataprovider.User{}
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
_, err := connection.Create("")
|
||||
@@ -555,7 +555,7 @@ func TestResolvePathErrors(t *testing.T) {
|
||||
mockCC := mockFTPClientContext{}
|
||||
connID := fmt.Sprintf("%v", mockCC.ID())
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
err := connection.Mkdir("", os.ModePerm)
|
||||
@@ -618,7 +618,7 @@ func TestUploadFileStatError(t *testing.T) {
|
||||
connID := fmt.Sprintf("%v", mockCC.ID())
|
||||
fs := vfs.NewOsFs(connID, user.HomeDir, "")
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
testFile := filepath.Join(user.HomeDir, "test", "testfile")
|
||||
@@ -646,7 +646,7 @@ func TestAVBLErrors(t *testing.T) {
|
||||
mockCC := mockFTPClientContext{}
|
||||
connID := fmt.Sprintf("%v", mockCC.ID())
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
_, err := connection.GetAvailableSpace("/")
|
||||
@@ -667,7 +667,7 @@ func TestUploadOverwriteErrors(t *testing.T) {
|
||||
connID := fmt.Sprintf("%v", mockCC.ID())
|
||||
fs := newMockOsFs(nil, nil, false, connID, user.GetHomeDir())
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
flags := 0
|
||||
@@ -721,7 +721,7 @@ func TestTransferErrors(t *testing.T) {
|
||||
connID := fmt.Sprintf("%v", mockCC.ID())
|
||||
fs := newMockOsFs(nil, nil, false, connID, user.GetHomeDir())
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, user),
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolFTP, "", user),
|
||||
clientContext: mockCC,
|
||||
}
|
||||
baseTransfer := common.NewBaseTransfer(file, connection.BaseConnection, nil, file.Name(), file.Name(), testfile,
|
||||
|
||||
Reference in New Issue
Block a user