added generic user lookup and foreground processes

This commit is contained in:
ston1th 2017-04-19 23:20:52 +02:00
commit 1e230617ce
7 changed files with 134 additions and 50 deletions

25
lookup_test.go Normal file
View 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)
}
}