mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixosTests.miriway: Migrate to runTest
This commit is contained in:
parent
59e6a84a7b
commit
de76a1e852
2 changed files with 129 additions and 131 deletions
|
@ -706,7 +706,7 @@ in {
|
||||||
miniflux = handleTest ./miniflux.nix {};
|
miniflux = handleTest ./miniflux.nix {};
|
||||||
minio = handleTest ./minio.nix {};
|
minio = handleTest ./minio.nix {};
|
||||||
miracle-wm = runTest ./miracle-wm.nix;
|
miracle-wm = runTest ./miracle-wm.nix;
|
||||||
miriway = handleTest ./miriway.nix {};
|
miriway = runTest ./miriway.nix;
|
||||||
misc = handleTest ./misc.nix {};
|
misc = handleTest ./misc.nix {};
|
||||||
misskey = handleTest ./misskey.nix {};
|
misskey = handleTest ./misskey.nix {};
|
||||||
mjolnir = handleTest ./matrix/mjolnir.nix {};
|
mjolnir = handleTest ./matrix/mjolnir.nix {};
|
||||||
|
|
|
@ -1,148 +1,146 @@
|
||||||
import ./make-test-python.nix (
|
{ pkgs, lib, ... }:
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
{
|
name = "miriway";
|
||||||
name = "miriway";
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
maintainers = with lib.maintainers; [ OPNA2608 ];
|
maintainers = with lib.maintainers; [ OPNA2608 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nodes.machine =
|
nodes.machine =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common/auto.nix
|
./common/auto.nix
|
||||||
./common/user-account.nix
|
./common/user-account.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Seems to very rarely get interrupted by oom-killer
|
# Seems to very rarely get interrupted by oom-killer
|
||||||
virtualisation.memorySize = 2047;
|
virtualisation.memorySize = 2047;
|
||||||
|
|
||||||
test-support.displayManager.auto = {
|
test-support.displayManager.auto = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "alice";
|
user = "alice";
|
||||||
};
|
|
||||||
|
|
||||||
programs.ydotool.enable = true;
|
|
||||||
|
|
||||||
services.xserver.enable = true;
|
|
||||||
services.displayManager.defaultSession = lib.mkForce "miriway";
|
|
||||||
|
|
||||||
programs.miriway = {
|
|
||||||
enable = true;
|
|
||||||
config = ''
|
|
||||||
add-wayland-extensions=all
|
|
||||||
enable-x11=
|
|
||||||
|
|
||||||
ctrl-alt=t:foot --maximized
|
|
||||||
ctrl-alt=a:env WINIT_UNIX_BACKEND=x11 WAYLAND_DISPLAY= alacritty --option window.startup_mode=\"maximized\"
|
|
||||||
|
|
||||||
shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY
|
|
||||||
|
|
||||||
shell-component=foot --maximized
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
shellAliases = {
|
|
||||||
test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok";
|
|
||||||
test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemPackages = with pkgs; [
|
|
||||||
mesa-demos
|
|
||||||
wayland-utils
|
|
||||||
foot
|
|
||||||
alacritty
|
|
||||||
];
|
|
||||||
|
|
||||||
# To help with OCR
|
|
||||||
etc."xdg/foot/foot.ini".source = (pkgs.formats.ini { }).generate "foot.ini" {
|
|
||||||
main = {
|
|
||||||
font = "inconsolata:size=16";
|
|
||||||
};
|
|
||||||
colors = rec {
|
|
||||||
foreground = "000000";
|
|
||||||
background = "ffffff";
|
|
||||||
regular2 = foreground;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
etc."xdg/alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty.toml" {
|
|
||||||
font = rec {
|
|
||||||
normal.family = "Inconsolata";
|
|
||||||
bold.family = normal.family;
|
|
||||||
italic.family = normal.family;
|
|
||||||
bold_italic.family = normal.family;
|
|
||||||
size = 16;
|
|
||||||
};
|
|
||||||
colors = rec {
|
|
||||||
primary = {
|
|
||||||
foreground = "0x000000";
|
|
||||||
background = "0xffffff";
|
|
||||||
};
|
|
||||||
normal = {
|
|
||||||
green = primary.foreground;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fonts.packages = [ pkgs.inconsolata ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enableOCR = true;
|
programs.ydotool.enable = true;
|
||||||
|
|
||||||
testScript =
|
services.xserver.enable = true;
|
||||||
{ nodes, ... }:
|
services.displayManager.defaultSession = lib.mkForce "miriway";
|
||||||
''
|
|
||||||
start_all()
|
|
||||||
machine.wait_for_unit("multi-user.target")
|
|
||||||
|
|
||||||
# Wait for Miriway to complete startup
|
programs.miriway = {
|
||||||
machine.wait_for_file("/run/user/1000/wayland-0")
|
enable = true;
|
||||||
machine.succeed("pgrep miriway-shell")
|
config = ''
|
||||||
machine.screenshot("miriway_launched")
|
add-wayland-extensions=all
|
||||||
|
enable-x11=
|
||||||
|
|
||||||
# Test Wayland
|
ctrl-alt=t:foot --maximized
|
||||||
# We let Miriway start the first terminal, as we might get stuck if it's not ready to process the first keybind
|
ctrl-alt=a:env WINIT_UNIX_BACKEND=x11 WAYLAND_DISPLAY= alacritty --option window.startup_mode=\"maximized\"
|
||||||
# machine.send_key("ctrl-alt-t")
|
|
||||||
machine.wait_for_text(r"(alice|machine)")
|
|
||||||
machine.send_chars("test-wayland\n")
|
|
||||||
machine.wait_for_file("/tmp/test-wayland-exit-ok")
|
|
||||||
machine.copy_from_vm("/tmp/test-wayland.out")
|
|
||||||
machine.screenshot("foot_wayland_info")
|
|
||||||
|
|
||||||
# please actually register that we want to close the window
|
shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY
|
||||||
machine.succeed("ydotool mousemove -- 10 10")
|
|
||||||
machine.sleep(3)
|
|
||||||
|
|
||||||
machine.send_chars("exit\n")
|
shell-component=foot --maximized
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# please actually register that we want to close the window
|
environment = {
|
||||||
machine.succeed("ydotool mousemove -- 10 10")
|
shellAliases = {
|
||||||
machine.sleep(3)
|
test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok";
|
||||||
|
test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok";
|
||||||
|
};
|
||||||
|
|
||||||
machine.wait_until_fails("pgrep foot")
|
systemPackages = with pkgs; [
|
||||||
|
mesa-demos
|
||||||
|
wayland-utils
|
||||||
|
foot
|
||||||
|
alacritty
|
||||||
|
];
|
||||||
|
|
||||||
# Test XWayland
|
# To help with OCR
|
||||||
machine.send_key("ctrl-alt-a")
|
etc."xdg/foot/foot.ini".source = (pkgs.formats.ini { }).generate "foot.ini" {
|
||||||
machine.wait_for_text(r"(alice|machine)")
|
main = {
|
||||||
machine.send_chars("test-x11\n")
|
font = "inconsolata:size=16";
|
||||||
machine.wait_for_file("/tmp/test-x11-exit-ok")
|
};
|
||||||
machine.copy_from_vm("/tmp/test-x11.out")
|
colors = rec {
|
||||||
machine.screenshot("alacritty_glinfo")
|
foreground = "000000";
|
||||||
|
background = "ffffff";
|
||||||
|
regular2 = foreground;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
etc."xdg/alacritty/alacritty.toml".source = (pkgs.formats.toml { }).generate "alacritty.toml" {
|
||||||
|
font = rec {
|
||||||
|
normal.family = "Inconsolata";
|
||||||
|
bold.family = normal.family;
|
||||||
|
italic.family = normal.family;
|
||||||
|
bold_italic.family = normal.family;
|
||||||
|
size = 16;
|
||||||
|
};
|
||||||
|
colors = rec {
|
||||||
|
primary = {
|
||||||
|
foreground = "0x000000";
|
||||||
|
background = "0xffffff";
|
||||||
|
};
|
||||||
|
normal = {
|
||||||
|
green = primary.foreground;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# please actually register that we want to close the window
|
fonts.packages = [ pkgs.inconsolata ];
|
||||||
machine.succeed("ydotool mousemove -- 10 10")
|
};
|
||||||
machine.sleep(3)
|
|
||||||
|
|
||||||
machine.send_chars("exit\n")
|
enableOCR = true;
|
||||||
|
|
||||||
# please actually register that we want to close the window
|
testScript =
|
||||||
machine.succeed("ydotool mousemove -- 10 10")
|
{ nodes, ... }:
|
||||||
machine.sleep(3)
|
''
|
||||||
|
start_all()
|
||||||
|
machine.wait_for_unit("multi-user.target")
|
||||||
|
|
||||||
machine.wait_until_fails("pgrep alacritty")
|
# Wait for Miriway to complete startup
|
||||||
'';
|
machine.wait_for_file("/run/user/1000/wayland-0")
|
||||||
}
|
machine.succeed("pgrep miriway-shell")
|
||||||
)
|
machine.screenshot("miriway_launched")
|
||||||
|
|
||||||
|
# Test Wayland
|
||||||
|
# We let Miriway start the first terminal, as we might get stuck if it's not ready to process the first keybind
|
||||||
|
# machine.send_key("ctrl-alt-t")
|
||||||
|
machine.wait_for_text(r"(alice|machine)")
|
||||||
|
machine.send_chars("test-wayland\n")
|
||||||
|
machine.wait_for_file("/tmp/test-wayland-exit-ok")
|
||||||
|
machine.copy_from_vm("/tmp/test-wayland.out")
|
||||||
|
machine.screenshot("foot_wayland_info")
|
||||||
|
|
||||||
|
# please actually register that we want to close the window
|
||||||
|
machine.succeed("ydotool mousemove -- 10 10")
|
||||||
|
machine.sleep(3)
|
||||||
|
|
||||||
|
machine.send_chars("exit\n")
|
||||||
|
|
||||||
|
# please actually register that we want to close the window
|
||||||
|
machine.succeed("ydotool mousemove -- 10 10")
|
||||||
|
machine.sleep(3)
|
||||||
|
|
||||||
|
machine.wait_until_fails("pgrep foot")
|
||||||
|
|
||||||
|
# Test XWayland
|
||||||
|
machine.send_key("ctrl-alt-a")
|
||||||
|
machine.wait_for_text(r"(alice|machine)")
|
||||||
|
machine.send_chars("test-x11\n")
|
||||||
|
machine.wait_for_file("/tmp/test-x11-exit-ok")
|
||||||
|
machine.copy_from_vm("/tmp/test-x11.out")
|
||||||
|
machine.screenshot("alacritty_glinfo")
|
||||||
|
|
||||||
|
# please actually register that we want to close the window
|
||||||
|
machine.succeed("ydotool mousemove -- 10 10")
|
||||||
|
machine.sleep(3)
|
||||||
|
|
||||||
|
machine.send_chars("exit\n")
|
||||||
|
|
||||||
|
# please actually register that we want to close the window
|
||||||
|
machine.succeed("ydotool mousemove -- 10 10")
|
||||||
|
machine.sleep(3)
|
||||||
|
|
||||||
|
machine.wait_until_fails("pgrep alacritty")
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue