diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 20:12:05 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 20:15:58 +0900 |
| commit | 24de7c50a0ea7000c3a49c56b91db9aa72abdd28 (patch) | |
| tree | aa43fa13b27a88ec153a7b83550c45c7fd1db76e /internal/app/app_test.go | |
| parent | f6dd9dab6a91c8c39ea2a5afbca50e427e6a21ba (diff) | |
internal/app: relocate state initialisation
This is useful for testing.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/app_test.go')
| -rw-r--r-- | internal/app/app_test.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/internal/app/app_test.go b/internal/app/app_test.go index 96b36707..5edc9b80 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -450,15 +450,7 @@ func TestApp(t *testing.T) { var gotSys *system.I { - sPriv := outcomeState{ - ID: &tc.id, - Identity: tc.config.Identity, - UserID: (&Hsu{k: tc.k}).MustIDMsg(msg), - EnvPaths: copyPaths(tc.k), - Container: tc.config.Container, - } - - sPriv.populateEarly(tc.k, msg) + sPriv := newOutcomeState(tc.k, msg, &tc.id, tc.config, &Hsu{k: tc.k}) if err := sPriv.populateLocal(tc.k, msg); err != nil { t.Fatalf("populateLocal: error = %#v", err) } @@ -574,6 +566,7 @@ type stubNixOS struct { func (k *stubNixOS) new(func(k syscallDispatcher)) { panic("not implemented") } +func (k *stubNixOS) getpid() int { return 0xdeadbeef } func (k *stubNixOS) getuid() int { return 1971 } func (k *stubNixOS) getgid() int { return 100 } |
