Merge pull request #276385 from majiru/drawterm-tests

drawterm: unstable-2023-09-03 -> unstable-2023-12-23 & nixos tests
This commit is contained in:
Guillaume Girol 2023-12-31 15:41:26 +01:00 committed by GitHub
commit a5cbc50912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 4 deletions

View File

@ -257,6 +257,7 @@ in {
dolibarr = handleTest ./dolibarr.nix {};
domination = handleTest ./domination.nix {};
dovecot = handleTest ./dovecot.nix {};
drawterm = discoverTests (import ./drawterm.nix);
drbd = handleTest ./drbd.nix {};
dublin-traceroute = handleTest ./dublin-traceroute.nix {};
earlyoom = handleTestOn ["x86_64-linux"] ./earlyoom.nix {};

58
nixos/tests/drawterm.nix Normal file
View File

@ -0,0 +1,58 @@
{ system, pkgs }:
let
tests = {
xorg = {
node = { pkgs, ... }: {
imports = [ ./common/user-account.nix ./common/x11.nix ];
services.xserver.enable = true;
services.xserver.displayManager.sessionCommands = ''
${pkgs.drawterm}/bin/drawterm -g 1024x768 &
'';
test-support.displayManager.auto.user = "alice";
};
systems = [ "x86_64-linux" "aarch64-linux" ];
};
wayland = {
node = { pkgs, ... }: {
imports = [ ./common/wayland-cage.nix ];
services.cage.program = "${pkgs.drawterm-wayland}/bin/drawterm";
};
systems = [ "x86_64-linux" ];
};
};
mkTest = name: machine:
import ./make-test-python.nix ({ pkgs, ... }: {
inherit name;
nodes = { "${name}" = machine; };
meta = with pkgs.lib.maintainers; {
maintainers = [ moody ];
};
enableOCR = true;
testScript = ''
@polling_condition
def drawterm_running():
machine.succeed("pgrep drawterm")
start_all()
machine.wait_for_unit("graphical.target")
drawterm_running.wait() # type: ignore[union-attr]
machine.wait_for_text("cpu")
machine.send_chars("cpu\n")
machine.wait_for_text("auth")
machine.send_chars("cpu\n")
machine.wait_for_text("ending")
machine.screenshot("out.png")
'';
});
mkTestOn = systems: name: machine:
if pkgs.lib.elem system systems then mkTest name machine
else { ... }: { };
in
builtins.mapAttrs (k: v: mkTestOn v.systems k v.node { inherit system; }) tests

View File

@ -14,17 +14,18 @@
, wlr-protocols
, pulseaudio
, config
, nixosTests
}:
stdenv.mkDerivation {
pname = "drawterm";
version = "unstable-2023-09-03";
version = "unstable-2023-12-23";
src = fetchFrom9Front {
owner = "plan9front";
repo = "drawterm";
rev = "c4ea4d299aa1bbbcc972c04adf06c18245ce7674";
hash = "sha256-Tp3yZb1nteOlz/KhydFdjBrj3OrY20s/Ltfk/EBrIyk=";
rev = "f9ae0c837bf8351037689f1985c1a52c1570ba30";
hash = "sha256-wJWMdD9OmGybIwgBNJ8LxxV21L4SaV22OxAILsDWG3U=";
};
enableParallelBuilding = true;
@ -56,7 +57,10 @@ stdenv.mkDerivation {
installManPage drawterm.1
'';
passthru.updateScript = unstableGitUpdater { shallowClone = false; };
passthru = {
updateScript = unstableGitUpdater { shallowClone = false; };
tests = nixosTests.drawterm;
};
meta = with lib; {
description = "Connect to Plan 9 CPU servers from other operating systems.";