tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lsd: move nixos test to installCheckPhase
Mrinal Purohit
4 years ago
ff2ad643
8793bbc7
+12
-15
3 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
lsd.nix
pkgs
tools
misc
lsd
default.nix
-1
nixos/tests/all-tests.nix
···
237
237
locate = handleTest ./locate.nix {};
238
238
login = handleTest ./login.nix {};
239
239
loki = handleTest ./loki.nix {};
240
240
-
lsd = handleTest ./lsd.nix {};
241
240
lxd = handleTest ./lxd.nix {};
242
241
lxd-nftables = handleTest ./lxd-nftables.nix {};
243
242
#logstash = handleTest ./logstash.nix {};
-12
nixos/tests/lsd.nix
···
1
1
-
import ./make-test-python.nix ({ pkgs, ... }: {
2
2
-
name = "lsd";
3
3
-
meta = with pkgs.lib.maintainers; { maintainers = [ nequissimus ]; };
4
4
-
5
5
-
nodes.lsd = { pkgs, ... }: { environment.systemPackages = [ pkgs.lsd ]; };
6
6
-
7
7
-
testScript = ''
8
8
-
lsd.succeed('echo "abc" > /tmp/foo')
9
9
-
assert "4 B /tmp/foo" in lsd.succeed('lsd --classic --blocks "size,name" -l /tmp/foo')
10
10
-
assert "lsd ${pkgs.lsd.version}" in lsd.succeed("lsd --version")
11
11
-
'';
12
12
-
})
+12
-2
pkgs/tools/misc/lsd/default.nix
···
1
1
{ lib
2
2
-
, nixosTests
3
2
, fetchFromGitHub
4
3
, rustPlatform
5
4
, installShellFiles
···
26
25
# Found argument '--test-threads' which wasn't expected, or isn't valid in this context
27
26
doCheck = false;
28
27
29
29
-
passthru.tests = { inherit (nixosTests) lsd; };
28
28
+
doInstallCheck = true;
29
29
+
installCheckPhase = ''
30
30
+
runHook preInstallCheck
31
31
+
32
32
+
testFile=$(mktemp /tmp/lsd-test.XXXX)
33
33
+
echo 'abc' > $testFile
34
34
+
$out/bin/lsd --classic --blocks "size,name" -l $testFile | grep "4 B $testFile"
35
35
+
$out/bin/lsd --version | grep "${version}"
36
36
+
rm $testFile
37
37
+
38
38
+
runHook postInstallCheck
39
39
+
'';
30
40
31
41
meta = with lib; {
32
42
homepage = "https://github.com/Peltoche/lsd";