mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Add a test for chroot stores
This commit is contained in:
parent
e09666d314
commit
75016c26f9
2 changed files with 33 additions and 0 deletions
31
tests/nixos/chroot-store.nix
Normal file
31
tests/nixos/chroot-store.nix
Normal 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")
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue