about summary refs log tree commit diff
path: root/nixos/tests/xterm.nix
blob: 745d33e8a0d5360e591727341d8388f00ea24ed0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import ./make-test-python.nix ({ pkgs, ...} : {
  name = "xterm";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ nequissimus ];
  };

  nodes.machine = { pkgs, ... }:
    {
      imports = [ ./common/x11.nix ];
      services.xserver.desktopManager.xterm.enable = false;
    };

  testScript =
    ''
      machine.wait_for_x()
      machine.succeed("DISPLAY=:0 xterm -title testterm -class testterm -fullscreen >&2 &")
      machine.sleep(2)
      machine.send_chars("echo $XTERM_VERSION >> /tmp/xterm_version\n")
      machine.wait_for_file("/tmp/xterm_version")
      assert "${pkgs.xterm.version}" in machine.succeed("cat /tmp/xterm_version")
      machine.screenshot("window")
    '';
})