]> Git — Sourcephile - sourcephile-nix.git/blob - tests.nix
sourcehut: commit upstream NixOS modules
[sourcephile-nix.git] / tests.nix
1 # Run with : nix run -f tests.nix
2 # Debug with : nix -L run -f tests.nix driver -c nixos-test-driver
3 { system ? builtins.currentSystem,
4 config ? {},
5 overlays ? nixpkgs/overlays.nix,
6 pkgs ? import <nixpkgs> { inherit system config overlays; },
7 lib ? pkgs.lib,
8 }:
9
10 let nixosTest =
11 (import (pkgs.path + /nixos/lib/testing-python.nix)) {
12 inherit system pkgs;
13 extraConfigurations = [
14 ({ lib, ... }: {
15 # Propagate pkgs and its overlays to the VM,
16 # instead of reloading nixpkgs.
17 config.nixpkgs.pkgs = lib.mkDefault pkgs;
18 config.documentation.enable = false;
19 })
20 ];
21 };
22 in
23
24 nixosTest.makeTest {
25 nodes = {
26 mermet = {pkgs, ...}@attrs: {};
27 };
28
29 #enableOCR = true;
30 #skipLint = true;
31 testScript = ''
32 # start_all()
33 mermet.start()
34 mermet.wait_for_unit("multi-user.target")
35 mermet.succeed(
36 "mkdir /tmp/test",
37 "mount -t tmpfs none /tmp/test",
38 "touch /tmp/test/hello",
39 "test -f /tmp/test/hello",
40 )
41 '';
42 }