Commit Graph

62 Commits

Author SHA1 Message Date
Jörg Thalheim
ea93d8fec7 inline create_test_machine again 2025-07-04 14:36:05 +02:00
Jörg Thalheim
1e7453ab04 move nixosTestLib to pkgs/testing 2025-07-04 14:36:05 +02:00
Jörg Thalheim
c148ece02e move setup_nix_in_nix into nixos_test_lib 2025-07-04 14:36:02 +02:00
Jörg Thalheim
b526242744 share more code between installation and update test 2025-07-04 14:14:28 +02:00
Jörg Thalheim
6aab8ffd0c change install test to run clan outside of the VM 2025-07-04 14:14:28 +02:00
lassulus
40065c7a00 refactor: remove deployment.json and use direct selectors
- Remove deployment.json file generation from outputs.nix
- Add throw for deprecated deployment.file usage with upgrade instructions
- Remove vars data from deployment.data
- Update Machine class to use direct select() calls instead of deployment property
- Update all deployment property accesses to use direct selectors
- Add precaching for frequently accessed values in update.py:
  - Module paths for facts and vars
  - Deployment settings (requireExplicitUpdate, nixosMobileWorkaround)
  - Services and generators data
  - Secret upload locations
- This removes unnecessary JSON serialization and makes the code more composable
2025-07-02 20:56:23 +02:00
DavHau
1ab9eb733c checks: fix some tests not named correctly 2025-06-30 19:50:16 +07:00
Johannes Kirschbauer
7d755d04b5 chore: clean up logic around clanInternals 2025-06-26 16:12:35 +02:00
Jörg Thalheim
67def050fd use a clan-core snapshots for ci tests
We currently have to re-run our integration tests a lot because they are
depending on the whole repository. This pull request changes locks the
clan-core used for vm tests. This has the caveat that we might not run
the latest NixOS machine of our profiles. On the upside we can test
behaviour against an older clan-core version and capture breakages and
make it backwards compatible. If we actually want to test the latest
version, the PR that changes the exposed flake api, could also bump the
clan-core snapshot.
2025-05-12 13:21:25 +02:00
DavHau
1f4b526e42 ci-performance: remove self reference from installation test 2025-04-30 15:53:18 +07:00
Johannes Kirschbauer
f6e514ec6f Refactor: move checks/lib into lib/ to avoid duplicate lib
Lets avoid the mistake of nixpkgs having multiple
libs
2025-04-23 16:19:16 +02:00
Johannes Kirschbauer
8ae0f5ddcb tests(clan): move test-inventory.nix to clanLib. And name it 'makeTestClan'
Exposing the function via clanLib makes it more accessible to clan modules
This allows each module to define its own test without needing to depend on any fileSystem path assumptions in the clan-core repo
2025-04-15 18:17:40 +02:00
Michael Hoang
f086fe01da treewide: switch back to pkgs.nix 2025-04-12 13:15:53 +02:00
RTUnreal
f4f7df312d checks: fix shellcheck errors 2025-04-09 19:44:00 +02:00
Jörg Thalheim
a6ea7b692d checks/installation: restore the install without system aspect 2025-04-09 11:32:28 +00:00
Jörg Thalheim
5968ee1195 installation: use clan-cli-full so that nix doesn't try to evaluate deps 2025-04-09 09:52:56 +00:00
Jörg Thalheim
c2f7bf3fef checks/installation: move updating hardware configuration to it's own test
for some reason those are very slow. Moving them to their own test
breaks down the critical path.
2025-04-09 09:52:56 +00:00
Jörg Thalheim
7308af0a85 installation: speed up by installing to localhost
we test other types of installation already in nixos-anywhere so we can
speed up this test quite a bit by not having a seperate machine to
install to.
2025-04-09 09:36:46 +00:00
Jörg Thalheim
ce4a646927 installation: use ip addresses to decrease flakiness 2025-04-08 21:19:47 +02:00
Jörg Thalheim
c61c1af18e replace original installation test with installation-without-system 2025-04-08 20:41:31 +02:00
Jörg Thalheim
9436a451f7 installation: use networkd everywhere 2025-04-08 10:33:48 +02:00
Michael Hoang
9ca5cb7bcc checks: disable all failing aarch64-linux checks 2025-03-24 12:50:57 +09:00
Jörg Thalheim
33a9fd8d3d tests/installer/client: increase RAM 2025-03-22 17:07:52 +01:00
Michael Hoang
850627c5c6 checks: use pkgs.nixVersions.latest until pkgs.nix is 2.26+ 2025-03-20 15:52:13 +09:00
Jörg Thalheim
1736b0f539 work around in installation test by using newer nix version 2025-03-18 13:29:28 +01:00
Michael Hoang
c6cf9d1336 checks/installation: use test-flake instead of self 2025-03-10 11:58:32 +09:00
DavHau
2a4d2c9cb5 switch to nixpkgs hosteded by cache.nixos.org
take 2 on https://git.clan.lol/clan/clan-core/pulls/2921
2025-03-07 07:20:07 +00:00
Michael Hoang
871326fb91 clan-cli: fix clan-cli accidentally dependending on all packages 2025-02-04 04:52:47 +00:00
lassulus
6f2ae1e1f2 extend installation-test to check partitioning secrets 2025-01-21 11:13:51 +00:00
Jörg Thalheim
c4a1e3ec95 switch to nixos-facter for hardware-config 2025-01-15 13:59:49 +00:00
lassulus
22848256d8 installer-test: adapt to upstream changes 2024-12-09 17:21:14 +01:00
Jörg Thalheim
38d270a760 disable installation/backup test on arm64 2024-12-06 17:03:57 +01:00
Jörg Thalheim
d16947f288 installation: fix correct binary on aarch64 2024-12-06 15:39:35 +00:00
DavHau
0aa63e2e35 tests: minify test machines to decrease runtime 2024-11-13 20:40:01 +07:00
a-kenji
d689dd8f6c pkgs/cli: Query target-host for machines install from configuration
Query `target-host` for `clan machines install` from the nixos
configuration (deployment.json), if possible.

Remove `TARGET_HOST` option and introduce `--target-host` command
line flag.

This brings the installation subcommand in line with the update
subcommand - improving consistency and usability.

Closes: #2309
2024-11-10 18:18:51 +01:00
Jörg Thalheim
1ec4bb124e add build-on-remote flag 2024-11-04 13:27:50 +01:00
Jörg Thalheim
294634ec62 fix nixos machines without hostPlatform 2024-10-09 12:08:23 +02:00
Jörg Thalheim
fed1283091 add nixos-facter to nixos installation test 2024-09-29 16:59:02 +02:00
Jörg Thalheim
b4fb4f180b rename hw-generate to update-hardware-config 2024-09-20 13:42:18 +02:00
a-kenji
f1b857f4ae Revert "Merge pull request 'machine_id_v2' (#2052) from Qubasa/clan-core:machine_id_v2 into main"
This reverts commit 68a72a4156, reversing
changes made to 7af3e80249.
2024-09-10 14:01:12 +02:00
Qubasa
a0b3275ed1 clanCore: init machineId and diskId v2 2024-09-09 15:51:31 +02:00
Qubasa
323010bb04 revert machine_id pull request 2024-09-06 21:38:50 +02:00
Qubasa
b16a53f510 clanCore: init machine_id.nix with clan.core.machine.{id,diskId} 2024-09-06 18:05:40 +02:00
Qubasa
ca65c021b1 nixosModules: remove unnecessary ./iso and disk-layout, clanModules: fix issue #1349 2024-09-03 00:09:45 +02:00
Jörg Thalheim
e889f0c20b hw-generate: add to nixos test 2024-08-24 12:07:22 +02:00
Jörg Thalheim
0d5aaab9d1 use compliant machine name in installation test 2024-08-24 12:07:22 +02:00
DavHau
4cde2d96be Reapply "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"
This reverts commit 9778444706.

workaround upstream bug: https://github.com/NixOS/nixpkgs/issues/324802
2024-07-05 19:29:01 +07:00
Jörg Thalheim
9778444706 Revert "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"
This reverts commit afbd4a984d.

The old configuration cannot be updated like this:

eve] error:
[eve]        … while calling the 'head' builtin
[eve]          at /nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/lib/attrsets.nix:1575:11:
[eve]          1574|         || pred here (elemAt values 1) (head values) then
[eve]          1575|           head values
[eve]              |           ^
[eve]          1576|         else
[eve]
[eve]        … while evaluating the attribute 'value'
[eve]          at /nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/lib/modules.nix:809:9:
[eve]           808|     in warnDeprecation opt //
[eve]           809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
[eve]              |         ^
[eve]           810|         inherit (res.defsFinal') highestPrio;
[eve]
[eve]        … while evaluating the option `system.build.toplevel':
[eve]
[eve]        … while evaluating definitions from `/nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/nixos/modules/system/activation/top-level.nix':
[eve]
[eve]        … while evaluating the option `assertions':
[eve]
[eve]        … while evaluating definitions from `/nix/store/5b0hl2dnvr1sawqlkwmsnaiyqz00d34h-source/nixos/modules/system/boot/systemd.nix':
[eve]
[eve]        … while evaluating the option `systemd.services':
[eve]
[eve]        … while evaluating definitions from `/nix/store/kpzcdgndym0qm1w490mjvk9c2qmz03h5-source/nixosModules/clanCore/zerotier':
[eve]
[eve]        … while evaluating the option `clan.core.networking.zerotier.networkId':
[eve]
[eve]        (stack trace truncated; use '--show-trace' to show the full, detailed trace)
[eve]
[eve]        error: A definition for option `clan.core.networking.zerotier.networkId' is not of type `null or string'. Definition values:
[eve]        - In `/nix/store/kpzcdgndym0qm1w490mjvk9c2qmz03h5-source/nixosModules/clanCore/networking.nix':
[eve]            {
[eve]              _type = "override";
[eve]              content = "267efd4a15b69623";
[eve]              priorit
2024-07-05 11:16:05 +02:00
DavHau
afbd4a984d clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking} 2024-07-04 17:05:37 +07:00
Johannes Kirschbauer
9b0e2a87e8 ClanModules: Add docs and api to retrieve metadata 2024-06-25 21:17:01 +02:00