1 # Take note the Guix store directory is empty. Also, we're trying to prevent
2 # Guix from trying to downloading substitutes because of the restricted
3 # access (assuming it's in a sandboxed environment).
5 # So this test is what it is: a basic test while trying to use Guix as much as
6 # we possibly can (including the API) without triggering its download alarm.
8 import ../make-test-python.nix (
12 meta.maintainers = with lib.maintainers; [ foo-dogsquared ];
17 environment.etc."guix/scripts".source = ./scripts;
27 machine.wait_for_unit("multi-user.target")
28 machine.wait_for_unit("guix-daemon.service")
29 machine.succeed("systemctl start guix-gc.service")
31 # Can't do much here since the environment has restricted network access.
32 with subtest("Guix basic package management"):
33 machine.succeed("guix build --dry-run --verbosity=0 hello")
34 machine.succeed("guix show hello")
36 # This is to see if the Guix API is usable and mostly working.
37 with subtest("Guix API scripting"):
38 scripts_dir = pathlib.Path("/etc/guix/scripts")
40 text_msg = "Hello there, NixOS!"
41 text_store_file = machine.succeed(f"guix repl -- {scripts_dir}/create-file-to-store.scm '{text_msg}'")
42 assert machine.succeed(f"cat {text_store_file}") == text_msg
44 machine.succeed(f"guix repl -- {scripts_dir}/add-existing-files-to-store.scm {scripts_dir}")