mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-24 16:40:26 +00:00
18 lines
348 B
Go
18 lines
348 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
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)
|
|
assert.Equal(t, uint32(1000), cmd.SysProcAttr.Credential.Uid)
|
|
assert.Equal(t, uint32(1001), cmd.SysProcAttr.Credential.Gid)
|
|
}
|