Commit Graph

982 Commits

Author SHA1 Message Date
Robert Hensing
e0000983db
Merge pull request #279170 from SuperSandro2000/nixos-repl-lib
nixos-rebuild: add lib to repl to make debugging even easier
2024-01-19 12:29:04 +01:00
K900
3d6a5ad604 systemd-lib: fix automount generation after 9fbf82d9cb
This one got missed in the refactor.
2024-01-18 08:33:46 +03:00
Will Fancher
59ba511744
Merge pull request #266370 from SuperSandro2000/systemd-install-wantedby
systemd-lib: add Install WantedBy section to make units similar to upstream ones
2024-01-17 13:04:03 -05:00
Robert Hensing
8e934650ce nixos: Expose lib attribute on configuration for repl 2024-01-15 00:28:07 +01:00
Ryan Lahfa
b5a944511d
Merge pull request #256709 from colemickens/make-squashfs-skip-compression
nixos/lib/make-squashfs.nix: allow disabling compression
2024-01-13 20:23:25 +01:00
Ryan Lahfa
f520eb3f0c
Merge pull request #263658 from siriobalmelli-foss/sb/zfs-image
openstack-image-zfs and make-single-disk-zfs-image: optionally specify qemu instance memory
2024-01-12 20:25:26 +01:00
K900
9490738be7 nixos/lib/test-driver: add setuptools build dep 2024-01-12 13:58:07 +03:00
Cole Mickens
5a718794d0
nixos/lib/make-squashfs.nix: allow disabling compression 2024-01-07 22:46:20 -06:00
Sandro Jäckel
9fbf82d9cb
systemd-lib: add Install WantedBy section to make units similar to upstream ones
and make them better grepable
2024-01-02 23:09:03 +01:00
github-actions[bot]
b3ceb9c6b7
Merge staging-next into staging 2023-12-26 18:01:24 +00:00
Martin Weinelt
0392a07511
nixos/lib/make-disk-image: Create build products metadata
For hydra to expose built images for direct download, listing the
relevant files in nix-support/hydra-build-products is required.
2023-12-26 16:02:51 +01:00
Sandro Jäckel
e2702f5aee
treewide: don't use python3Minimal where it is not required
Building a python environment with python3Minimal requires hydra
to bootstrap pip and build all packages used in the environment
which would otherwise not be built. This reduces cache re-use and duplicates things.

Also common dependencies normally included in python itself
are not properly checked and can cause hard to debug errors
because everyone just assumes those modules are there.
2023-12-21 02:21:48 +01:00
Jacek Galowicz
66ca9c90e2
Merge pull request #267937 from SomeoneSerge/fix/test-driver-activestate
nixos/lib/test-driver: make wait_for_unit ask for ActiveState only
2023-12-14 06:55:06 +01:00
Philip Taron
bc7a939ced nixos/networkd: add [IPVLAN] and [IPVTAP] configuration options to systemd.netdev files
[IPVLAN](https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVLAN%5D%20Section%20Options)
[IPVTAP](https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVTAP%5D%20Section%20Options)
2023-11-18 08:43:21 +01:00
Someone Serge
392fbc90a8
nixos/lib/test-driver: make wait_for_unit ask for ActiveState only
This is a hotfix for https://github.com/NixOS/nixpkgs/issues/266690,
where `systemctl show $unit` sometimes randomly leaves ActiveState out
2023-11-16 18:25:42 +00:00
Ryan Lahfa
b8218af2e6
Merge pull request #256226 from ElvishJerricco/systemd-stage-1-testing-backdoor 2023-11-10 14:08:07 +01:00
Will Fancher
9a0f523372 systemd-stage-1: Enable backdoor in nixos tests 2023-11-09 17:53:48 -05:00
Will Fancher
c20ad5d379
Merge pull request #266369 from SuperSandro2000/systemd-unit-empty-lines
systemd-lib: cleanup empty lines in unit files
2023-11-09 16:49:11 -05:00
Sandro Jäckel
ae0bbc00e8
systemd-lib: cleanup empty lines in unit files 2023-11-09 02:08:57 +01:00
Robert Hensing
87391b681f
Merge pull request #265836 from hercules-ci/nixosTests-no-surprises
nixos/testing/nodes: Do allow aliases
2023-11-08 00:55:32 +01:00
Samuel Cormier-Iijima
61bdb29a05
nixos/lib/make-btrfs-fs: Use fakeroot and faketime (#265686) 2023-11-07 02:17:38 +02:00
Robert Hensing
ae5cb919f5 nixos/testing/nodes: Do allow aliases
Aliases exist for a reason. Sure it is nice to make sure that
some aliases aren't used within Nixpkgs, but this creates two problems
which are far worse than your failing to meet your neatness compulsions.

- Users encounter missing attributes, https://github.com/NixOS/nixpkgs/issues/264577
  wasting their time, stalling their progress, and even occupying others
  time that would be better spent on fixing *real* issues.

- Hydra doesn't treat evaluation errors seriously enough, with the
  effect that actual relevant test failures are masked by evaluation
  failures such as those caused by this no aliases business.

- We don't even have the infrastructure to get rid of aliases, because
  all warnings in package attributes are disallowed by Nixpkgs CI
  tooling, last I checked.

Before re-disabling this, make sure that

- An actually helpful deprecation process is in place.

- Aliases are still allowed when `nixos-lib.runTests` and
  `pkgs.testers.runNixOSTest` are invoked by external projects.
  For instance, `all-tests.nix` could provide such an
  override (e.g. with `newScope`).
2023-11-06 12:30:28 +01:00
emilylange
6c7ad5e732
nixos/systemd-lib: fix building of empty unit files
This is a fixup for c1ae82f448.

nix' `passAsFile` does not create empty files for variables that are
`null`.

This results in the following error for units that have no overrides or
content, but are, e.g. `wantedBy`:
`mv: cannot stat '': No such file or directory`.

Minimal reproducer:
`systemd.units.empty.wantedBy = [ "multi-user.target" ];`

This is often necessary when a unit is loaded in via `systemd.packages`.
2023-11-02 01:18:46 +01:00
Sirio Balmelli
30d1e55e25
make-single-disk-zfs-image: make memSize configurable
Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
2023-10-31 08:28:45 +01:00
5aaee9
c1ae82f448 nixos/systemd: fix make unit failed when unit too large 2023-10-31 01:06:37 +08:00
Ryan Lahfa
92fdbd284c
Merge pull request #262839 from RaitoBezarius/qemu-vm/timeout 2023-10-29 17:21:10 +01:00
Raito Bezarius
05dd78cf4b nixos/lib/test-driver: add driver-timeout as a passthru test
From now on, we will aim to ensure that the test driver
gets tested by OfBorg using all our available tests.

This commit adds the driver timeout test to the driver.
2023-10-29 12:45:00 +01:00
Raito Bezarius
a0dc17bd57 nixos/lib/testing/run: expose rawTestDerivation
For `testBuildFailure` and similar functions, we need a full blown derivation and not a lazy one.
This is an internal option for test framework developers.
2023-10-29 12:45:00 +01:00
Raito Bezarius
d4d7550108 nixos/test-driver: provide a global timeout
Since the debut of the test-driver, we didn't obtain
a race timer with the test execution to ensure that tests doesn't run beyond
a certain amount of time.

This is particularly important when you are running into hanging tests
which cannot be detected by current facilities (requires more pvpanic wiring up, QMP
API stuff, etc.).

Two easy examples:

- Some QEMU tests may get stuck in some situation and run for more than 24 hours → we default to 1 hour max.
- Some QEMU tests may panic in the wrong place, e.g. UEFI firmware or worse → end users can set a "reasonable" amount of time

And then, we should let the retry logic retest them until they succeed and adjust
their global timeouts.

Of course, this does not help with the fact that the timeout may need to be
a function of the actual busyness of the machine running the tests.
This is only one step towards increased reliability.
2023-10-29 12:45:00 +01:00
Robert Hensing
5dfc78a8ad
Merge pull request #262021 from Enzime/linux-builder-cross
linux-builder: support `x86_64-linux` on `aarch64`
2023-10-24 14:34:29 +02:00
Michael Hoang
ab1f45f3d3 linux-builder: support x86_64-linux on aarch64 2023-10-24 13:35:37 +02:00
Maciej Krüger
1ecbbb6e3f
Merge pull request #260595 from adamcstephens/lxc/squashfs
lxc-container: add squashfs image support and release output
2023-10-24 02:06:36 +02:00
Jacek Galowicz
dda77fcc55
Merge pull request #257535 from RaitoBezarius/vmstate
nixos/lib/test-driver: use QMP API to watch for VM state
2023-10-22 14:22:34 +01:00
Ryan Lahfa
c5442c247f
Merge pull request #257262 from dongcarl/2023-09-nginx-fixes
nixos/nginx: Allow empty port for listen directive (for unix socket)
2023-10-21 17:26:57 +01:00
Raito Bezarius
f94876a65c nixos/lib/test-driver: wire up QMP client
Now that we have a QMP client, we can wire it up in the test driver.

For now, it is almost completely useless because of the need of a constant "event loop", especially
for event listening.

In the next commits, we will slowly enable more and more usecases.
2023-10-21 13:03:15 +02:00
Philip Taron
989cca26c4
systemd.network.netdev: Add support for WLAN devices
These are virtual interface, where one physical wifi adapter can have
more than one interface.

See https://systemd.network/systemd.netdev.html#%5BWLAN%5D%20Section%20Options
and dedf2d0054
2023-10-16 15:04:44 -07:00
Adam Stephens
a91bd0b468
make-squashfs: add support for pseudoFiles, custom name, and disabling strip 2023-10-12 10:51:41 -04:00
Robert Hensing
a14f3f829d nixos/eval-config.nix: Rename arg nixosSystem -> configuration
For some time now the attrset returned by `evalModules` has
`type = "configuration"`.

This is a clean refactor because the name is not exposed.
(never is for simple lambda)
2023-10-10 13:25:15 +02:00
Robert Hensing
1c0427862e nixos/eval-config.nix: Rename let withExtraArgs -> withExtraAttrs
Presumably it only used to add `extraArgs`, but it also adds other
attributes now.
2023-10-10 13:24:55 +02:00
Carl Dong
e5c2c71280 nixos/nginx: Allow empty port for listen directive
When listening on unix sockets, it doesn't make sense to specify a port
for nginx's listen directive.

Since nginx defaults to port 80 when the port isn't specified (but the
address is), we can change the default for the option to null as well
without changing any behaviour.
2023-10-09 21:16:03 -04:00
K900
93cfbb253c eval-config.nix: set nixpkgs.pkgs instead of _module.args.pkgs
This allows nixpkgs.overlays to work, and also the nixpkgs.config check.
2023-10-08 20:41:44 +03:00
K900
80cc25eb51 nixos/testing: fix eval for tests created without make-python-test.nix
We have too many test entrypoints and this is a problem.
2023-10-06 23:52:04 +03:00
K900
8a7282f90b nixosTest: fix tests defined with pkgs.nixosTest 2023-10-06 16:33:15 +03:00
Florian Klink
42f2e2dadd
Merge pull request #257510 from ign0tus/fix/wake-on-lan-policy
Fix: WakeOnLan policy
2023-10-04 11:36:16 +03:00
Reno Reckling
612035c45f
Fix broken genJqSecretsReplacementSnippet for jq 1.7 (#257932)
jq 1.7 updated it's behaviour and now throws an error
if the first argument is an empty string. It now needs
"." to pass the input through.
2023-09-30 14:00:13 +02:00
Jörg Thalheim
f1450e660f nixos/test-driver: whitelist variable names that don't follow pep8
https://docs.astral.sh/ruff/rules/invalid-argument-name/
2023-09-30 10:31:22 +02:00
Jörg Thalheim
1810265b57 nixos/test-driver: name exception according to pep8
see https://docs.astral.sh/ruff/rules/error-suffix-on-exception-name/
2023-09-30 10:31:22 +02:00
Jörg Thalheim
a1f01abe53 nixos/test-driver: apply ruff fixes & suggestions 2023-09-30 10:31:22 +02:00
Jörg Thalheim
93b1fa09d5 nixos/test-driver: disable typecheck for dependencies where don't have typing 2023-09-30 10:18:07 +02:00
Jörg Thalheim
d746557260 nixos/test-driver: add shell.nix
this useful for local development
2023-09-30 10:18:07 +02:00