Conversation
81e7333 to
102bc20
Compare
|
Very cool. Misleading title though. Repairing netboot testing is just a side effect of the change :D |
102bc20 to
c292c54
Compare
heh, I take any suggestions :) It's still WIP because I have some semantic issues with the solutions. |
|
Testing with the second to last commit as instructed, my VM is still being created with a block device where AIUI there shouldn't be one: nixosTest {
name = "test";
nodes.machine = {
imports = [ nixos/modules/installer/netboot/netboot-minimal.nix ];
virtualisation.diskImage = null;
virtualisation.useNixStoreImage = true;
virtualisation.mountHostNixStore = false;
};
testScript = "machine.fail('stat /dev/vda')";
}It looks like |
bda04d7 to
e765786
Compare
e765786 to
b2625a7
Compare
b2625a7 to
2499de7
Compare
9e37f60 to
c71fbaa
Compare
|
Can you rebase this? |
c71fbaa to
74064b6
Compare
|
It seems like neither |
|
You're right, this deserves more investigation. |
|
@alyssais do you have some more insight on what is currently broken for netbooting? |
|
It's not that netboot tests are broken, it's that |
ff45b56 to
e971b6b
Compare
|
So really:
Next commits, AFAIK, are pretty much uncontroversial, right? |
This one shouldn't be required anymore since you can set |
How does that work when you want to keep the virtualization filesystems, and you want to override yours? (remember: my usecase is a bit different from yours :P — I need the intelligence of qemu-vm.nix and the netboot mechanism) |
Sometimes, you would like to inherit from the VM framework and your user code because you know better than the VM framework rather than replacing wholesale the fileSystems module. This came up for netboot testing needs.
This verifies that we can direct boot a netboot image as expected.
…hardcoding `initrd`, disable compression for initrd
e971b6b to
95582ad
Compare
|
PTAL @nikstur. I moved the irrelevant stuff and fixed the direct boot test again. |
nikstur
left a comment
There was a problem hiding this comment.
The description of the PR doesn't really fit anymore. You're not really reparing anything and also not cleaning up the old infrastructure. Instead you're adding a new direct boot test (which I still think is worthwhile).
|
|
||
| # We only want to set those options in the context of | ||
| # the QEMU infrastructure. | ||
| virtualisation = lib.optionalAttrs (options ? virtualisation.directBoot) { |
There was a problem hiding this comment.
I don't really understand why we need to set this here. If this needs to be re-usable between tests it should be a fixure in tests/common IMO
| # filesystems don't necessarily exist in the VM). You can disable this | ||
| # override by setting `virtualisation.fileSystems = lib.mkForce { };`. | ||
| fileSystems = lib.mkIf (cfg.fileSystems != { }) (mkVMOverride cfg.fileSystems); | ||
| fileSystems = lib.mkIf (cfg.fileSystems != { }) (lib.mapAttrs (n: v: mkVMOverride v) cfg.fileSystems); |
There was a problem hiding this comment.
Not sure if we really need this. You could just set virtualisation.fileSystems to { } to use just the ones defined in netboot.nix. Is there actually a good reason to mix the ones defined by qemu-vm.nix and netboot.nix?
| imports = [ ../modules/installer/netboot/netboot-minimal.nix ]; | ||
| virtualisation.memorySize = 4096; | ||
| }; | ||
| testScript = "machine.fail('stat /dev/vda')"; |
There was a problem hiding this comment.
We can probably do better than this. What about checking whether the nix store is mounted via a loop device? That's more of a key characteristic of netboot for me.
Description of changes
This repairs netboot testing, performs some cleanup to move to modern QEMU test infrastructure.
Depends on #228047.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)