summaryrefslogtreecommitdiffstats
path: root/tests/clamav.nix
diff options
context:
space:
mode:
authorXavier Vello <xavier.vello@gmail.com>2019-12-14 19:04:20 +0100
committerXavier Vello <xavier.vello@gmail.com>2019-12-14 22:22:23 +0100
commit5fb707e61a0eea3b3f855efbd8e1b2e70b85bf5c (patch)
treee3d756015adbd4c5d5681187a4e0dc45bf80cc3d /tests/clamav.nix
parent81e4a49708ec3f9c0c5849f88f0282feb4a8bc95 (diff)
Update clamav test to use local fixtures
The current version fetches clamav-db-files from gitlab, in the master branch. This is currently broken as the files were removed, and does not allow to ensure a fixture update does not break the test
Diffstat (limited to 'tests/clamav.nix')
-rw-r--r--tests/clamav.nix26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/clamav.nix b/tests/clamav.nix
index 434b196..955d1ac 100644
--- a/tests/clamav.nix
+++ b/tests/clamav.nix
@@ -19,17 +19,15 @@ import <nixpkgs/nixos/tests/make-test.nix> {
nodes = {
server = { config, pkgs, lib, ... }:
let
- clamav-db-files = lib.mapAttrs (name: value: pkgs.stdenv.mkDerivation rec {
- inherit name;
-
- src = pkgs.fetchurl {
- url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/raw/master/tests/clamav/${name}";
- sha256 = value;
- };
-
- unpackPhase = "true"; # don't try to unpack the raw .cvd files
- installPhase = "cp $src $out";
- }) (builtins.fromJSON (builtins.readFile ./clamav/hashes.json));
+ clamav-db-files = pkgs.stdenv.mkDerivation rec {
+ name = "clamav-db-files";
+ src = lib.cleanSource ./clamav;
+ dontUnpack = true;
+ installPhase = ''
+ mkdir $out
+ cp -R $src/*.cvd $out/
+ '';
+ };
in
{
imports = [
@@ -58,9 +56,9 @@ import <nixpkgs/nixos/tests/make-test.nix> {
'';
script = ''
- cp ${clamav-db-files."bytecode.cvd"} /var/lib/clamav/
- cp ${clamav-db-files."main.cvd"} /var/lib/clamav/
- cp ${clamav-db-files."daily.cvd"} /var/lib/clamav/
+ cp ${clamav-db-files}/main.cvd /var/lib/clamav/
+ cp ${clamav-db-files}/daily.cvd /var/lib/clamav/
+ cp ${clamav-db-files}/bytecode.cvd /var/lib/clamav/
chown clamav:clamav /var/lib/clamav/*
'';