Compare commits

..

73 commits

Author SHA1 Message Date
721fb6c6b7
restore path-based behavior for non-data-model tests 2025-09-01 14:48:40 +02:00
aefbf47a74
reusable TF deployment
note that, other than being easier to call, this maintains the TF
deployment's status of remaining a glorified wrapper of the SSH
deployment.
2025-09-01 13:38:14 +02:00
239961b860
stablize pathToRoot for TF 2025-08-31 19:15:52 +02:00
f74b692418
fix pathFromRoot to work on strings, as its removePrefix does not actually work with store versions of sub-folders 2025-08-31 19:15:52 +02:00
cc51661ac2
stablize pathToRoot by builtins.path 2025-08-31 19:04:25 +02:00
5c0374cf51
add data model test for TF 2025-08-31 17:36:20 +02:00
12c51f1d11
simplify deployment/nixos.nix 2025-08-31 17:35:10 +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
7 changed files with 2 additions and 189 deletions

View file

@ -39,12 +39,6 @@ jobs:
- uses: actions/checkout@v4
- run: nix-build -A tests.panel
check-proxmox-basic:
runs-on: native
steps:
- uses: actions/checkout@v4
- run: nix build .#checks.x86_64-linux.proxmox-basic -L
check-deployment-basic:
runs-on: native
steps:

View file

@ -1,37 +0,0 @@
{
runNixOSTest,
sources,
system,
}:
let
pkgs = import sources.nixpkgs-stable {
inherit system;
overlays = [ overlay ];
};
overlay = _: _: {
inherit
(import "${sources.proxmox-nixos}/pkgs" {
craneLib = pkgs.callPackage "${sources.crane}/lib" { };
# breaks from https://github.com/NixOS/nixpkgs/commit/06b354eb2dc535c57e9b4caaa16d79168f117a26,
# which updates libvncserver to 0.9.15, which was not yet patched at https://git.proxmox.com/?p=vncterm.git.
inherit pkgs;
# not so picky about version for our purposes
pkgs-unstable = pkgs;
})
proxmox-ve
pve-ha-manager
;
};
in
runNixOSTest {
node.specialArgs = {
inherit
sources
pkgs
;
};
imports = [
./proxmoxTest.nix
];
}

View file

@ -1,87 +0,0 @@
# https://github.com/SaumonNet/proxmox-nixos/blob/main/tests/vm.nix
{
pkgs,
...
}:
let
# tracking non-tarball downloads seems unsupported still in npins:
# https://github.com/andir/npins/issues/163
minimalIso = pkgs.fetchurl {
url = "https://releases.nixos.org/nixos/24.05/nixos-24.05.7139.bcba2fbf6963/nixos-minimal-24.05.7139.bcba2fbf6963-x86_64-linux.iso";
hash = "sha256-plre/mIHdIgU4xWU+9xErP+L4i460ZbcKq8iy2n4HT8=";
};
in
{
name = "proxmox-basic";
nodes.mypve =
{ sources, ... }:
{
imports = [
"${sources.proxmox-nixos}/modules/proxmox-ve"
];
services.proxmox-ve = {
enable = true;
ipAddress = "192.168.1.1";
vms = {
myvm1 = {
vmid = 100;
memory = 1024;
cores = 1;
sockets = 1;
kvm = true;
scsi = [ { file = "local:16"; } ];
cdrom = "local:iso/minimal.iso";
};
};
};
virtualisation = {
additionalPaths = [ minimalIso ];
diskSize = 4096;
memorySize = 2048;
};
};
testScript = ''
machine.start()
machine.wait_for_unit("pveproxy.service")
assert "running" in machine.succeed("pveproxy status")
# Copy Iso
machine.succeed("mkdir -p /var/lib/vz/template/iso/")
machine.succeed("cp ${minimalIso} /var/lib/vz/template/iso/minimal.iso")
# Declarative VM creation
machine.wait_for_unit("multi-user.target")
machine.succeed("qm stop 100 --timeout 0")
# Seabios VM creation
machine.succeed(
"qm create 101 --kvm 0 --bios seabios -cdrom local:iso/minimal.iso",
"qm start 101",
"qm stop 101 --timeout 0"
)
# Legacy ovmf vm creation
machine.succeed(
"qm create 102 --kvm 0 --bios ovmf -cdrom local:iso/minimal.iso",
"qm start 102",
"qm stop 102 --timeout 0"
)
# UEFI ovmf vm creation
machine.succeed(
"qm create 103 --kvm 0 --bios ovmf --efidisk0 local:4,efitype=4m -cdrom local:iso/minimal.iso",
"qm start 103",
"qm stop 103 --timeout 0"
)
# UEFI ovmf vm creation with secure boot
machine.succeed(
"qm create 104 --kvm 0 --bios ovmf --efidisk0 local:4,efitype=4m,pre-enrolled-keys=1 -cdrom local:iso/minimal.iso",
"qm start 104",
"qm stop 104 --timeout 0"
)
'';
}

View file

@ -4,14 +4,9 @@
_class = "flake";
perSystem =
{ pkgs, system, ... }:
{ pkgs, ... }:
{
checks = {
proxmox-basic = import ./check/proxmox {
inherit (pkgs.testers) runNixOSTest;
inherit sources system;
};
deployment-basic = import ./check/basic {
inherit (pkgs.testers) runNixOSTest;
inherit inputs sources;

View file

@ -6,13 +6,7 @@
outputs =
inputs:
{
nixConfig = {
extra-trusted-substituters = "https://cache.saumon.network/proxmox-nixos";
extra-trusted-public-keys = "proxmox-nixos:D9RYSWpQQC/msZUWphOY2I5RLH5Dd6yQcaHIuug7dWM=";
};
}
// import ./mkFlake.nix inputs (
import ./mkFlake.nix inputs (
{ inputs, sources, ... }:
{
imports = [

View file

@ -1,4 +0,0 @@
host=192.168.51.81
verify_ssl=0
user=kiara@ProcoliX
password=

View file

@ -25,22 +25,6 @@
"url": null,
"hash": "1w2gsy6qwxa5abkv8clb435237iifndcxq0s79wihqw11a5yb938"
},
"crane": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "ipetkov",
"repo": "crane"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"submodules": false,
"version": "v0.20.3",
"revision": "8468a0c46f81d806fd643ffe389fa80328b21cf4",
"url": "https://api.github.com/repos/ipetkov/crane/tarball/v0.20.3",
"hash": "0zw4275c3a6572w6vjmn850yddw6n3qagwfcq6ns247cx72fdfx0"
},
"disko": {
"type": "GitRelease",
"repository": {
@ -166,32 +150,6 @@
"revision": "f33a4d26226c05d501b9d4d3e5e60a3a59991921",
"url": "https://github.com/nixos/nixpkgs/archive/f33a4d26226c05d501b9d4d3e5e60a3a59991921.tar.gz",
"hash": "1b6dm1sn0bdpcsmxna0zzspjaixa2dald08005fry5jrbjvwafdj"
},
"nixpkgs-stable": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "nixos",
"repo": "nixpkgs"
},
"branch": "nixos-25.05",
"submodules": false,
"revision": "a1ae8ef72f64a845ecce5c6dcf65d546bf7deeb4",
"url": "https://github.com/nixos/nixpkgs/archive/a1ae8ef72f64a845ecce5c6dcf65d546bf7deeb4.tar.gz",
"hash": "0d7lp30wyy5647gpm8rnihvdcpmgmfr9c5yg4fhl31lsg8mlbg16"
},
"proxmox-nixos": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "SaumonNet",
"repo": "proxmox-nixos"
},
"branch": "main",
"submodules": false,
"revision": "48f39fbe2e8f90f9ac160dd4b6929f3ac06d8223",
"url": "https://github.com/SaumonNet/proxmox-nixos/archive/48f39fbe2e8f90f9ac160dd4b6929f3ac06d8223.tar.gz",
"hash": "0606qcs8x1jwckd1ivf52rqdmi3lkn66iiqh6ghd4kqx0g2bw3nv"
}
},
"version": 5