Commit Graph

1447 Commits

Author SHA1 Message Date
Florian Klink
fbebe4cdf5 nixos/systemd-networkd: Allow three value variant in ipv6AcceptRAConfig.RouteMetric option (#507540) 2026-04-26 11:55:37 +00:00
x7c2d
12f553550f nixos/systemd-networkd: add new options for v260
systemd 260 introduces some new linkConfig options to configure ethernet
devices and a new [MobileNetwork] section (and options) to configure
cellular network connections using a new integration with ModemManager.

- https://github.com/systemd/systemd/releases/tag/v260
2026-04-26 00:06:57 +01:00
Maximilian Bosch
9b2a6da44f nixos-test-driver: don't assert on vhost_vsock (#512730) 2026-04-24 09:57:16 +00:00
nixpkgs-ci[bot]
6714212dd9 Merge master into staging-nixos 2026-04-23 18:26:38 +00:00
Vladimír Čunát
ea9c3ae589 nixos-test-driver: reduce unnecessary rebuilds for now 2026-04-23 14:43:46 +02:00
Jacek Galowicz
133e3555ff nixos-test-driver: only use sharedMemory qemu config setting on linux 2026-04-23 11:09:46 +01:00
Jacek Galowicz
6668b5b381 nixos-test-driver: use hostPkgs to write config files to store 2026-04-23 11:09:45 +01:00
Jacek Galowicz
6c0ab2edd5 nixos-test-driver: only depend on vsock things on linux 2026-04-23 11:09:45 +01:00
Jacek Galowicz
b35551e838 nixos-test-driver: don't assert on vhost_vsock as tests without VMs
would be just fine without it
2026-04-23 09:43:12 +00:00
Jacek Galowicz
50718e1e0c nixos/test-driver: fix driverInteractive test_script invocation (#511896) 2026-04-22 19:34:36 +00:00
Robert Hensing
b13c0022ba nixos-test-driver: Add extra required features (#511413) 2026-04-21 07:45:53 +00:00
Maximilian Bosch
9b42f787bb nixos/test-driver: fix driverInteractive test_script invocation
See https://github.com/NixOS/nixpkgs/pull/510385/changes/BASE..f1bcb61731224bd8440510fc620d3c51f3e51c85
2026-04-21 00:24:25 +02:00
Maximilian Bosch
4c907dbb68 Revert "nixos-test-driver: use info/error/debug log feature more"
This reverts commit a2ff6e406e.

Pushed by accident to staging-nixos: https://matrix.to/#/%21UNVBThoJtlIiVwiDjU%3Anixos.org/%24UUtlLXPAwZaoeDXDT0wHC1PRZIWVhRNNgyvkKTVRG24?via=nixos.org&via=matrix.org&via=tchncs.de
2026-04-20 22:11:01 +02:00
Jacek Galowicz
1ecef5cad6 nixos-test-driver: require "/dev/net" in tests that need containers 2026-04-20 18:35:34 +01:00
Maximilian Bosch
4797207171 nixos/test-driver: deprecate using machine variable when only VM has a different name
For backwards-compat reason it's legal to do

    runTest {
      nodes.foo = { /* ... */ };
      testScript = ''
        machine.start()
        # do your thing
      '';
    }

This makes several places in the codebase unnecessarily complex and is
something people shouldn't be using anyways. Additionally, I was
reminded by people that this can actually be confusing when you expect
the variable to be named differently.

Hence, deprecate this behavior and kill it in a few releases down the
road.
2026-04-19 20:01:32 +02:00
Jacek Galowicz
a2ff6e406e nixos-test-driver: use info/error/debug log feature more 2026-04-19 18:02:46 +01:00
Maximilian Bosch
f3b69f2a71 nixos/test-driver: colorized warnings 2026-04-19 12:17:18 +02:00
Michael Daniels
ece6acc1e3 nixos-test-driver: fix handling of type-check-disabled case
f1bcb61731 did not handle this correctly,
causing failures (e.g. https://hydra.nixos.org/build/326659503/nixlog/2/tail)
2026-04-18 16:18:17 -04:00
Jacek Galowicz
f1bcb61731 nixos-test-driver: use configuration file instead of scattered env vars 2026-04-17 14:55:56 +01:00
Jacek Galowicz
b998b489db nixos-test-driver: don't prepare sandbox environemnt outside of sandbox. (#510559) 2026-04-17 13:00:19 +00:00
Jacek Galowicz
b55b2eff0f nixos/test-driver: add remaining tests to passthru.tests (#510699) 2026-04-17 11:59:11 +00:00
Michael Schneider
df17d7a149 nixos/test-driver: add remaining tests to passthru.tests 2026-04-17 12:35:06 +01:00
Jacek Galowicz
73c3836552 nixos-test-driver: don't prepare sandbox environemnt outside of sandbox 2026-04-16 20:38:52 +01:00
Jacek Galowicz
ca0c8d9aa2 nixos-test-driver: Don't document internal methods prefixed with
underscore
2026-04-16 11:55:45 +01:00
Jacek Galowicz
c62f8fff2e nixos-test-driver: drop unneeded sentinel object 2026-04-16 11:47:04 +01:00
Jacek Galowicz
b9ca7eaae0 nixos/test-driver: Hide vde switch log messages (#509488) 2026-04-15 18:20:27 +00:00
Jacek Galowicz
ea044acd82 nixos/test-driver: use vhost-device-vsock for SSH backdoor (#453305) 2026-04-15 18:15:52 +00:00
Michael Schneider
b787cf0ca3 nixos/test-driver: Hide vde switch log messages 2026-04-15 18:43:50 +01:00
Maximilian Bosch
1987c483d8 nixos/test-driver: use vhost-device-vsock for SSH backdoor
`vhost-device-vsock`[1] is a custom implementation of AF_VSOCK, but the
application on the host-side uses a UNIX domain-socket. This gives us
the following nice properties:

* We don't need to do `--arg sandbox-paths /dev/vhost-vsock` anymore for
  debugging builds within the sandbox. That means, untrusted users can
  also debug these kinds of tests now.

* This prevents CID conflicts on the host-side, i.e. there's no need for
  using `sshBackdoor.vsockOffset` for tests anymore.

A big shout-out goes to Allison Karlitskaya, the developer of test.thing[2]
who talked about this approach to do AF_VSOCK on All Systems Go 2025.

This patch requires systemd 258[3] because this contains `vhost-mux` in
its SSH config which is needed to connect to the VMs from now on.

To not blow up the patches even more, this only uses AF_VSOCK for the
debugger. A potential follow-up for the future would be a removal of the
current `backdoor.service` and replace it entirely by this
functionality.

The internal implementation tries to be consistent with how VLANs and
machines are handled, i.e. the processes are started when the Driver's
context is entered and cleaned up in __exit__().

I decided to push the process management and creation of sockets for
vhost-device-vsock into its own class, that's an implementation detail
and not a concern for the test-driver. In fact, `vhost-device-vsock` is
something we can drop once QEMU implements native support for using
AF_UNIX on the host-side[4]. `VsockPair` is its own class since
returning e.g. a triple of `(Path, Path, Int)` would be ambiguous in
what is the guest and what the host path (and frankly, I found it hard
to distinguish the two when reading the docs of `vhost-device-vsock`
initially).

Finally, now that we can do the SSH backdoor without adding additional
devices to the sandbox, I figured, it's time to write a test-case for
it.

[1] https://github.com/rust-vmm/vhost-device/blob/main/vhost-device-vsock/README.md
[2] https://codeberg.org/lis/test.thing
[3] https://github.com/NixOS/nixpkgs/pull/427968
[4] https://gitlab.com/qemu-project/qemu/-/issues/2095
2026-04-15 15:45:33 +01:00
Maximilian Bosch
9dcf711303 nixos/test-driver: push allocation into the context-manager
The context manager's purpose is to allocate its resources in `__enter__` and
release them again in `__exit__`.

Right now, the approach is merely a hack since we allocate everything in
the constructor, but use the context-manager protocol as way to reliably
terminate everything.

This isn't a functional change, but merely a correctness change by using
the methods the way they were intended.
2026-04-15 15:45:33 +01:00
Maximilian Bosch
28a450372a nixos/testing: allow setting test-wide warnings and assertions
This allows us to e.g. use `mkRemovedOptionModule` which will come in
handy in the upcoming commits.
2026-04-15 15:45:32 +01:00
Jacek Galowicz
c17bc0e1d2 nixos/test-driver: add option to force kvm use (#509553) 2026-04-15 13:31:34 +00:00
Michael Schneider
5f5734db9d nixos/test-driver: add option to force kvm use 2026-04-15 12:15:00 +01:00
Jacek Galowicz
bffdf7c2a8 nixos-test-driver: Use ty instead of mypy for test driver package 2026-04-15 12:13:45 +01:00
Paul Haerle
5aa9012bb3 nixos: replace 'text' with structured PAM rules (#420889) 2026-04-14 21:22:07 +00:00
Michael Schneider
45e2f9a67e nixos/test-driver: use log levels 2026-04-14 10:09:15 +01:00
Majiir Paktu
ab27ce1f96 nixos/pam: extract autoOrderRules to utils
This function is used to convert an ordered list of rules into an
attrset of rules with reasonable 'order' values. This reduces
boilerplate to define 'order' and makes it simple to switch how ordering
is managed in the future.
2026-04-10 20:55:34 -04:00
Fabian Möller
18d69f6e9d nixos/systemd-networkd: Allow three value variant in ipv6AcceptRAConfig.RouteMetric option 2026-04-07 10:44:36 +02:00
Linus Karl
26d2b87994 nixos/systemd-networkd: align options with upstream 2026-04-02 21:28:01 +02:00
Maximilian Bosch
01d640b494 nixos/test-driver: fix create_machine return type (#504626) 2026-04-01 13:56:06 +00:00
Alyssa Ross
5fd1a7194e nixos/test-driver: fix create_machine return type
This always returns a QemuMachine, which may need to have
QEMU-specific methods called on it.

Fixes: 23f1e6370d ("nixos/test-driver: add support for nspawn containers")
Fixes: 799cafcc23 ("nixos/test-driver: refactor Machine to BaseMachine and QemuMachine")
2026-03-29 10:32:30 +02:00
nixpkgs-ci[bot]
40feec50a3 Merge master into staging-nixos 2026-03-26 18:23:43 +00:00
Jacek Galowicz
d95261b435 nixos-test-driver: Make overridable 2026-03-26 13:58:05 +01:00
Kierán Meinhardt
fd2eb43269 nixos/test-driver: provide QemuMachine, NspawnMachine types to testScript 2026-03-24 16:03:28 +01:00
Kierán Meinhardt
ccdcdd7cb6 nixos/test-driver: provide machines, machines_qemu, machines_nspawn to testScript 2026-03-24 16:03:28 +01:00
Jörg Thalheim
5e3302e01c nixos/testing: fix testScript eval for functions without elipsis (#501599) 2026-03-21 15:12:08 +00:00
Jörg Thalheim
00f5ae0602 nixos/testing: fix testScript eval for functions without ...
The nspawn container support (23f1e6370d) added a `containers`
argument to the testScript caller. This breaks tests whose testScript
uses strict pattern matching without ellipsis, e.g. `{ nodes }:`,
since Nix rejects unexpected arguments.

Use `builtins.intersectAttrs` to only pass arguments the function
actually expects, making the caller forward-compatible with future
argument additions.

Fixes: 23f1e6370d ("nixos/test-driver: add support for nspawn containers")
2026-03-21 16:05:53 +01:00
Florian Klink
b10e145984 Improve systemd creds support for radicle (#475836) 2026-03-20 09:45:53 +00:00
Elias Vasylenko
914bb2e6db nixos/radicle: Update radicle to support systemd creds more completely via ImportCredential
By default it will look for the cred names supported by the upstream package, but alternate cred names can be chosen to produce a rename on the ImportCredential.
2026-03-19 22:09:23 +00:00
Kierán Meinhardt
f7e8f0c6a1 nixos/test-driver: fix type hints in extract-docstrings 2026-03-19 13:54:57 +01:00