diff options
Diffstat (limited to 'test/internal/testsuite')
| -rw-r--r-- | test/internal/testsuite/testsuite.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/internal/testsuite/testsuite.go b/test/internal/testsuite/testsuite.go index 4b70da34..9233818d 100644 --- a/test/internal/testsuite/testsuite.go +++ b/test/internal/testsuite/testsuite.go @@ -6,6 +6,7 @@ import ( "os" "os/exec" "os/signal" + "os/user" "syscall" ) @@ -25,6 +26,16 @@ func ReceiveSignals() { log.Fatalf("terminating on signal %s", <-s) } +// GetUser returns the [user.User] structure describing the user with uid 1000. +func GetUser() *user.User { + if u, err := user.LookupId("1000"); err != nil { + log.Fatal(err) + return nil + } else { + return u + } +} + // MustRun runs command and terminates the testsuite on error. func MustRun(command ...string) { cmd := exec.Command(command[0], command[1:]...) |
