document FreeBSD support

improve some tests cleanup
This commit is contained in:
Nicola Murino 2020-07-10 19:20:37 +02:00
parent 8fddb742df
commit da0f470f1c
5 changed files with 9 additions and 4 deletions

View file

@ -46,7 +46,7 @@ Fully featured and highly configurable SFTP server, written in Go
## Platforms ## Platforms
SFTPGo is developed and tested on Linux. After each commit, the code is automatically built and tested on Linux, macOS and Windows using a [GitHub Action](./.github/workflows/development.yml). Other UNIX variants such as \*BSD should work too. SFTPGo is developed and tested on Linux. After each commit, the code is automatically built and tested on Linux, macOS and Windows using a [GitHub Action](./.github/workflows/development.yml). The test cases are regularly manually executed and passed on FreeBSD. Other *BSD variants should work too.
## Requirements ## Requirements

View file

@ -25,7 +25,7 @@ in the "man" directory under the current directory.
logger.DisableLogger() logger.DisableLogger()
logger.EnableConsoleLogger(zerolog.DebugLevel) logger.EnableConsoleLogger(zerolog.DebugLevel)
if _, err := os.Stat(manDir); os.IsNotExist(err) { if _, err := os.Stat(manDir); os.IsNotExist(err) {
err = os.Mkdir(manDir, os.ModePerm) err = os.MkdirAll(manDir, os.ModePerm)
if err != nil { if err != nil {
logger.WarnToConsole("Unable to generate man page files: %v", err) logger.WarnToConsole("Unable to generate man page files: %v", err)
os.Exit(1) os.Exit(1)

View file

@ -2026,6 +2026,8 @@ func TestStartFolderQuotaScanMock(t *testing.T) {
checkResponseCode(t, http.StatusOK, rr.Code) checkResponseCode(t, http.StatusOK, rr.Code)
err = os.RemoveAll(folderPath) err = os.RemoveAll(folderPath)
assert.NoError(t, err) assert.NoError(t, err)
err = os.RemoveAll(mappedPath)
assert.NoError(t, err)
} }
func TestStartQuotaScanNonExistentUserMock(t *testing.T) { func TestStartQuotaScanNonExistentUserMock(t *testing.T) {

View file

@ -2139,6 +2139,8 @@ func TestRenamePermission(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
err = conn.checkRecursiveRenameDirPermissions(dir3, dir6) err = conn.checkRecursiveRenameDirPermissions(dir3, dir6)
assert.NoError(t, err) assert.NoError(t, err)
err = os.RemoveAll(dir3)
assert.NoError(t, err)
} }
func TestRecursiveCopyErrors(t *testing.T) { func TestRecursiveCopyErrors(t *testing.T) {

View file

@ -4119,8 +4119,9 @@ func TestOpenError(t *testing.T) {
err = os.Chmod(filepath.Join(user.GetHomeDir(), "test"), 0000) err = os.Chmod(filepath.Join(user.GetHomeDir(), "test"), 0000)
assert.NoError(t, err) assert.NoError(t, err)
err = client.Rename(testFileName, path.Join("test", testFileName)) err = client.Rename(testFileName, path.Join("test", testFileName))
assert.Error(t, err) if assert.Error(t, err) {
assert.Contains(t, err.Error(), sftp.ErrSSHFxPermissionDenied.Error()) assert.Contains(t, err.Error(), sftp.ErrSSHFxPermissionDenied.Error())
}
err = os.Chmod(filepath.Join(user.GetHomeDir(), "test"), 0755) err = os.Chmod(filepath.Join(user.GetHomeDir(), "test"), 0755)
assert.NoError(t, err) assert.NoError(t, err)
err = os.Remove(localDownloadPath) err = os.Remove(localDownloadPath)