lol

nixosTests.forgejo: test git wire protocol version

Co-Authored-By: networkException <git@nwex.de>

+6
+6
nixos/tests/forgejo.nix
··· 77 77 dumpFile = with nodes.server.specialisation.dump.configuration.services.forgejo.dump; "${backupDir}/${file}"; 78 78 in 79 79 '' 80 + import json 80 81 GIT_SSH_COMMAND = "ssh -i $HOME/.ssh/privk -o StrictHostKeyChecking=no" 81 82 REPO = "forgejo@server:test/repo" 82 83 PRIVK = "${snakeOilPrivateKey}" ··· 145 146 client2.succeed("chmod 0400 $HOME/.ssh/privk") 146 147 client2.succeed(f"GIT_SSH_COMMAND='{GIT_SSH_COMMAND}' git clone {REPO}") 147 148 client2.succeed('test "$(cat repo/testfile | xargs echo -n)" = "hello world"') 149 + 150 + with subtest("Testing git protocol version=2 over ssh"): 151 + git_protocol = client2.succeed(f"GIT_SSH_COMMAND='{GIT_SSH_COMMAND}' GIT_TRACE2_EVENT=true git -C repo fetch |& grep negotiated-version") 152 + version = json.loads(git_protocol).get("value") 153 + assert version == "2", f"git did not negotiate protocol version 2, but version {version} instead." 148 154 149 155 server.wait_until_succeeds( 150 156 'test "$(curl http://localhost:3000/api/v1/repos/test/repo/commits '