mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
nixos/monado: add test
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
2d2493b23d
commit
8fc2690b73
|
@ -535,6 +535,7 @@ in {
|
|||
mobilizon = handleTest ./mobilizon.nix {};
|
||||
mod_perl = handleTest ./mod_perl.nix {};
|
||||
molly-brown = handleTest ./molly-brown.nix {};
|
||||
monado = handleTest ./monado.nix {};
|
||||
monica = handleTest ./web-apps/monica.nix {};
|
||||
mongodb = handleTest ./mongodb.nix {};
|
||||
moodle = handleTest ./moodle.nix {};
|
||||
|
|
39
nixos/tests/monado.nix
Normal file
39
nixos/tests/monado.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "monado";
|
||||
|
||||
nodes.machine =
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware.opengl.enable = true;
|
||||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
services.monado = {
|
||||
enable = true;
|
||||
defaultRuntime = true;
|
||||
};
|
||||
# Stop Monado from probing for any hardware
|
||||
systemd.user.services.monado.environment.SIMULATED_ENABLE = "1";
|
||||
|
||||
environment.systemPackages = with pkgs; [ openxr-loader ];
|
||||
};
|
||||
|
||||
testScript = { nodes, ... }:
|
||||
let
|
||||
userId = toString nodes.machine.users.users.alice.uid;
|
||||
runtimePath = "/run/user/${userId}";
|
||||
in
|
||||
''
|
||||
machine.succeed("loginctl enable-linger alice")
|
||||
machine.wait_for_unit("user@${userId}.service")
|
||||
|
||||
machine.wait_for_unit("monado.socket", "alice")
|
||||
machine.systemctl("start monado.service", "alice")
|
||||
machine.wait_for_unit("monado.service", "alice")
|
||||
|
||||
machine.succeed("su -- alice -c env XDG_RUNTIME_DIR=${runtimePath} openxr_runtime_list")
|
||||
'';
|
||||
})
|
|
@ -41,6 +41,7 @@
|
|||
, wayland-scanner
|
||||
, libdrm
|
||||
, zlib
|
||||
, nixosTests
|
||||
# Set as 'false' to build monado without service support, i.e. allow VR
|
||||
# applications linking against libopenxr_monado.so to use OpenXR standalone
|
||||
# instead of via the monado-service program. For more information see:
|
||||
|
@ -137,6 +138,10 @@ stdenv.mkDerivation {
|
|||
./force-enable-steamvr_lh.patch
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
basic-service = nixosTests.monado;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Open source XR runtime";
|
||||
homepage = "https://monado.freedesktop.org/";
|
||||
|
|
Loading…
Reference in a new issue