Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for chroot stores #11739

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests/nixos/chroot-store.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ lib, config, nixpkgs, ... }:

let
pkgs = config.nodes.machine.nixpkgs.pkgs;
pkgA = pkgs.hello;
pkgB = pkgs.cowsay;
in {
name = "chroot-store";

nodes =
{ machine =
{ config, lib, pkgs, ... }:
{ virtualisation.writableStore = true;
virtualisation.additionalPaths = [ pkgA ];
environment.systemPackages = [ pkgB ];
nix.extraOptions = "experimental-features = nix-command";
};
};

testScript = { nodes }: ''
# fmt: off
start_all()

machine.succeed("nix copy --no-check-sigs --to /tmp/nix ${pkgA}")

machine.succeed("nix shell --store /tmp/nix ${pkgA} --command hello >&2")

# Test that /nix/store is available via an overlayfs mount.
machine.succeed("nix shell --store /tmp/nix ${pkgA} --command cowsay foo >&2")
'';
}
2 changes: 2 additions & 0 deletions tests/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,6 @@ in
cgroups = runNixOSTestFor "x86_64-linux" ./cgroups;

fetchurl = runNixOSTestFor "x86_64-linux" ./fetchurl.nix;

chrootStore = runNixOSTestFor "x86_64-linux" ./chroot-store.nix;
}
2 changes: 1 addition & 1 deletion tests/nixos/s3-binary-cache-store.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let
storeUrl = "s3://my-cache?endpoint=http://server:9000&region=eu-west-1";

in {
name = "nix-copy-closure";
name = "s3-binary-cache-store";

nodes =
{ server =
Expand Down
Loading