You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
591 B
Nix

2 years ago
{
writeShellScript,
python3,
pkgs,
lib,
coreutils,
systemd,
2 years ago
}: let
systemd-vaultd = pkgs.callPackage ../../default.nix {};
in
writeShellScript "unittests" ''
set -eu -o pipefail
export PATH=${lib.makeBinPath [python3.pkgs.pytest coreutils systemd]}
2 years ago
export SYSTEMD_VAULTD_BIN=${systemd-vaultd}/bin/systemd-vaultd
export TMPDIR=$(mktemp -d)
trap 'rm -rf $TMPDIR' EXIT
cp --no-preserve=mode --preserve=timestamps -r ${../..} "$TMPDIR/source"
cd "$TMPDIR/source"
pytest -s ./tests
# we need this in our nixos tests
touch /tmp/success
''