nixosTests/pleroma: fix test

Two issues:

1. We need a subjectAltName on the TLS cert. Stolen from the akkoma
test. <3 illdefined
2. There's a bug in the current toot release wrt. date parsing. It's
been fixed upstream but it's not been released yet. Using the
current toot master for this VM test to work around this.

Note: I warned upstream we'd need a new toot release.

Fixes https://github.com/NixOS/nixpkgs/issues/264951

authored by Félix Baylac Jacqué and committed by Yaya f80b2b51 c16a6fe2

+18 -3
+18 -3
nixos/tests/pleroma.nix
··· 25 26 import ./make-test-python.nix ({ pkgs, ... }: 27 let 28 send-toot = pkgs.writeScriptBin "send-toot" '' 29 set -eux 30 # toot is using the requests library internally. This library ··· 164 ''; 165 166 tls-cert = pkgs.runCommand "selfSignedCerts" { buildInputs = [ pkgs.openssl ]; } '' 167 - openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -subj '/CN=pleroma.nixos.test' -days 36500 168 mkdir -p $out 169 - cp key.pem cert.pem $out 170 ''; 171 172 hosts = nodes: '' ··· 180 security.pki.certificateFiles = [ "${tls-cert}/cert.pem" ]; 181 networking.extraHosts = hosts nodes; 182 environment.systemPackages = with pkgs; [ 183 - toot 184 send-toot 185 ]; 186 };
··· 25 26 import ./make-test-python.nix ({ pkgs, ... }: 27 let 28 + # Fix for https://github.com/ihabunek/toot/pull/405. Includes 29 + # https://github.com/ihabunek/toot/pull/405. TOREMOVE when 30 + # toot > 0.38.1 31 + patched-toot = pkgs.toot.overrideAttrs (old: { 32 + version = "unstable-24-09-2023"; 33 + src = pkgs.fetchFromGitHub { 34 + owner = "ihabunek"; 35 + repo = "toot"; 36 + rev = "30857f570d64a26da80d0024227a8259f7cb65b5"; 37 + sha256 = "sha256-BxrI7UY9bfqPzS+VLqCFSmu4PkIkvhntcEeNJb1AzOs="; 38 + }; 39 + }); 40 send-toot = pkgs.writeScriptBin "send-toot" '' 41 set -eux 42 # toot is using the requests library internally. This library ··· 176 ''; 177 178 tls-cert = pkgs.runCommand "selfSignedCerts" { buildInputs = [ pkgs.openssl ]; } '' 179 mkdir -p $out 180 + openssl req -x509 \ 181 + -subj '/CN=pleroma.nixos.test/' -days 49710 \ 182 + -addext 'subjectAltName = DNS:pleroma.nixos.test' \ 183 + -keyout "$out/key.pem" -newkey ed25519 \ 184 + -out "$out/cert.pem" -noenc 185 ''; 186 187 hosts = nodes: '' ··· 195 security.pki.certificateFiles = [ "${tls-cert}/cert.pem" ]; 196 networking.extraHosts = hosts nodes; 197 environment.systemPackages = with pkgs; [ 198 + patched-toot 199 send-toot 200 ]; 201 };