mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
add more linters
test cases migration to testify is now complete. Linters are enabled for test cases too
This commit is contained in:
@@ -5,15 +5,13 @@ package sftpd
|
||||
import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestWrapCmd(t *testing.T) {
|
||||
cmd := exec.Command("ls")
|
||||
cmd = wrapCmd(cmd, 1000, 1001)
|
||||
if cmd.SysProcAttr.Credential.Uid != 1000 {
|
||||
t.Errorf("unexpected uid")
|
||||
}
|
||||
if cmd.SysProcAttr.Credential.Gid != 1001 {
|
||||
t.Errorf("unexpected gid")
|
||||
}
|
||||
assert.Equal(t, uint32(1000), cmd.SysProcAttr.Credential.Uid)
|
||||
assert.Equal(t, uint32(1001), cmd.SysProcAttr.Credential.Gid)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user