mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
add portable mode
Portable mode is a convenient way to share a single directory on demand
This commit is contained in:
@@ -97,3 +97,24 @@ func TestInvalidUploadMode(t *testing.T) {
|
||||
}
|
||||
os.Remove(configFilePath)
|
||||
}
|
||||
|
||||
func TestSetGetConfig(t *testing.T) {
|
||||
sftpdConf := config.GetSFTPDConfig()
|
||||
sftpdConf.IdleTimeout = 3
|
||||
config.SetSFTPDConfig(sftpdConf)
|
||||
if config.GetSFTPDConfig().IdleTimeout != sftpdConf.IdleTimeout {
|
||||
t.Errorf("set sftpd conf failed")
|
||||
}
|
||||
dataProviderConf := config.GetProviderConf()
|
||||
dataProviderConf.Host = "test host"
|
||||
config.SetProviderConf(dataProviderConf)
|
||||
if config.GetProviderConf().Host != dataProviderConf.Host {
|
||||
t.Errorf("set data provider conf failed")
|
||||
}
|
||||
httpdConf := config.GetHTTPDConfig()
|
||||
httpdConf.BindAddress = "0.0.0.0"
|
||||
config.SetHTTPDConfig(httpdConf)
|
||||
if config.GetHTTPDConfig().BindAddress != httpdConf.BindAddress {
|
||||
t.Errorf("set httpd conf failed")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user