tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
xxh: added tests
Pasquale
4 years ago
45db27da
5e9f0c1e
+75
-1
4 changed files
expand all
collapse all
unified
split
nixos
tests
all-tests.nix
xxh.nix
pkgs
tools
networking
xxh
default.nix
top-level
all-packages.nix
+1
nixos/tests/all-tests.nix
···
504
504
xrdp = handleTest ./xrdp.nix {};
505
505
xss-lock = handleTest ./xss-lock.nix {};
506
506
xterm = handleTest ./xterm.nix {};
507
507
+
xxh = handleTest ./xxh.nix {};
507
508
yabar = handleTest ./yabar.nix {};
508
509
yggdrasil = handleTest ./yggdrasil.nix {};
509
510
zfs = handleTest ./zfs.nix {};
+67
nixos/tests/xxh.nix
···
1
1
+
import ./make-test-python.nix ({ pkgs, lib, ... }:
2
2
+
3
3
+
let
4
4
+
inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
5
5
+
xxh-shell-zsh = pkgs.stdenv.mkDerivation {
6
6
+
pname = "xxh-shell-zsh";
7
7
+
version = "";
8
8
+
src = pkgs.fetchFromGitHub {
9
9
+
owner = "xxh";
10
10
+
repo = "xxh-shell-zsh";
11
11
+
# gets rarely updated, we can then just replace the hash
12
12
+
rev = "91e1f84f8d6e0852c3235d4813f341230cac439f";
13
13
+
sha256 = "sha256-Y1FrIRxTd0yooK+ZzKcCd6bLSy5E2fRXYAzrIsm7rIc=";
14
14
+
};
15
15
+
16
16
+
postPatch = ''
17
17
+
substituteInPlace build.sh \
18
18
+
--replace "echo Install wget or curl" "cp ${zsh-portable-binary} zsh-5.8-linux-x86_64.tar.gz" \
19
19
+
--replace "command -v curl" "command -v this-should-not-trigger"
20
20
+
'';
21
21
+
22
22
+
installPhase = ''
23
23
+
mkdir -p $out
24
24
+
mv * $out/
25
25
+
'';
26
26
+
};
27
27
+
28
28
+
zsh-portable-binary = pkgs.fetchurl {
29
29
+
# kept in sync with https://github.com/xxh/xxh-shell-zsh/tree/master/build.sh#L27
30
30
+
url = "https://github.com/romkatv/zsh-bin/releases/download/v3.0.1/zsh-5.8-linux-x86_64.tar.gz";
31
31
+
sha256 = "sha256-i8flMd2Isc0uLoeYQNDnOGb/kK3oTFVqQgIx7aOAIIo=";
32
32
+
};
33
33
+
in
34
34
+
{
35
35
+
name = "xxh";
36
36
+
meta = with lib.maintainers; {
37
37
+
maintainers = [ lom ];
38
38
+
};
39
39
+
40
40
+
nodes = {
41
41
+
server = { ... }: {
42
42
+
services.openssh.enable = true;
43
43
+
users.users.root.openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
44
44
+
};
45
45
+
46
46
+
client = { ... }: {
47
47
+
programs.zsh.enable = true;
48
48
+
users.users.root.shell = pkgs.zsh;
49
49
+
environment.systemPackages = with pkgs; [ xxh git ];
50
50
+
};
51
51
+
};
52
52
+
53
53
+
testScript = ''
54
54
+
start_all()
55
55
+
56
56
+
client.succeed("mkdir -m 700 /root/.ssh")
57
57
+
58
58
+
client.succeed(
59
59
+
"cat ${snakeOilPrivateKey} > /root/.ssh/id_ecdsa"
60
60
+
)
61
61
+
client.succeed("chmod 600 /root/.ssh/id_ecdsa")
62
62
+
63
63
+
server.wait_for_unit("sshd")
64
64
+
65
65
+
client.succeed("xxh server -i /root/.ssh/id_ecdsa +hc \'echo $0\' +i +s zsh +I xxh-shell-zsh+path+${xxh-shell-zsh} | grep -Fq '/root/.xxh/.xxh/shells/xxh-shell-zsh/build/zsh-bin/bin/zsh'")
66
66
+
'';
67
67
+
})
+5
-1
pkgs/tools/networking/xxh/default.nix
···
1
1
-
{ lib, fetchFromGitHub, buildPythonApplication, pexpect, pyyaml, openssh }:
1
1
+
{ lib, fetchFromGitHub, buildPythonApplication, pexpect, pyyaml, openssh, nixosTests }:
2
2
3
3
buildPythonApplication rec{
4
4
pname = "xxh";
···
12
12
};
13
13
14
14
propagatedBuildInputs = [ pexpect pyyaml openssh ];
15
15
+
16
16
+
passthru.tests = {
17
17
+
inherit (nixosTests) xxh;
18
18
+
};
15
19
16
20
meta = with lib; {
17
21
description = "Bring your favorite shell wherever you go through ssh";
+2
pkgs/top-level/all-packages.nix
···
29219
29219
gtk = gtk2;
29220
29220
};
29221
29221
29222
29222
+
xxh = with python3Packages; toPythonApplication xxh;
29223
29223
+
29222
29224
kodiPackages = recurseIntoAttrs (kodi.packages);
29223
29225
29224
29226
kodi = callPackage ../applications/video/kodi {