Skip to content

Commit

Permalink
Merge pull request #11739 from DeterminateSystems/test-chroot-store
Browse files Browse the repository at this point in the history
Add a test for chroot stores
  • Loading branch information
edolstra authored Oct 23, 2024
2 parents 79bbb4a + 75016c2 commit 28b7ffe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
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

0 comments on commit 28b7ffe

Please sign in to comment.