nixos/test-driver: deprecate shell_interact()

Reviewing #512771 got me thinking and I'm not sure I see a good reason
to keep this method given the SSH backdoor functionality has a much
better UX.

I'd propose we deprecate it, await 26.11 to see if people complain and
remove it alltogether after that.
This commit is contained in:
Maximilian Bosch
2026-06-24 23:59:16 +02:00
parent c4ad614865
commit b9706678ac
3 changed files with 8 additions and 0 deletions
@@ -43,6 +43,11 @@ test script).
## Shell access to VMs in interactive mode {#sec-nixos-test-shell-access}
::: {.warning}
Using `shell_interact()` is deprecated. Use the
[interactive SSH backdoor](#sec-nixos-test-ssh-access) instead.
:::
The function `<yourmachine>.shell_interact()` grants access to a shell running
inside a virtual machine. To use it, replace `<yourmachine>` with the name of a
virtual machine defined in the test, for example: `machine.shell_interact()`.
@@ -56,6 +56,8 @@
- `komodo` has been updated to the v2 release line (2.x). See the [upstream v1 → v2 upgrade guide](https://github.com/moghtech/komodo/releases/tag/v2.0.0).
- The `shell_interact()` function on interactive runs of NixOS VM tests has been deprecated. Use the SSH backdoor instead.
- `security.run0.enableSudoAlias` now uses the `run0-sudo-shim` instead of a shell-script to improve compatibility.
- `security.run0.persistentAuth` options have been added to support persistent Authentication of session. Timeout configurable via `security.polkit.settings.Polkitd.ExpirationSeconds`.
@@ -908,6 +908,7 @@ class QemuMachine(BaseMachine):
return (rc, output.decode(errors="replace"))
@warnings.deprecated("Use the SSH backdoor instead")
def shell_interact(self, address: str | None = None) -> None:
"""
Allows you to directly interact with the guest shell. This should