aboutsummaryrefslogtreecommitdiffhomepage
path: root/container
AgeCommit message (Collapse)Author
2025-10-13container/initplace: remove indirect methodOphestra
This is no longer useful and is highly error-prone. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-11hst: rename /.hakurei constantOphestra
This provides disambiguation from fhs.AbsTmp. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-10container/stub: mark test overrides as helperOphestra
This fixes line information in test reporting messages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-09container/init: unwrap descriptive fatal errorOphestra
These errors are printed with a descriptive message prefixed to them, so it is more readable to expose the underlying errno. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-09message: relocate from containerOphestra
This package is quite useful. This change allows it to be imported without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container/check: relocate overlay escapeOphestra
This is used in hst to format strings. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container/bits: move bind bitsOphestra
This allows referring to the bits without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container/fhs: move pathname constantsOphestra
This allows referencing FHS pathnames without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container/check: move absolute pathnameOphestra
This allows use of absolute pathname values without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-07container: move seccomp preset bitsOphestra
This allows holding the bits without cgo. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-29container: remove global msgOphestra
This frees all container instances of side effects. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-28container/init: reduce verbose noiseOphestra
This makes it possible to optionally omit the identifying verbose message, for when the Op implementation can provide a much more useful message in its case, using information not yet available to the String method. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-27container/output: move global output to msgOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-27container/output: export suspendable writerOphestra
This is quite useful for other packages as well. This change prepares internal/hlog for removal. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-13container: initialise cmd earlyOphestra
This allows use of more cmd methods. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-04container/dispatcher: optional stub wait4 signal associationOphestra
This synchronises the wait4 return after the toplevel signal call in lowlastcap_signaled_cancel_forward_error. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-04container/stub: remove function call in handleExitOphestra
This gets inlined and does not cause problems usually but turns out -coverpkg uninlines it and breaks the recovery. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-04container/dispatcher: remove wait4 test logOphestra
Turns out the reporting methods are not safe for concurrent use, despite the claim in testing.T doc comment. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-04container/stub: override goexit methodsOphestra
FailNow, Fatal, Fatalf, SkipNow, Skip and Skipf must be called from the goroutine created by the test. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-02container/dispatcher: stub.Call initialisation helper functionOphestra
This keeps composites analysis happy without making the test cases (too) bloated. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-31container/stub: export stub helpersOphestra
These are very useful in many packages containing relatively large amount of code making calls to difficult or impossible to stub functions. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-31container/msg: optionally provide error messagesOphestra
This makes handling of fatal errors a lot less squirmy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-30container: wrap container init start errorsOphestra
This helps indicate the exact origin and nature of the error. This eliminates generic WrapErr from container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/mount: unwrap vfs decoder errorsOphestra
These are now handled by init. This eliminates generic WrapErr from mount and procPaths. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/dispatcher: check simple test errors via reflectOphestra
Again, avoids the errors package concealing unexpected behaviours. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/vfs: wrap decoder errorsOphestra
This passes line information and handles strconv errors so it reads better. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/initoverlay: invalid argument typeOphestra
This eliminates generic WrapErr from overlay. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/dispatcher: check test errors via reflectOphestra
Using the errors package might conceal some incorrect behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/inittmpfs: unwrap out of bounds errorOphestra
This eliminates generic WrapErr from tmpfs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/init: unwrap path errorsOphestra
These are also now handled by init properly, so wrapping them in self is meaningless and unreachable. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/initsymlink: unwrap mount errorsOphestra
The mount function now wraps its own errors in a much more descriptive type with proper message formatting. Wrapping them no longer makes any sense. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/initsymlink: unwrap absolute errorOphestra
This is now handled properly by the init. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container/init: handle unwrapped errorsOphestra
This is much cleaner from both the return statement and the error handling. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container: repeat and impossible state typesOphestra
This moves repeated Op errors and impossible internal state errors off of msg. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-29container: wrap mount syscall errnoOphestra
This is the first step to deprecating the generalised error wrapping error message pattern. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-26container/initdev: mount tmpfs on shm for ro devOphestra
Programs expect /dev/shm to be a writable tmpfs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-26container/initbind: optional ensure host directoryOphestra
This is used for ensuring persistent data directories specific to the container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-25container/dispatcher: remove exit stub test logOphestra
Turns out testing.T does not like being called in defer. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-25container/autoroot: remove prefix fieldOphestra
This field has been a noop for a long time. Remove it to prevent further confusion. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-25container/initoverlay: internal bypass sysroot prefixOphestra
This is for supporting overlay mounts for autoroot. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-24container/init: measure init behaviourOphestra
This used to be entirely done via integration tests, with almost no hope of error injection and coverage profile. These tests significantly increase confidence of future work in this area. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/dispatcher: start goroutine in dispatcherOphestra
This allows instrumentation of calls from goroutine without relying on finalizers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/init: avoid multiple lastcap callsOphestra
This reduces the size of []kexpect in the test suite. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/dispatcher: instrument each goroutine individuallyOphestra
Scheduler nondeterminism cannot be accounted for, so do this instead. There should not be any performance penalty as these calls are optimised out for direct. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-23container/params: pass fd instead of fileOphestra
The file is very difficult to stub. Pass fd instead as it is the value that is actually useful. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container/init: call lockOSThread through dispatcherOphestra
This degrades test performance if not stubbed out. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container: move integration test helpersOphestra
With the new instrumentation it is now possible to run init code outside integration tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container/path: use syscall dispatcherOphestra
This allows path and mount functions to be instrumented. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-22container/init: wrap syscall helper functionsOphestra
This allows tests to stub all kernel behaviour, enabling measurement of all function call arguments and error injection. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-21container/syscall: doc comments from manpagesOphestra
These are pulled straight from the manpages. Signed-off-by: Ophestra <cat@gensokyo.uk>