1 import ./make-test-python.nix ({ pkgs, ... }:
4 hashes = pkgs.writeText "hashes" ''
5 b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c /project/bar
10 meta = with pkgs.lib.maintainers; {
11 maintainers = [ tilpner ];
17 networking.firewall.allowedTCPPorts = [ config.services.gitDaemon.port ];
19 environment.systemPackages = [ pkgs.git ];
21 systemd.tmpfiles.rules = [
22 # type path mode user group age arg
23 " d /git 0755 root root - -"
26 services.gitDaemon = {
34 environment.systemPackages = [ pkgs.git ];
41 with subtest("create project.git"):
43 "git init --bare /git/project.git",
44 "touch /git/project.git/git-daemon-export-ok",
47 with subtest("add file to project.git"):
49 "git clone /git/project.git /project",
50 "echo foo > /project/bar",
51 "git config --global user.email 'you@example.com'",
52 "git config --global user.name 'Your Name'",
53 "git -C /project add bar",
54 "git -C /project commit -m 'quux'",
55 "git -C /project push",
59 with subtest("git daemon starts"):
60 server.wait_for_unit("git-daemon.service")
62 server.wait_for_unit("network-online.target")
63 client.wait_for_unit("network-online.target")
65 with subtest("client can clone project.git"):
67 "git clone git://server/project.git /project",
68 "sha256sum -c ${hashes}",