aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/testsuite/testsuite.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-11-03 18:02:34 +0900
committerOphestra <cat@gensokyo.uk>2026-11-03 18:02:34 +0900
commit0e81817076f4fc8c0e746441bb714fec8db6a211 (patch)
tree1c7fad48726aaf38b1261a728819cd10d3147b23 /internal/testsuite/testsuite.go
parenta492d751367ddf12d4e679f84ce600c6dbeda0dd (diff)
internal/testsuite: stub user account lookups
Rosa OS does not have the concept of unix user accounts. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/testsuite/testsuite.go')
-rw-r--r--internal/testsuite/testsuite.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go
index 395bf8f2..fc9c3dfb 100644
--- a/internal/testsuite/testsuite.go
+++ b/internal/testsuite/testsuite.go
@@ -17,7 +17,6 @@ import (
"os"
"os/exec"
"os/signal"
- "os/user"
"path/filepath"
"reflect"
"runtime"
@@ -48,33 +47,6 @@ func ReceiveSignals() {
log.Fatalf("terminating on signal %s", <-s)
}
-var (
- // users caches [user.LookupId] calls.
- users = make(map[string]*user.User)
- // usersMu synchronises access to users.
- usersMu sync.RWMutex
-)
-
-// mustLookupId is like [user.LookupId], but the first result is cached.
-func mustLookupId(uid string) *user.User {
- usersMu.RLock()
- v, ok := users[uid]
- usersMu.RUnlock()
- if ok {
- return v
- }
-
- u, err := user.LookupId(uid)
- if err != nil {
- log.Fatal(err)
- }
-
- usersMu.Lock()
- users[uid] = u
- usersMu.Unlock()
- return u
-}
-
// MustAppendEnv adds extra environment variables to cmd.
func MustAppendEnv(cmd *exec.Cmd, env ...string) {
if len(cmd.Env) == 0 {