Skip to content

Commit db3704a

Browse files
committed
nixosTests/stardust-xt-{flatland,kiara,sphereland}: init
1 parent c47b350 commit db3704a

4 files changed

Lines changed: 134 additions & 0 deletions

File tree

nixos/tests/all-tests.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,10 @@ in
15821582
sssd-ldap = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-ldap.nix { };
15831583
sssd-legacy-config = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-legacy-config.nix { };
15841584
stalwart = runTest ./stalwart/stalwart.nix;
1585+
stardust-xr-flatland = runTest ./stardust-xr/flatland.nix;
1586+
stardust-xr-kiara = runTest ./stardust-xr/kiara.nix;
1587+
stardust-xr-sphereland = runTest ./stardust-xr/sphereland.nix;
1588+
stardust-xr-atmosphere = runTest ./stardust-xr/atmosphere.nix;
15851589
stargazer = runTest ./web-servers/stargazer.nix;
15861590
starship = runTest ./starship.nix;
15871591
startx = import ./startx.nix { inherit pkgs runTest; };
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{ ... }:
2+
{
3+
name = "stardust-xr-atmosphere";
4+
5+
# Doesn't understand @polling_condition
6+
skipTypeCheck = true;
7+
8+
nodes.machine =
9+
{
10+
lib,
11+
pkgs,
12+
config,
13+
...
14+
}:
15+
16+
{
17+
imports = [ ./common.nix ];
18+
19+
virtualisation.memorySize = 4096;
20+
21+
systemd.user.services.stardust-xr-atmosphere = {
22+
wantedBy = [ "xdg-desktop-autostart.target" ];
23+
requires = [ "stardust-xr-server.service" ];
24+
after = [ "stardust-xr-server.service" ];
25+
script = ''
26+
set -eufx pipefail
27+
${lib.getExe pkgs.stardust-xr-atmosphere} install ${pkgs.stardust-xr-atmosphere}/share/atmosphere/default_envs/the_grid
28+
${lib.getExe pkgs.stardust-xr-atmosphere} set-default the_grid
29+
${lib.getExe pkgs.stardust-xr-atmosphere} show
30+
'';
31+
environment.RUST_BACKTRACE = "full";
32+
};
33+
};
34+
35+
testScript =
36+
{ nodes, ... }:
37+
''
38+
@polling_condition()
39+
def atmosphere_running():
40+
machine.wait_for_unit("stardust-xr-atmosphere.service", "alice")
41+
42+
with subtest("Ensure X11 starts"):
43+
start_all()
44+
machine.succeed("loginctl enable-linger alice")
45+
machine.wait_for_x()
46+
47+
with subtest("Ensure system works"):
48+
with atmosphere_running:
49+
# TODO(@Pandapip1): 20 seconds should be long enough for anything, but this is theoretically flaky
50+
# Adding systemd notify support to stardust-xr-atmosphere should resolve this
51+
machine.sleep(20)
52+
machine.screenshot("screen")
53+
'';
54+
}

nixos/tests/stardust-xr/common.nix

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
lib,
3+
pkgs,
4+
...
5+
}:
6+
7+
{
8+
imports = [ ../common/openxr.nix ];
9+
10+
# TODO(@Pandapip1): For the time being, Stardust doesn't like controllers rather than hand tracking
11+
services.monado.enable = lib.mkForce false;
12+
13+
systemd.user.services.stardust-xr-server = {
14+
wantedBy = [ "xdg-desktop-autostart.target" ];
15+
# requires = [ "monado.service" ];
16+
serviceConfig = {
17+
Type = "notify";
18+
NotifyAccess = "all";
19+
ExecStart = "${lib.getExe pkgs.stardust-xr-server} -e ${pkgs.writeShellScript "notifyReady" "systemd-notify --ready"}";
20+
};
21+
environment.RUST_BACKTRACE = "full";
22+
};
23+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{ ... }:
2+
{
3+
name = "stardust-xr-flatland";
4+
5+
# Doesn't understand @polling_condition
6+
skipTypeCheck = true;
7+
8+
nodes.machine =
9+
{
10+
lib,
11+
pkgs,
12+
config,
13+
...
14+
}:
15+
16+
{
17+
imports = [ ./common.nix ];
18+
19+
systemd.user.services.stardust-xr-flatland = {
20+
wantedBy = [ "xdg-desktop-autostart.target" ];
21+
requires = [ "stardust-xr-server.service" ];
22+
after = [ "stardust-xr-server.service" ];
23+
script = lib.getExe pkgs.stardust-xr-flatland;
24+
environment.RUST_BACKTRACE = "full";
25+
};
26+
27+
systemd.user.services.test-wayland-app = {
28+
wantedBy = [ "xdg-desktop-autostart.target" ];
29+
requires = [ "stardust-xr-flatland.service" ];
30+
after = [ "stardust-xr-flatland.service" ];
31+
script = "${lib.getExe' pkgs.weston "weston-presentation-shm"} -i";
32+
};
33+
};
34+
35+
testScript =
36+
{ nodes, ... }:
37+
''
38+
@polling_condition()
39+
def wayland_client_running():
40+
machine.wait_for_unit("stardust-xr-atmosphere.service", "alice")
41+
42+
with subtest("Ensure X11 starts"):
43+
start_all()
44+
machine.succeed("loginctl enable-linger alice")
45+
machine.wait_for_x()
46+
47+
with subtest("Ensure system works"):
48+
with wayland_client_running:
49+
# TODO: 10 seconds should be long enough for anything, but this is theoretically flaky
50+
machine.sleep(10)
51+
machine.screenshot("screen")
52+
'';
53+
}

0 commit comments

Comments
 (0)