aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container_test.go
AgeCommit message (Collapse)Author
2026-02-28container: use /proc/self/exe directlyOphestra
This is a more reliable form of pathname to self and also cheaper than os.Executable. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-08container: ignore uninterpreted sourceOphestra
These can be set to anything by the distribution. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-08container: strip host-dependent opts in test casesOphestra
This change also improves plumbing for stripping options. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-31container: fix host-dependent test casesOphestra
These are not fully controlled by hakurei and may change depending on host configuration. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-14treewide: migrate ldd callersOphestra
This discontinues use of the deprecated ldd.Exec function for #25. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-14container: provide usage exampleOphestra
This requires cgo so unfortunately will not run in the playground. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-12container: set FD_CLOEXEC on all open filesOphestra
While fd created from this side always has the FD_CLOEXEC flag, the same is not true for files left open by the parent. This change prevents those files from leaking into the container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-10container/init: close initial process files on terminationOphestra
This closes them during the adopt wait delay. This also keeps them alive. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05container/std: relocate rule typesOphestra
This enables its use in hst for #15. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-05std: rename from compOphestra
Seccomp lookup tables are going to be relocated here, and PNR constants. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-03message: rename NewMsg to NewOphestra
Should have done this when relocating this from container. Now is a good time to rename it before v0.3.x. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-21container/comp: rename from bitsOphestra
This package will also hold syscall lookup tables for seccomp. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-13container: synchronise after notifyOphestra
This should eliminate intermittent failures in the forward test. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-10-13treewide: parallel testsOphestra
Most tests already had no global state, however parallel was never enabled. This change enables it for all applicable tests. 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-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: 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-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/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-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-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-17container: check output helper functionsOphestra
The container test suite has always been somewhat inadequate due to the inability of coverage tooling to reach into containers. This has become an excuse for not testing non-container code as well, which lead to the general lack of confidence when working with container code. This change aims to be one of many to address that to some extent. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-11container: use absolute for pathnameOphestra
This is simultaneously more efficient and less error-prone. This change caused minor API changes in multiple other packages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-09container: remove PATH lookup behaviourOphestra
This is way higher level than the container package and does not even work unless every path is mounted in the exact same location. This behaviour causes nothing but confusion and problems, Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-08container/ops: implement overlay opOphestra
There are significant limitations to using the overlay mount, and the implementation in the kernel is quite quirky. For now the Op is quite robust, however a higher level interface for it has not been decided yet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-08container: test case runtime initialisationOphestra
This allows for more sophisticated test setup. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-08container: test bypass output buffer on verboseOphestra
This restores verbose behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-07container: buffer test outputOphestra
This further reduces noise on test failure by only passing through output of the failed test. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-07container: test respect verbose flagOphestra
This reduces noise on test failure. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-03container/ops: mount dev readonlyOphestra
There is usually no good reason to write to /dev. This however doesn't work in internal/app because FilesystemConfig supplied by ContainerConfig might add entries to /dev, so internal/app follows DevWritable with Remount instead. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-03container/ops: merge mqueue and dev OpsOphestra
There is no reason to mount mqueue anywhere else, and these Ops usually follow each other. This change merges them. This helps decrease IPC overhead and also enables mounting dev readonly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-02container: improve clone flags readabilityOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-01container/ops: expose remount as OpOphestra
This is useful for building a filesystem hierarchy then remounting it readonly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-08-01container/mount: pass tmpfs flagsOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-28container: forward context cancellationOphestra
This allows container processes to exit gracefully. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-28container: check cancel signal deliveryOphestra
This change also makes some parts of the test more robust. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-26container: access test case by index in helperOphestra
This is more elegant and allows for much easier extension of the tests. Mountinfo is still serialised however due to libPaths nondeterminism. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-25container: remove custom cmd initialisationOphestra
This part of the interface is very unintuitive and only used for testing, even in testing it is inelegant and can be done better. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-03treewide: migrate to hakurei.appOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-07-03container: move out of toplevelOphestra
This allows slightly easier use of the vanity url. This also provides some disambiguation between low level containers and hakurei app containers. Signed-off-by: Ophestra <cat@gensokyo.uk>