diff options
Diffstat (limited to 'tests/default.nix')
| -rw-r--r-- | tests/default.nix | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/tests/default.nix b/tests/default.nix index 7b82bce..3dabee9 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -11,29 +11,55 @@ let gitHead = "e42d44ef9cdb76ba5a84dff4c89c38222703bf0c"; gitFirst = "8d47013fa0888948cf0ffcc4e3c69a7b5f180562"; - scenarios = import ./scenarios.nix { + # rsync versions the scenarios depending on rsync's version run with. + # callPackage adds override and overrideDerivation, which aren't versions. + rsyncs = pkgs.lib.filterAttrs + (_: pkgs.lib.isDerivation) + (pkgs.callPackage ./rsync.nix {}); + + # The scenarios, with populate using rsync. + scenariosWith = rsync: import ./scenarios.nix { inherit (pkgs) lib; krops = import ../lib; - inherit (pkgs) populate; + populate = pkgs.populate.override { inherit rsync; }; inherit (pkgs.krops) writeDeploy; url = "http://deployer:8000"; gitUrl = "git://deployer/gitsrc.git"; remoteHost = "target"; agePath = "${pkgs.age}/bin/age"; inherit gitHead gitFirst; - rsyncVersion = pkgs.rsync.version; + rsyncVersion = rsync.version; }; + scenarios = scenariosWith pkgs.rsync; flakeJq = import ../pkgs/populate/flake-jq.nix; in builtins.mapAttrs (name: scenarios: import ./vm.nix { inherit pkgs name scenarios gitHead; }) scenarios + // pkgs.lib.mapAttrs' + (version: rsync: { + name = "rsync-${builtins.replaceStrings [ "." ] [ "-" ] version}"; + value = import ./vm.nix { + inherit pkgs gitHead rsync; + name = "rsync-${version}"; + scenarios = builtins.filter + (scenario: pkgs.lib.hasInfix "insecureLinks" scenario.name) + (scenariosWith rsync).file; + }; + }) + rsyncs // { # Lock files in the shapes different versions of Nix write. - jq = pkgs.runCommand "krops-jq" { nativeBuildInputs = [ pkgs.jq ]; } '' + jq = pkgs.runCommand "krops-jq" { + nativeBuildInputs = [ pkgs.jq pkgs.nix ]; + } '' sh ${./jq.sh} ${pkgs.linkFarm "krops-flake-jq" (map (name: { name = "${name}.jq"; path = pkgs.writeText "${name}.jq" flakeJq.${name}; }) - [ "selected" "selfIsRemote" "selfLocked" ])} + [ "selected" "selfIsRemote" "selfLocked" ] + ++ [{ + name = "metadataSubdir.nix"; + path = pkgs.writeText "metadataSubdir.nix" flakeJq.metadataSubdir; + }])} touch $out ''; } |
