mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-26 01:20:29 +00:00
20 lines
317 B
Go
20 lines
317 B
Go
|
// +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")
|
||
|
}
|
||
|
}
|