mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-19 15:11:30 +00:00
nixosTests/stardust-xr-{atmosphere,flatland}: init
This commit is contained in:
@@ -1582,6 +1582,8 @@ in
|
||||
sssd-ldap = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-ldap.nix { };
|
||||
sssd-legacy-config = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-legacy-config.nix { };
|
||||
stalwart = runTest ./stalwart/stalwart.nix;
|
||||
stardust-xr-atmosphere = runTest ./stardust-xr/atmosphere.nix;
|
||||
stardust-xr-flatland = runTest ./stardust-xr/flatland.nix;
|
||||
stargazer = runTest ./web-servers/stargazer.nix;
|
||||
starship = runTest ./starship.nix;
|
||||
startx = import ./startx.nix { inherit pkgs runTest; };
|
||||
|
||||
54
nixos/tests/stardust-xr/atmosphere.nix
Normal file
54
nixos/tests/stardust-xr/atmosphere.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{ ... }:
|
||||
{
|
||||
name = "stardust-xr-atmosphere";
|
||||
|
||||
# Doesn't understand @polling_condition
|
||||
skipTypeCheck = true;
|
||||
|
||||
nodes.machine =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
virtualisation.memorySize = 4096;
|
||||
|
||||
systemd.user.services.stardust-xr-atmosphere = {
|
||||
wantedBy = [ "xdg-desktop-autostart.target" ];
|
||||
requires = [ "stardust-xr-server.service" ];
|
||||
after = [ "stardust-xr-server.service" ];
|
||||
script = ''
|
||||
set -eufx pipefail
|
||||
${lib.getExe pkgs.stardust-xr-atmosphere} install ${pkgs.stardust-xr-atmosphere}/share/atmosphere/default_envs/the_grid
|
||||
${lib.getExe pkgs.stardust-xr-atmosphere} set-default the_grid
|
||||
${lib.getExe pkgs.stardust-xr-atmosphere} show
|
||||
'';
|
||||
environment.RUST_BACKTRACE = "full";
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
''
|
||||
@polling_condition()
|
||||
def atmosphere_running():
|
||||
machine.wait_for_unit("stardust-xr-atmosphere.service", "alice")
|
||||
|
||||
with subtest("Ensure X11 starts"):
|
||||
start_all()
|
||||
machine.succeed("loginctl enable-linger alice")
|
||||
machine.wait_for_x()
|
||||
|
||||
with subtest("Ensure system works"):
|
||||
with atmosphere_running:
|
||||
# TODO(@Pandapip1): 20 seconds should be long enough for anything, but this is theoretically flaky
|
||||
# Adding systemd notify support to stardust-xr-atmosphere should resolve this
|
||||
machine.sleep(20)
|
||||
machine.screenshot("screen")
|
||||
'';
|
||||
}
|
||||
23
nixos/tests/stardust-xr/common.nix
Normal file
23
nixos/tests/stardust-xr/common.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ../common/openxr.nix ];
|
||||
|
||||
# TODO(@Pandapip1): For the time being, Stardust doesn't like controllers rather than hand tracking
|
||||
services.monado.enable = lib.mkForce false;
|
||||
|
||||
systemd.user.services.stardust-xr-server = {
|
||||
wantedBy = [ "xdg-desktop-autostart.target" ];
|
||||
# requires = [ "monado.service" ];
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
NotifyAccess = "all";
|
||||
ExecStart = "${lib.getExe pkgs.stardust-xr-server} -e ${pkgs.writeShellScript "notifyReady" "systemd-notify --ready"}";
|
||||
};
|
||||
environment.RUST_BACKTRACE = "full";
|
||||
};
|
||||
}
|
||||
57
nixos/tests/stardust-xr/flatland.nix
Normal file
57
nixos/tests/stardust-xr/flatland.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{ ... }:
|
||||
{
|
||||
name = "stardust-xr-flatland";
|
||||
|
||||
# Doesn't understand @polling_condition
|
||||
skipTypeCheck = true;
|
||||
|
||||
nodes.machine =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
systemd.user.services.stardust-xr-flatland = {
|
||||
wantedBy = [ "xdg-desktop-autostart.target" ];
|
||||
requires = [ "stardust-xr-server.service" ];
|
||||
after = [ "stardust-xr-server.service" ];
|
||||
script = lib.getExe pkgs.stardust-xr-flatland;
|
||||
environment.RUST_BACKTRACE = "full";
|
||||
};
|
||||
|
||||
systemd.user.services.test-wayland-app = {
|
||||
wantedBy = [ "xdg-desktop-autostart.target" ];
|
||||
requires = [ "stardust-xr-flatland.service" ];
|
||||
after = [ "stardust-xr-flatland.service" ];
|
||||
script = lib.getExe pkgs.wayland-colorbar;
|
||||
environment = {
|
||||
DISPLAY = "";
|
||||
WAYLAND_DISPLAY = "wayland-0";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
''
|
||||
@polling_condition()
|
||||
def wayland_client_running():
|
||||
machine.wait_for_unit("test-wayland-app.service", "alice")
|
||||
|
||||
with subtest("Ensure X11 starts"):
|
||||
start_all()
|
||||
machine.succeed("loginctl enable-linger alice")
|
||||
machine.wait_for_x()
|
||||
|
||||
with subtest("Ensure system works"):
|
||||
with wayland_client_running:
|
||||
# TODO: 20 seconds should be long enough for anything, but this is theoretically flaky
|
||||
machine.sleep(20)
|
||||
machine.screenshot("screen")
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user