From dd166e5a4d4349241aa3408c8d7f7340cb0a90fb Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 14 Nov 2026 00:33:20 +0000 Subject: tests: populate's tests of its own, krops' using them populate's tests are in pkgs/populate/tests, independent of krops. They run the program, with the sources as JSON from populate's Nix library, and target strings for the remote targets, leaving the user and whether the target is local to populate, so they cover its command line too. Phases expecting populate to refuse its arguments, e.g. a source name or a target path that can't be used, expect the program's refusal, with refused, the message, since nothing checks them during evaluation there. builder.nix is what builds the scenarios, which krops' tests use as well, with a function running the phases, and whether that checks the arguments during evaluation. vm.nix takes a module for both machines, for what else the scenarios run, and fixtures.nix and smoke.nix are what both use of the fixtures and the smoke test. krops' tests are deploy, writeDeploy's arguments to nixos-rebuild, with the stand-in for nixos-rebuild in the module, and populate, populate's scenarios that expect refusals, which pkgs.populate makes evaluation fail with, and those of populate's smoke test, all through pkgs.populate with target attribute sets as mkTarget returns them. -A only selects from all of populate's scenarios and krops' own. --- pkgs/populate/tests/rsync.nix | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkgs/populate/tests/rsync.nix (limited to 'pkgs/populate/tests/rsync.nix') diff --git a/pkgs/populate/tests/rsync.nix b/pkgs/populate/tests/rsync.nix new file mode 100644 index 0000000..6c14048 --- /dev/null +++ b/pkgs/populate/tests/rsync.nix @@ -0,0 +1,50 @@ +# rsync versions whose behaviour around .rsync-filter files differs: 3.4.1 +# reads them like the files it transfers, and 3.5.0 opens them more +# strictly. The tests run the scenarios depending on that with each, +# whatever version nixpkgs has. rsync's own test suite doesn't run: these +# builds only need to behave like the releases. +{ lib, stdenv, fetchurl, fetchpatch, perl, updateAutotoolsGnuConfigScriptsHook +, acl, libiconv, popt, zlib +}: + +let + rsync = { version, hash, patches ? [] }: stdenv.mkDerivation { + pname = "rsync"; + inherit version patches; + src = fetchurl { + # signed with key 9FEF 112D CE19 A0DC 7E88 2CB8 1BB2 4997 A853 5F6F + url = "mirror://samba/rsync/src/rsync-${version}.tar.gz"; + inherit hash; + }; + nativeBuildInputs = [ perl updateAutotoolsGnuConfigScriptsHook ]; + # With ACLs and extended attributes, which backups use (rsync -aAX). + buildInputs = [ acl libiconv popt zlib ]; + configureFlags = [ + "--disable-lz4" + "--disable-openssl" + "--disable-xxhash" + "--disable-zstd" + "--enable-ipv6" + "--with-included-zlib=no" + "--with-nobody-group=nogroup" + ]; + enableParallelBuilding = true; + meta.mainProgram = "rsync"; + }; +in { + "3.4.1" = rsync { + version = "3.4.1"; + hash = "sha256-KSS8s6Hti1UfwQH3QLnw/gogKxFQJ2R89phQ1l/YjFI="; + patches = [ + # Compilation with GCC 15. + (fetchpatch { + url = "https://github.com/RsyncProject/rsync/commit/a4b926dcdce96b0f2cc0dc7744e95747b233500a.patch"; + hash = "sha256-UiEQJ+p2gtIDYNJqnxx4qKgItKIZzCpkHnvsgoxBmSE="; + }) + ]; + }; + "3.5.0" = rsync { + version = "3.5.0"; + hash = "sha256-x//R72U+mVQPZh5HywC3+crR7muXI5mxb5PWcmVuDTM="; + }; +} -- cgit v1.3.1