Skip to content

nixosTests: fix tests that relies on an empty rootfs using a bootloader#234030

Merged
RaitoBezarius merged 11 commits intomasterfrom
cleanup-overlay-mounts
Jun 8, 2023
Merged

nixosTests: fix tests that relies on an empty rootfs using a bootloader#234030
RaitoBezarius merged 11 commits intomasterfrom
cleanup-overlay-mounts

Conversation

@RaitoBezarius
Copy link
Member

@RaitoBezarius RaitoBezarius commented May 25, 2023

Description of changes

Some tests relies on booting on an empty rootfs to do their verification, this is not supported under useBootLoader = true; by default which expect you want a "full system image" with a proper Nix store.

Therefore, to make this work, we re-enable the host nix store.

A cleanup for overlay is included in this change, I will drop it.

Fixes the fallout for #227881.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels May 25, 2023
@RaitoBezarius
Copy link
Member Author

All of them were tested manually.

@RaitoBezarius RaitoBezarius force-pushed the cleanup-overlay-mounts branch from eb4b238 to 076e8b3 Compare May 25, 2023 17:21
@github-actions github-actions bot removed the 8.has: module (update) This PR changes an existing module in `nixos/` label May 25, 2023
@RaitoBezarius
Copy link
Member Author

@ofborg test nixosTests.initrd-luks-empty-passphrase

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 25, 2023
@ElvishJerricco
Copy link
Contributor

@RaitoBezarius Probably needs to hit nixos/tests/lvm2/systemd-stage-1.nix too, so that this PR can supersede #230366

@nikstur
Copy link
Contributor

nikstur commented May 25, 2023

useBootLoader does not seems like a good abstraction. Maybe we should have useDiskImage to create a full disk image and useBootLoader to actually perform the installation of the boot loader and by default enable useDiskImage? Anyway just a thought, nothing actionable for this PR.

@RaitoBezarius
Copy link
Member Author

@ofborg test initrd-luks-empty-passphrase

@RaitoBezarius
Copy link
Member Author

@RaitoBezarius Probably needs to hit nixos/tests/lvm2/systemd-stage-1.nix too, so that this PR can supersede #230366

Fixing it.

Copy link
Contributor

@nikstur nikstur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mweinelt mweinelt added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 2, 2023
Copy link
Member

@lheckemann lheckemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides what @nikstur has already pointed out

@nikstur
Copy link
Contributor

nikstur commented Jun 4, 2023

These tests also need this fix:

  • nixos/tests/luks.nix
  • nixos/tests/lvm2/systemd-stage-1.nix

This is necessary because this test relies on switching the root fs to an empty one which
does not have a Nix store available in stage 1, therefore, we have to make this test
host-store only.

A better fix in the long term is to evaluate whether this is worth to enable a proper
Nix store image for it with EROFS?
@RaitoBezarius RaitoBezarius force-pushed the cleanup-overlay-mounts branch from 0be1d20 to 89952f7 Compare June 8, 2023 14:56
@RaitoBezarius
Copy link
Member Author

RaitoBezarius commented Jun 8, 2023

These tests also need this fix:

  • nixos/tests/luks.nix
  • nixos/tests/lvm2/systemd-stage-1.nix

lvm2-sd1 is already working. Thinpool is broken for unrelated reasons but maintainers didn't get back to me, cc @ajs124.

LUKS is fixed now, this is ready.

@nikstur
Copy link
Contributor

nikstur commented Jun 8, 2023

I'm quite certain that at least nixosTests.lvm2.lvm-raid-sd-stage-1-linux-latest needs the mountHostNixStore fix. Just tested it again on nixos-unstable.

@RaitoBezarius
Copy link
Member Author

I'm quite certain that at least nixosTests.lvm2.lvm-raid-sd-stage-1-linux-latest needs the mountHostNixStore fix. Just tested it again on nixos-unstable.

which is here: ff3936e right ?

@RaitoBezarius
Copy link
Member Author

@ofborg test nixosTests.lvm2.lvm-raid-sd-stage-1-linux-latest

@RaitoBezarius
Copy link
Member Author

@ofborg test lvm2.lvm-raid-sd-stage-1-linux-latest

@nikstur
Copy link
Contributor

nikstur commented Jun 8, 2023

I'm quite certain that at least nixosTests.lvm2.lvm-raid-sd-stage-1-linux-latest needs the mountHostNixStore fix. Just tested it again on nixos-unstable.

which is here: ff3936e right ?

Ah sorry, somehow, overlooked this multiple times.

@RaitoBezarius RaitoBezarius merged commit a384c9b into master Jun 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

Development

Successfully merging this pull request may close these issues.

5 participants