Merge pull request #11739 from DeterminateSystems/test-chroot-store

Add a test for chroot stores
This commit is contained in:
Eelco Dolstra 2024-10-23 13:38:19 +02:00 committed by GitHub
commit 28b7ffe5eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 1 deletions

View file

@ -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")
'';
}

View file

@ -161,4 +161,6 @@ in
cgroups = runNixOSTestFor "x86_64-linux" ./cgroups; cgroups = runNixOSTestFor "x86_64-linux" ./cgroups;
fetchurl = runNixOSTestFor "x86_64-linux" ./fetchurl.nix; fetchurl = runNixOSTestFor "x86_64-linux" ./fetchurl.nix;
chrootStore = runNixOSTestFor "x86_64-linux" ./chroot-store.nix;
} }

View file

@ -12,7 +12,7 @@ let
storeUrl = "s3://my-cache?endpoint=http://server:9000&region=eu-west-1"; storeUrl = "s3://my-cache?endpoint=http://server:9000&region=eu-west-1";
in { in {
name = "nix-copy-closure"; name = "s3-binary-cache-store";
nodes = nodes =
{ server = { server =