data model: add TF test #4

Closed
kiara wants to merge 76 commits from data-model-tf-test into main

76 commits

Author SHA1 Message Date
cda46b5f65
add data model test for TF 2025-08-28 21:06:19 +02:00
cc66348444
split tests to allow running the faster ssh test separately 2025-08-28 14:10:54 +02:00
80e2a9b909
factor out data model 2025-08-27 21:23:18 +02:00
b5a96a70b8
add nixops4 data model test 2025-08-27 20:40:49 +02:00
fbb6a45292
adjust deployment type
this is a cop-out possible until
fricklerhandwerk/Fediversity#15.
after that, this will require actually figuring out how to get `options`
for `deployment.nix` - which may need `evalModules` with
`data-model.nix`.
2025-08-27 13:18:09 +02:00
64905f0b1c
restore data model with { resources } wrappers, this time working 2025-08-27 13:18:09 +02:00
078a49f54a
simpler data model, not sure it's desirable but at least it's consistent 2025-08-27 13:18:09 +02:00
f30c47c8ec
actually rely on user package from data model 2025-08-27 13:18:09 +02:00
cac3a80f37
pass system 2025-08-27 13:18:09 +02:00
6ec6f1677d
update test 2025-08-27 13:18:09 +02:00
d8196d54db
update deployment 2025-08-27 13:18:09 +02:00
3102be50ea
simplify auth to not accept password 2025-08-27 13:18:09 +02:00
737c6d868c
rename deployment to deployment-type, disambiguating from environments' deployment 2025-08-27 13:18:09 +02:00
1ab79ab2da
fix attrTag by adding mkOption 2025-08-27 13:18:09 +02:00
a88445f3ee
wrap application resources to match the input of apply 2025-08-27 13:18:09 +02:00
7ef43bf3d6
stylize user-specified names by quotes to clarify their status 2025-08-27 13:18:09 +02:00
54b3b9ea50
fix a bug of mismatching names in data model test
matches the name of `shell` to `operator-environment`.
2025-08-27 13:18:09 +02:00
72ba1726b7
try and use deployment 2025-08-27 13:18:09 +02:00
053fb3d3bf
spacing 2025-08-27 13:18:09 +02:00
33cfb9f211
simplify imputDerivations 2025-08-27 13:18:09 +02:00
520fa63612
unimport qemu-guest 2025-08-27 13:18:09 +02:00
d51943af42
simplify inputDerivations 2025-08-27 13:18:09 +02:00
c900b7a9c5
simplify deployment 2025-08-27 13:18:09 +02:00
199bcca285
skip is-active sshd 2025-08-27 13:18:09 +02:00
01a55b13e9
- auto 2025-08-27 13:18:09 +02:00
6d56de3d57
move fail in 2025-08-27 13:18:09 +02:00
c5d4d8e1e6
- BatchMode 2025-08-27 13:18:09 +02:00
4133421e5b
rm unused ssh settings 2025-08-27 13:18:09 +02:00
989d04a418
dedupe inputDerivations 2025-08-27 13:18:09 +02:00
1e16c613dc
rm cowsay 2025-08-27 13:18:09 +02:00
e0378992ac
remove unused JSON-serialized args (sources) 2025-08-27 13:18:09 +02:00
eaa203fa9a
factor out to nixos.nix 2025-08-27 13:18:09 +02:00
a6d91b6c02
rm users 2025-08-27 13:18:09 +02:00
45ef1609fc
simplify grub 2025-08-27 13:18:09 +02:00
8304b892d7
rm users 2025-08-27 13:18:09 +02:00
6a56954e82
reenable ipv6 2025-08-27 13:18:09 +02:00
0eb14ba64f
reenable firewall 2025-08-27 13:18:09 +02:00
c2c8091b29
rm comments 2025-08-27 13:18:09 +02:00
f65c82503c
rm getty 2025-08-27 13:18:09 +02:00
6cdf038d54
mv attempts 2025-08-27 13:18:09 +02:00
af4b04cf05
download-attempts: settle for just targetNode 2025-08-27 13:18:09 +02:00
239f556aa9
rm comment 2025-08-27 13:18:09 +02:00
35841f172c
restore imports 2025-08-27 13:18:09 +02:00
f24347c7d0
dedupe nixosTest.nix 2025-08-27 13:18:09 +02:00
35ee0c6385
qemu guest 2025-08-27 13:18:09 +02:00
6016007143
grub 2025-08-27 13:18:09 +02:00
133b0a0bb0
auto login 2025-08-27 13:18:09 +02:00
75716ed6c3
networking 2025-08-27 13:18:09 +02:00
81eef54982
users 2025-08-27 13:18:09 +02:00
9bb52618fa
handle test outcome 2025-08-27 13:18:09 +02:00
ff8d29177f
specialArgs: sources 2025-08-27 13:18:09 +02:00
7d1f0c61af
nix in tests: download-attempts = 1 2025-08-27 13:18:09 +02:00
f7b7e91960
ensure inputs 2025-08-27 13:18:09 +02:00
7eeb0fbdf6
rm paste 2025-08-27 13:18:09 +02:00
b5d42bb64c
move stuff not needed in test out 2025-08-27 13:18:09 +02:00
fb29c3d07e
ensure availability of needed inputs 2025-08-27 13:18:09 +02:00
de505fb430
reduce download attempts in test 2025-08-27 13:18:09 +02:00
cb4bf9101a
settle for hello, ditching cowsay 2025-08-27 13:18:09 +02:00
5c0735d545
move imports from paste to targetNode to increase parity between paste and nixosTest 2025-08-27 13:18:09 +02:00
099a82a7e2
ditch superfluous substituters 2025-08-27 13:18:09 +02:00
33b9936ab8
pasteable command for trying without rebuilding vm 2025-08-27 13:18:09 +02:00
dea95b63c8
add keys 2025-08-27 13:18:09 +02:00
ca77181bae
wip: use ssh in test 2025-08-27 13:18:09 +02:00
b65a8daa82
add deployment method: ssh 2025-08-27 13:18:09 +02:00
3e7c0c577c
un-nixops 2025-08-27 13:18:09 +02:00
ed027c9f7c
scaffold deployment/check/data-model from ./basic
modelify
2025-08-27 13:18:09 +02:00
8dc2f05749
allow different deployment types 2025-08-27 13:18:09 +02:00
9d903f3ef7 Complete the data model with a runtime environment and end-to-end test (#481)
Closes #103

At last, a fully fledged data model for what Fediversity really is and does. This comes with a test that exercises a very simple but functionally complete arrangement with all ingredients fo the business logic: a dummy resource (login shell), a dummy application (`hello`, which needs a shell to live in), a dummy environment (a single NixOS VM that allows for one, the operator's, login shell), and a deployment of that environment given a dummy configuration (that enables `hello`).

The next step will be to lift this purely evaluation-level test into a VM test which verifies that the resulting VM indeed has `hello` deployed to the operator's user account.

Caveats:
- The exact naming has a bit of room for improvement, and may have diverged from the design document
- The test is not as pedantically type safe as it could be, since we simply use `types.raw` for resources such as NixOS users settings which *could* be more finely delineated

Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: kiara Grouwstra <kiara@procolix.eu>
Reviewed-on: Fediversity/Fediversity#481
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-committed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2025-08-27 00:45:49 +02:00
1f99a4c6c3 listToAttrs o map o attrsToListmapAttrs' (#489)
Reviewed-on: Fediversity/Fediversity#489
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-08-01 13:09:26 +02:00
588bb77a94 Infra: expose and use checks for vmOptions and nixosConfigurations (#488)
Following Fediversity/Fediversity#478 (comment), here is a PR that plugs the infra's `vmOptions` and `nixosConfigurations` outputs into flake checks, instead of calling random Nix commands from the CI. There is still a bit of magic in the CI, but that's because we don't have yet a Nix-aware CI that exposes one job per flake check.

Reviewed-on: Fediversity/Fediversity#488
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-07-31 15:41:02 +02:00
df3a070fa4 Infra: get rid of makeResourceModule (#485)
Reviewed-on: Fediversity/Fediversity#485
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-07-31 00:49:00 +02:00
be72b82875 Link to upstreaming PR for lib.types.fileset (#487)
Reviewed-on: Fediversity/Fediversity#487
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-07-30 13:25:22 +02:00
1b66028f32 Fix infra and add more tests (#478)
This PR contains a bunch of small fixes having to do with infra code. The goal is not to fix everything as that would require a full rewrite. Instead, we fix just what is necessary to get some testing going on. Once that is available, we will be able to work on a full refactor with more guarantees. Something of note is that most of the difficulty was to find code that would make both `nixops4 apply` _and_ `nix build .#nixosConfigurations.<machine>` happy. The takeaway is that the tests that we are adding now will not catch a whole class of tests having to do with how NixOps4 wires up the resources. Still, this is probably less significant as we are supposed to use NixOps4 every now and then.

The commits should be read separately.

Reviewed-on: Fediversity/Fediversity#478
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-07-30 12:31:03 +02:00
4509d277d3 move arguments from _module.args to specialArgs (#469)
Reviewed-on: Fediversity/Fediversity#469
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-07-23 18:12:55 +02:00
e488230d7b updater: make npins command verbose (#477)
Reviewed-on: Fediversity/Fediversity#477
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-07-19 13:00:33 +02:00
765183cd0d fix typo in users (#475)
Reviewed-on: Fediversity/Fediversity#475
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-07-17 19:02:14 +02:00