Commit Graph

48 Commits

Author SHA1 Message Date
Jörg Thalheim
8f8426de52 PGH003: fix 2025-08-26 11:36:38 +02:00
Jörg Thalheim
fc66dc78c3 PLW0603: fix 2025-08-25 15:17:06 +02:00
Jörg Thalheim
34816013ad D106: fix 2025-08-25 14:56:48 +02:00
Mic92
05665b1c7e Merge pull request 'ruff-3-arg-fixes' (#4934) from ruff-3-arg-fixes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4934
2025-08-25 12:54:04 +00:00
Jörg Thalheim
4986fe30c3 ARG002/ARG005: fix 2025-08-25 14:36:36 +02:00
Jörg Thalheim
5233eb7fdb ARG002: fix 2025-08-25 14:24:21 +02:00
Jörg Thalheim
94a158b77a ARG001: fix 2025-08-25 14:24:21 +02:00
Jörg Thalheim
f3f6692e4d S102: ignore 2025-08-25 14:07:59 +02:00
Jörg Thalheim
4b1ab4cdde S105: fix 2025-08-25 13:43:33 +02:00
Jörg Thalheim
76eb3c13e9 add various module docstrings 2025-08-25 13:06:04 +02:00
Jörg Thalheim
dc5485d9f1 ruff: replace asserts outside of tests with Exceptions 2025-08-25 13:06:04 +02:00
Jörg Thalheim
ea2d6aab65 ruff: apply automatic fixes 2025-08-25 11:34:41 +02:00
Michael Hoang
a71a5880c1 treewide: reformat 2025-08-08 15:28:37 +10:00
Jörg Thalheim
10f731c974 container-test-driver: fix rebuild and make container-test-driver importable 2025-07-30 17:49:28 +02:00
Jörg Thalheim
6ec38c33d7 container-test-driver: fixup /etc/passwd for unprivileged user
By default /etc/passwd in container build sandboxes have two users
(root,nixbld) mapped to root. This confuses nix especially it behaves
different if it runs as root. setuid/setgid() is not enough because ssh
will break if the current uid does not exist in /etc/passwd.
Along with this we now also only run the setup for setting up the
network bridge and cgroup filesystems once and not per container.
2025-07-30 09:54:50 +02:00
Jörg Thalheim
6c84b2e100 container-test-driver: also setup network if we start a single container 2025-07-30 09:54:50 +02:00
pinpox
cf2ccd7e14 Add wait_for_file testing helper 2025-07-22 16:27:20 +02:00
pinpox
97022ba873 Fix store symlinks in container test 2025-07-22 12:28:11 +02:00
Jörg Thalheim
833e872ccf don't rebuild eval tests on each ci run 2025-07-07 20:05:45 +02:00
Jörg Thalheim
b692f6fcfe put flake input overrides into a helper function 2025-07-07 15:59:09 +00:00
Jörg Thalheim
cb89457731 migrate all projects to python 3.13 linting 2025-07-04 18:39:01 +02:00
Jörg Thalheim
044edc9d06 container-test-driver: implement wait_for_open_port 2025-06-27 18:35:55 +02:00
a-kenji
465548db26 lib/test/sops: Fix secret deployment for test machines
Fix secret deployment for test machines in our NixOS vm and container
tests.

We filter now if we really need to deploy a certain set of files as a
deployment script, which alleviates us running into these edgecases:
```
error: The option `nodes.server.system.activationScripts.setupSecrets.text'
was accessed but has no value defined. Try setting the option.
```
2025-06-27 12:19:46 +02:00
DavHau
6f451c700d clan tests: allow testing CLI interactions
This is an improvement of the clanTest nixos vm test module.

The module now has a new option clan.test.fromFlake that allows to specify a flake.nix as the source for the test clan instead of specifying clan.XXX options.

This in turn allows accessing the `flake.nix` inside the test driver allowing to use the clan cli on it
2025-06-11 19:30:13 +07:00
DavHau
1add6a6314 clan tests: convert makeTestClan to a module
Let's not put yet another wrapper around runTest, instead expose our logic as a module that can be imported into any nixos-vm-test
2025-06-03 19:38:02 +07:00
DavHau
9cb6382cec makeTestClan: simplify - move parameters into module
... in preparation of removing the makeTestClan wrapper and make this a module instead that can be imported into any test.
2025-06-03 19:38:02 +07:00
DavHau
d9f69d7007 generate-test-vars: fake prompt inputs
Use fake prompt inputs when generating vars for testing
2025-05-31 17:14:26 +07:00
DavHau
60f07c3472 tests: actually execute vars checks in CI 2025-05-31 16:16:09 +07:00
DavHau
0060424152 tests: test vars generation for all clan service tests 2025-05-31 12:17:52 +07:00
Jörg Thalheim
9bf919ffad container-test: better error message for nsenter 2025-05-30 12:27:51 +02:00
Jörg Thalheim
f17dc9897d container-test: disable UsePam for ssh
doesn't work without setuid, which we currently do not support.
2025-05-30 11:53:20 +02:00
pinpox
99d347409c Prettify nspawn output 2025-05-08 16:20:29 +02:00
pinpox
f4d7e7a3cb Fix debug command to attach to container 2025-05-07 14:41:18 +02:00
a-kenji
c782ef5a79 container-test-driver: Fix test naming
Fix the container test naming, as this otherwise can be very confusing.
2025-05-06 19:47:53 +00:00
a-kenji
80007942d5 container-test-driver/nsenter: Improve printing of command
Improves printing of `nsenter` command, so that it can easier be copied.
2025-05-06 10:11:20 +00:00
hsjobeki
f6b0b5ada5 Merge pull request 'API(cli): add method to Flake class to allow calling nix functions' (#3502) from hsjobeki/clan-core:improvements-2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3502
2025-05-05 20:16:28 +00:00
Johannes Kirschbauer
2d5e337f81 tests: add error prefix for json schema in checks 2025-05-05 21:46:16 +02:00
pinpox
1708176dce Log nsenter command on container tests 2025-05-05 13:00:11 +02:00
Jörg Thalheim
271618d182 clanTest: remove unneeded parantheses 2025-05-04 14:59:22 +02:00
Michael Hoang
41d875cb31 container-test-driver: fix SSH not working inside container tests 2025-04-29 15:10:09 +10:00
Michael Hoang
bfc4dc89f2 container-test-driver: add Machine.fail 2025-04-29 14:57:58 +10:00
Johannes Kirschbauer
b66b3458c3 lib/tests: fix container driver module path 2025-04-23 16:23:09 +02:00
Johannes Kirschbauer
abd9519412 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
DavHau
8b00edad4a inventory tests: use containers by default 2025-04-23 19:49:02 +07:00
Johannes Kirschbauer
0756baa5dc Checks: add nixosIntegration test example to hello-service 2025-04-22 06:32:32 +00:00
Johannes Kirschbauer
4cef5afde8 clanLib: init flakeModules for better testing 2025-04-21 16:10:05 +02:00
Johannes Kirschbauer
0bc2a068fe chore(test/makeTestClan): document all options, remove magic specialArgs 2025-04-16 10:33:32 +02:00
Johannes Kirschbauer
7540242816 fix: rename folder lib/tests -> lib/test to be consistent with the attribute name 2025-04-16 10:04:31 +02:00