From 2af435b5cd74140bf8ee6c476793ee6ed7c1cba4 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 18 Dec 2014 13:14:02 +0100 Subject: [PATCH] nixos/tests/blivet: Fix by avoiding "nix-store". The "nix-store" command within the VM test is running without NIX_REMOTE=daemon and since Nix 1.8 tries to open the store database in read-write mode even for nix-store -qR. Now, we're doing this properly and rely on setup hooks, which is the same method that's used when you're building a library which depends on blivet. Signed-off-by: aszlig --- nixos/tests/blivet.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nixos/tests/blivet.nix b/nixos/tests/blivet.nix index acaf4fec614f..72c2a33f87eb 100644 --- a/nixos/tests/blivet.nix +++ b/nixos/tests/blivet.nix @@ -43,11 +43,6 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.pythonPackages; rec { TMPDIR=/tmp/xchg/bigtmp export TMPDIR - mkPythonPath() { - nix-store -qR "$@" \ - | sed -e 's|$|/lib/${pkgs.python.libPrefix}/site-packages|' - } - cp -Rd "${blivet.src}/tests" . # Skip SELinux tests @@ -73,8 +68,11 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.pythonPackages; rec { -e 's|_STORE_FILE_PATH = .*|_STORE_FILE_PATH = tempfile.gettempdir()|' \ tests/loopbackedtestcase.py - PYTHONPATH=".:$(mkPythonPath "${blivet}" "${mock}" | paste -sd :)" \ - python "${pythonTestRunner}" + PYTHONPATH=".:$(< "${pkgs.stdenv.mkDerivation { + name = "blivet-pythonpath"; + buildInputs = [ blivet mock ]; + buildCommand = "echo \"$PYTHONPATH\" > \"$out\""; + }}")" python "${pythonTestRunner}" ''; testScript = ''