8d3381821f
internal/app/state: export correct backend value
...
This references the underlying multiBackend due to a typo, making the whole dance with c a noop.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-25 21:11:05 +09:00
e9d00b9071
container/executable: handle nil msg
...
This is useful in some tests.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-25 21:08:54 +09:00
4f41afee0f
internal/app/state: fixed size et-only header
...
This header improves the robustness of the format and significantly reduces cleanup overhead.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-25 19:15:06 +09:00
7de593e816
cmd/hakurei: short identifier from lower half
...
The upper half is now a nanosecond timestamp. Lower half is still random bytes, so use lower half for short identifier.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-24 00:47:39 +09:00
2442eda8d9
hst/instance: embed config struct
...
This makes the resulting json easier to parse since it can now be deserialised into the config struct.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-24 00:42:16 +09:00
05488bfb8f
hst/instance: store priv side pid
...
This can receive signals, so is more useful to the caller.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 23:19:55 +09:00
dd94818f20
hst/instance: define instance state
...
This is now part of the hst API. This change also improves identifier generation and serialisation.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 22:59:02 +09:00
0fd357e7f6
container/init: do not suspend output
...
Init is not very talkative after process start even when verbose. Suspending output here is pointless and does more harm than good.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 08:11:00 +09:00
57231d4acf
container/init: improve signal handling
...
The SIGTERM signal is delivered in many other cases and can lead to strange behaviour. The unconditional resume of the logger also causes strange behaviour in the cancellation forwarding path. This change also passes through additional signals.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 08:02:03 +09:00
c5aefe5e9d
internal/app/shim: check behaviour
...
This does not yet have full coverage. Test cases covering failsafe paths and error injection will be added eventually.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 06:07:41 +09:00
0f8ffee44d
internal/app: test case for hst template
...
This helps with other areas of the test suite as they're all based on hst.Template. This also helps contributors understand the behaviour of internal/app as hst.Template covers almost every aspect of it.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 04:46:58 +09:00
1685a4d000
cmd/hsu: reduce excessive test range
...
This is quite a simple piece of code, this many test cases is excessive and wastes time in the integration vm.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-23 04:32:32 +09:00
6c338b433a
internal/app: reduce test case indentation
...
This improves readability on narrower displays.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-22 07:40:32 +09:00
8accd3b219
internal/app/shim: use syscall dispatcher
...
This enables instrumented testing of the shim.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-22 06:58:45 +09:00
c5f59c5488
container/syscall: export prctl wrapper
...
This is useful as package "syscall" does not provide such a wrapper. This change also improves error handling to fully conform to the manpage.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-22 05:26:54 +09:00
fcd9becf9a
cmd/hsu: run in locked thread
...
Goroutine scheduling is not helpful in the setuid wrapper, it is not particularly harmful but lock here anyway.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-22 05:09:08 +09:00
622f945c22
container/init: check msg in entrypoint
...
This covers invalid call to Init.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-22 04:20:08 +09:00
e94acc424c
container/comp: rename from bits
...
This package will also hold syscall lookup tables for seccomp.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 20:54:03 +09:00
b1a4d801be
hst/container: flags string representation
...
This is useful for a user-facing representation other than JSON. This also gets rid of the ugly, outdated flags string builder in cmd/hakurei.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 20:29:52 +09:00
56beae17fe
test: assert hst CGO_ENABLED=0
...
The hst package only deals with data serialisation, however since many parts of hakurei make use of C libraries in some way it can be easy to inadvertently depend on cgo.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 19:49:04 +09:00
ea978101b1
cmd/hakurei/parse: close config fd
...
This is cleaner than relying on the finalizer.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 06:05:36 +09:00
fbd1638e7f
test/interactive/trace: update nix attribute
...
Updated according to evaluation warning.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 06:03:09 +09:00
d42067df7c
cmd/hakurei/json: friendly error messages
...
This change handles errors returned by encoding/json and prints significantly cleaner messages.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 05:17:25 +09:00
b9459a80c7
container/init: check use constants for open flags
...
These bits are arch-specific.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 03:13:58 +09:00
f8189d1488
container/syscall: dot-import syscall
...
This avoids having arch-specific constants for arm64.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 03:09:14 +09:00
5063b774c1
hst: expose version string
...
The hst API is tied to this version string.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 01:56:44 +09:00
766dd89ffa
internal: clean up build strings
...
These names are less ambiguous and should be understandable without reading the source code.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-21 01:49:36 +09:00
699c19e972
hst/container: optional runtime and tmpdir sharing
...
Sharing and persisting these directories do not always make sense. Make it optional here.
Closes #16 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 04:11:38 +09:00
b5b30aea2e
test: place marker in common path
...
This discontinues the dependency on shared tmpdir and xdg_runtime_dir implementation detail, for #16 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 03:50:48 +09:00
c0e860000a
internal/app: remove spfinal
...
This no longer needs to be an independent outcomeOp since spFilesystemOp is moved late.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 02:58:46 +09:00
d87020f0ca
hst/config: validate env early
...
This should happen in hst since it requires no system state.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 02:39:49 +09:00
e47aebb7a0
internal/app/outcome: apply configured filesystems late
...
This enables configured filesystems to cover system mount points.
Closes #8 .
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 01:41:52 +09:00
543bf69102
internal/app/spx11: check behaviour
...
This outcomeOp will likely never change.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 01:00:12 +09:00
4cfb1fda8f
internal/app/spwayland: check behaviour
...
This op is quite clean. Might get slightly more complex at some point passing socket fd.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-19 00:30:56 +09:00
c12183959a
internal/app/dispatcher: report correct field
...
This was mistakenly reporting sharePath on inequivalence causing very confusing output.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 23:59:10 +09:00
f5845e312e
internal/app/sptmpdir: check behaviour
...
Another simple one. This will change when shared tmpdir and xdg runtime dir becomes optional.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 23:46:10 +09:00
a103c4a7c7
internal/app/hsu: check behaviour
...
The stub exec.ExitError is hairy as usual, but internal/app is not cross-platform, so this is okay.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 20:45:42 +09:00
67ec82ae1b
ldd/exec: raise timeout
...
This mostly helps with tests.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 18:03:09 +09:00
f6f0cb56ae
internal/app/hsu: remove wrapper method
...
This was added to reduce the size of diffs.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 17:35:20 +09:00
d4284c109d
internal/app/spruntime: emulate pam_systemd type
...
This sets XDG_SESSION_TYPE to the corresponding values specified in pam_systemd(8) according to enablements.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 04:33:04 +09:00
030ad2a73b
internal/app/spruntime: check behaviour
...
This one is quite simple and has no state. Needs to emulate pam_systemd behaviour so that will change.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 03:41:49 +09:00
78d7955abd
internal/app/sppulse: check cookie discovery
...
There's quite a bit of code duplication here, but since this is already quite simple it is best to leave it as is for now.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 01:30:33 +09:00
b066495a7d
internal/app/sppulse: check buf error injection
...
The loadFile behaviour does not guarantee the buffer to be zeroed or not clobbered if an error is returned, but for the current implementation it is good to check.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-18 01:01:52 +09:00
82299d34c6
internal/app/sppulse: correctly handle small cookie
...
The trailing zero bytes need to be sliced off, so send cookie size alongside buffer content.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-17 08:03:03 +09:00
792013cefb
internal/app/sppulse: check behaviour
...
Still needs to check the relocated functions separately.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-17 06:32:21 +09:00
3f39132935
internal/app/dispatcher: reduce check code duplication
...
This also improves readability of test cases.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-17 05:47:12 +09:00
c922c3f80e
internal/app/sppulse: relocate hard to test code
...
These are better tested separately instead of creating many op test cases.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-16 05:47:49 +09:00
6cf58ca1b3
internal/app/spfinal: check behaviour
...
This will be merged with spFilesystemOp eventually.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-16 02:08:31 +09:00
425421d9b1
hst/container: rename constants
...
The shim is an implementation detail and should not be mentioned in the API.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-16 00:27:00 +09:00
5e0f15d76b
hst/container: additional shim exit codes
...
These are now considered stable, defined behaviour and can be used by external programs to determine shim outcome.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-10-15 22:09:33 +09:00