summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2021-07-13 01:38:38 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2021-07-13 01:38:38 +0200
commit3848948f778baea87e52ff8757d54905dd0ccd79 (patch)
treed8f205df1387f9d39d42ffc62ef7e75444a51f4e
parent0e6e4d427616be99574b9537a0fc553ec4cb8b8e (diff)
downloadnixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.tar
nixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.tar.gz
nixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.tar.bz2
nixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.tar.lz
nixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.tar.xz
nixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.tar.zst
nixpkgs-3848948f778baea87e52ff8757d54905dd0ccd79.zip
borgbackup: enable tests, clean up
-rw-r--r--pkgs/tools/backup/borgbackup/default.nix70
1 files changed, 59 insertions, 11 deletions
diff --git a/pkgs/tools/backup/borgbackup/default.nix b/pkgs/tools/backup/borgbackup/default.nix
index 89e1f3e7e47..ad78dcacd78 100644
--- a/pkgs/tools/backup/borgbackup/default.nix
+++ b/pkgs/tools/backup/borgbackup/default.nix
@@ -1,4 +1,15 @@
-{ lib, stdenv, python3, acl, libb2, lz4, zstd, openssl, openssh, nixosTests }:
+{ lib
+, stdenv
+, acl
+, e2fsprogs
+, libb2
+, lz4
+, openssh
+, openssl
+, python3
+, zstd
+, nixosTests
+}:
 
 python3.pkgs.buildPythonApplication rec {
   pname = "borgbackup";
@@ -9,17 +20,33 @@ python3.pkgs.buildPythonApplication rec {
     sha256 = "0x0ncy0b0bmf586hbdgrif3gjmkdw760vfnfxndr493v07y29fbs";
   };
 
+  postPatch = ''
+    # sandbox does not support setuid/setgid/sticky bits
+    substituteInPlace src/borg/testsuite/archiver.py \
+      --replace "0o4755" "0o0755"
+  '';
+
   nativeBuildInputs = with python3.pkgs; [
     setuptools-scm
     # For building documentation:
-    sphinx guzzle_sphinx_theme
+    sphinx
+    guzzle_sphinx_theme
   ];
+
   buildInputs = [
-    libb2 lz4 zstd openssl
-  ] ++ lib.optionals stdenv.isLinux [ acl ];
+    libb2
+    lz4
+    zstd
+    openssl
+  ] ++ lib.optionals stdenv.isLinux [
+    acl
+  ];
+
   propagatedBuildInputs = with python3.pkgs; [
+    cython
+    llfuse
     packaging
-    cython llfuse
+    pyfuse3
   ];
 
   preConfigure = ''
@@ -53,15 +80,36 @@ python3.pkgs.buildPythonApplication rec {
   '';
 
   checkInputs = with python3.pkgs; [
-    pytest
+    e2fsprogs
+    pytest-benchmark
+    pytest-xdist
+    pytestCheckHook
   ];
 
-  checkPhase = ''
-    HOME=$(mktemp -d) py.test --pyargs borg.testsuite
-  '';
+  pytestFlagsArray = [
+    "--numprocesses" "auto"
+    "--benchmark-skip"
+    "--pyargs" "borg.testsuite"
+  ];
 
-  # 64 failures, needs pytest-benchmark
-  doCheck = false;
+  disabledTests = [
+    # fuse: device not found, try 'modprobe fuse' first
+    "test_fuse"
+    "test_fuse_allow_damaged_files"
+    "test_fuse_mount_hardlinks"
+    "test_fuse_mount_options"
+    "test_fuse_versions_view"
+    "test_readonly_mount"
+    # Error: Permission denied while trying to write to /var/{,tmp}
+    "test_get_cache_dir"
+    "test_get_keys_dir"
+    "test_get_security_dir"
+    "test_get_config_dir"
+  ];
+
+  preCheck = ''
+    export HOME=$TEMP
+  '';
 
   passthru.tests = {
     inherit (nixosTests) borgbackup;