internal_unix_test.go 328 B

1234567891011121314151617
  1. // +build !windows
  2. package sftpd
  3. import (
  4. "os/exec"
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. )
  8. func TestWrapCmd(t *testing.T) {
  9. cmd := exec.Command("ls")
  10. cmd = wrapCmd(cmd, 1000, 1001)
  11. assert.Equal(t, uint32(1000), cmd.SysProcAttr.Credential.Uid)
  12. assert.Equal(t, uint32(1001), cmd.SysProcAttr.Credential.Gid)
  13. }