diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 13:35:55 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 13:35:55 +0000 |
| commit | 5debb9e51172745d7e564239ecb37a1d2c4f3a0e (patch) | |
| tree | cdffe5ff6497d33ce2e68b44abd3f80cab84cc9f /tests/package_installer.rs | |
| parent | feb6e6148cfc8f664bbae6b70cb1c793ef690c5c (diff) | |
Run native initramfs inside Hasher rooter context
Diffstat (limited to 'tests/package_installer.rs')
| -rw-r--r-- | tests/package_installer.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/package_installer.rs b/tests/package_installer.rs index 76d8683..74bf9aa 100644 --- a/tests/package_installer.rs +++ b/tests/package_installer.rs @@ -102,3 +102,31 @@ fn build_plan_compiles_its_typed_package_request() { ); assert_eq!(request.selectors(), ["^kernel-(image|modules-())-(rt)$"]); } + +#[test] +fn sudo_user_runner_executes_hasher_commands_as_the_configured_user() { + let runner = alt_controller_image::hasher::SudoUserRunner::new("hermes"); + let invocation = runner.wrap(Invocation::new("hsh", ["--version"])); + + assert_eq!( + invocation, + Invocation::new("sudo", ["-n", "-u", "hermes", "hsh", "--version"]) + ); + let preparation = runner.prepare_workdir(std::path::Path::new("/build/work")); + assert_eq!( + preparation, + Invocation::new( + "sudo", + [ + "-n", + "install", + "-d", + "-o", + "hermes", + "-g", + "hermes", + "/build/work" + ] + ) + ); +} |