sftpgo-mirror/sftpd/internal_unix_test.go

20 lines
317 B
Go
Raw Normal View History

// +build !windows
package sftpd
import (
"os/exec"
"testing"
)
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")
}
}