added generic user lookup and foreground processes
This commit is contained in:
parent
4b88a07ef5
commit
1e230617ce
7 changed files with 134 additions and 50 deletions
25
lookup_test.go
Normal file
25
lookup_test.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2017 Marius Schellenberger
|
||||
|
||||
package godrop
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestUserID(t *testing.T) {
|
||||
uid, err := userID("root")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if uid != 0 {
|
||||
t.Error("expected uid '0' got", uid)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGroupID(t *testing.T) {
|
||||
gid, err := groupID("root")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if gid != 0 {
|
||||
t.Error("expected gid '0' got", gid)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue