nixos/tests/ringboard: init
This commit is contained in:
@@ -1300,6 +1300,7 @@ in
|
||||
restic = runTest ./restic.nix;
|
||||
restic-rest-server = runTest ./restic-rest-server.nix;
|
||||
retroarch = runTest ./retroarch.nix;
|
||||
ringboard = runTest ./ringboard.nix;
|
||||
rke2 = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./rke2 { };
|
||||
rkvm = handleTest ./rkvm { };
|
||||
rmfakecloud = runTest ./rmfakecloud.nix;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "ringboard";
|
||||
meta = { inherit (pkgs.ringboard.meta) maintainers; };
|
||||
|
||||
nodes.machine = {
|
||||
imports = [
|
||||
./common/user-account.nix
|
||||
./common/x11.nix
|
||||
];
|
||||
|
||||
test-support.displayManager.auto.user = "alice";
|
||||
|
||||
services.xserver.displayManager.sessionCommands = ''
|
||||
'${lib.getExe pkgs.gedit}' &
|
||||
'';
|
||||
|
||||
services.ringboard.x11.enable = true;
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
inherit (nodes.machine.test-support.displayManager.auto) user;
|
||||
in
|
||||
''
|
||||
@polling_condition
|
||||
def gedit_running():
|
||||
machine.succeed("pgrep gedit")
|
||||
|
||||
with subtest("Wait for service startup"):
|
||||
machine.wait_for_unit("graphical.target")
|
||||
machine.wait_for_unit("ringboard-server.service", "${user}")
|
||||
machine.wait_for_unit("ringboard-listener.service", "${user}")
|
||||
|
||||
with subtest("Ensure clipboard is monitored"):
|
||||
with gedit_running: # type: ignore[union-attr]
|
||||
machine.send_chars("Hello world!")
|
||||
machine.send_key("ctrl-a")
|
||||
machine.send_key("ctrl-c")
|
||||
machine.wait_for_console_text("Small selection transfer complete")
|
||||
machine.succeed("su - '${user}' -c 'ringboard search Hello | grep world!'")
|
||||
'';
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
xorg,
|
||||
makeWrapper,
|
||||
displayServer ? "x11",
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
assert lib.assertOneOf "displayServer" displayServer [
|
||||
@@ -96,6 +97,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
sed -i "s|Icon=ringboard|Icon=$out/share/icons/hicolor/1024x1024/ringboard.jpeg|g" $out/share/applications/ringboard-egui.desktop
|
||||
'';
|
||||
|
||||
passthru.tests.nixos = nixosTests.ringboard;
|
||||
|
||||
meta = {
|
||||
description = "Fast, efficient, and composable clipboard manager for Linux";
|
||||
homepage = "https://github.com/SUPERCILEX/clipboard-history";
|
||||
|
||||
Reference in New Issue
Block a user