From c4be68f06e8dc9212aa348be524c7029289c899f Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Wed, 16 Jul 2025 20:11:14 -0400 Subject: [PATCH] nixos/tests/oku: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/oku.nix | 27 +++++++++++++++++++++++++++ pkgs/by-name/ok/oku/package.nix | 6 +++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/oku.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 7aa2dbdbdaf5..00dd3eaec3e5 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -687,6 +687,7 @@ in imports = [ ./odoo.nix ]; _module.args.package = pkgs.odoo16; }; + oku = runTest ./oku.nix; oncall = runTest ./web-apps/oncall.nix; # 9pnet_virtio used to mount /nix partition doesn't support # hibernation. This test happens to work on x86_64-linux but diff --git a/nixos/tests/oku.nix b/nixos/tests/oku.nix new file mode 100644 index 000000000000..c63b343eab4c --- /dev/null +++ b/nixos/tests/oku.nix @@ -0,0 +1,27 @@ +{ + lib, + pkgs, + ... +}: +{ + name = "oku"; + + meta.maintainers = with lib.maintainers; [ ethancedwards8 ]; + + nodes.machine = { + imports = [ ./common/x11.nix ]; + + environment.systemPackages = with pkgs; [ oku ]; + }; + + enableOCR = true; + + testScript = '' + machine.wait_for_x() + + with subtest("Wait until Oku has finished loading the Valgrind docs page"): + machine.execute("xterm -e 'oku -n file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &"); + machine.wait_for_window("oku") + ''; + +} diff --git a/pkgs/by-name/ok/oku/package.nix b/pkgs/by-name/ok/oku/package.nix index 08dcd44594a9..8b2a87d90e2f 100644 --- a/pkgs/by-name/ok/oku/package.nix +++ b/pkgs/by-name/ok/oku/package.nix @@ -12,6 +12,7 @@ pango, webkitgtk_6_0, nix-update-script, + nixosTests, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -55,7 +56,10 @@ rustPlatform.buildRustPackage (finalAttrs: { cp -r ${finalAttrs.src}/data/hicolor $out/share/icons ''; - passthru.updateScript = nix-update-script { }; + passthru = { + updateScript = nix-update-script { }; + tests = { inherit (nixosTests) oku; }; + }; meta = { description = "Browser for the Oku Network and Peer-to-peer sites";