parent
77b584d61f
commit
7be89c1891
@ -1337,7 +1337,7 @@ in {
|
|||||||
xpadneo = runTest ./xpadneo.nix;
|
xpadneo = runTest ./xpadneo.nix;
|
||||||
xrdp = runTest ./xrdp.nix;
|
xrdp = runTest ./xrdp.nix;
|
||||||
xrdp-with-audio-pulseaudio = runTest ./xrdp-with-audio-pulseaudio.nix;
|
xrdp-with-audio-pulseaudio = runTest ./xrdp-with-audio-pulseaudio.nix;
|
||||||
xscreensaver = handleTest ./xscreensaver.nix {};
|
xscreensaver = runTest ./xscreensaver.nix;
|
||||||
xss-lock = runTest ./xss-lock.nix;
|
xss-lock = runTest ./xss-lock.nix;
|
||||||
xterm = runTest ./xterm.nix;
|
xterm = runTest ./xterm.nix;
|
||||||
xxh = runTest ./xxh.nix;
|
xxh = runTest ./xxh.nix;
|
||||||
|
@ -1,81 +1,81 @@
|
|||||||
import ./make-test-python.nix (
|
{ lib, ... }:
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
{
|
name = "pass-secret-service";
|
||||||
name = "pass-secret-service";
|
meta.maintainers = with lib.maintainers; [
|
||||||
meta.maintainers = with lib.maintainers; [
|
vancluever
|
||||||
vancluever
|
];
|
||||||
];
|
|
||||||
|
|
||||||
nodes = {
|
node.pkgsReadOnly = false;
|
||||||
ok =
|
|
||||||
{ nodes, pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./common/x11.nix
|
|
||||||
./common/user-account.nix
|
|
||||||
];
|
|
||||||
test-support.displayManager.auto.user = "alice";
|
|
||||||
services.xscreensaver.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
empty_wrapperPrefix =
|
nodes = {
|
||||||
{ nodes, pkgs, ... }:
|
ok =
|
||||||
{
|
{ nodes, pkgs, ... }:
|
||||||
imports = [
|
{
|
||||||
./common/x11.nix
|
imports = [
|
||||||
./common/user-account.nix
|
./common/x11.nix
|
||||||
];
|
./common/user-account.nix
|
||||||
test-support.displayManager.auto.user = "alice";
|
];
|
||||||
services.xscreensaver.enable = true;
|
test-support.displayManager.auto.user = "alice";
|
||||||
nixpkgs.overlays = [
|
services.xscreensaver.enable = true;
|
||||||
(self: super: {
|
};
|
||||||
xscreensaver = super.xscreensaver.override {
|
|
||||||
wrapperPrefix = "";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
bad_wrapperPrefix =
|
empty_wrapperPrefix =
|
||||||
{ nodes, pkgs, ... }:
|
{ nodes, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common/x11.nix
|
./common/x11.nix
|
||||||
./common/user-account.nix
|
./common/user-account.nix
|
||||||
];
|
];
|
||||||
test-support.displayManager.auto.user = "alice";
|
test-support.displayManager.auto.user = "alice";
|
||||||
services.xscreensaver.enable = true;
|
services.xscreensaver.enable = true;
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(self: super: {
|
(self: super: {
|
||||||
xscreensaver = super.xscreensaver.override {
|
xscreensaver = super.xscreensaver.override {
|
||||||
wrapperPrefix = "/a/bad/path";
|
wrapperPrefix = "";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
bad_wrapperPrefix =
|
||||||
ok.wait_for_x()
|
{ nodes, pkgs, ... }:
|
||||||
ok.wait_for_unit("xscreensaver", "alice")
|
{
|
||||||
_, output_ok = ok.systemctl("status xscreensaver", "alice")
|
imports = [
|
||||||
assert 'To prevent the kernel from randomly unlocking' not in output_ok
|
./common/x11.nix
|
||||||
assert 'your screen via the out-of-memory killer' not in output_ok
|
./common/user-account.nix
|
||||||
assert '"xscreensaver-auth" must be setuid root' not in output_ok
|
];
|
||||||
|
test-support.displayManager.auto.user = "alice";
|
||||||
|
services.xscreensaver.enable = true;
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super: {
|
||||||
|
xscreensaver = super.xscreensaver.override {
|
||||||
|
wrapperPrefix = "/a/bad/path";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
empty_wrapperPrefix.wait_for_x()
|
testScript = ''
|
||||||
empty_wrapperPrefix.wait_for_unit("xscreensaver", "alice")
|
ok.wait_for_x()
|
||||||
_, output_empty_wrapperPrefix = empty_wrapperPrefix.systemctl("status xscreensaver", "alice")
|
ok.wait_for_unit("xscreensaver", "alice")
|
||||||
assert 'To prevent the kernel from randomly unlocking' in output_empty_wrapperPrefix
|
_, output_ok = ok.systemctl("status xscreensaver", "alice")
|
||||||
assert 'your screen via the out-of-memory killer' in output_empty_wrapperPrefix
|
assert 'To prevent the kernel from randomly unlocking' not in output_ok
|
||||||
assert '"xscreensaver-auth" must be setuid root' in output_empty_wrapperPrefix
|
assert 'your screen via the out-of-memory killer' not in output_ok
|
||||||
|
assert '"xscreensaver-auth" must be setuid root' not in output_ok
|
||||||
|
|
||||||
bad_wrapperPrefix.wait_for_x()
|
empty_wrapperPrefix.wait_for_x()
|
||||||
bad_wrapperPrefix.wait_for_unit("xscreensaver", "alice")
|
empty_wrapperPrefix.wait_for_unit("xscreensaver", "alice")
|
||||||
_, output_bad_wrapperPrefix = bad_wrapperPrefix.systemctl("status xscreensaver", "alice")
|
_, output_empty_wrapperPrefix = empty_wrapperPrefix.systemctl("status xscreensaver", "alice")
|
||||||
assert 'To prevent the kernel from randomly unlocking' in output_bad_wrapperPrefix
|
assert 'To prevent the kernel from randomly unlocking' in output_empty_wrapperPrefix
|
||||||
assert 'your screen via the out-of-memory killer' in output_bad_wrapperPrefix
|
assert 'your screen via the out-of-memory killer' in output_empty_wrapperPrefix
|
||||||
assert '"xscreensaver-auth" must be setuid root' in output_bad_wrapperPrefix
|
assert '"xscreensaver-auth" must be setuid root' in output_empty_wrapperPrefix
|
||||||
'';
|
|
||||||
}
|
bad_wrapperPrefix.wait_for_x()
|
||||||
)
|
bad_wrapperPrefix.wait_for_unit("xscreensaver", "alice")
|
||||||
|
_, output_bad_wrapperPrefix = bad_wrapperPrefix.systemctl("status xscreensaver", "alice")
|
||||||
|
assert 'To prevent the kernel from randomly unlocking' in output_bad_wrapperPrefix
|
||||||
|
assert 'your screen via the out-of-memory killer' in output_bad_wrapperPrefix
|
||||||
|
assert '"xscreensaver-auth" must be setuid root' in output_bad_wrapperPrefix
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user