Skip to content

Commit 9274b00

Browse files
committed
nixosTests/stardust-xt-{flatland,kiara,sphereland}: init
1 parent ba37ddb commit 9274b00

6 files changed

Lines changed: 233 additions & 0 deletions

File tree

nixos/tests/all-tests.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,10 @@ in
14191419
sssd-ldap = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-ldap.nix { };
14201420
sssd-legacy-config = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./sssd-legacy-config.nix { };
14211421
stalwart-mail = runTest ./stalwart/stalwart-mail.nix;
1422+
stardust-xr-flatland = runTest ./stardust-xr/flatland.nix;
1423+
stardust-xr-kiara = runTest ./stardust-xr/kiara.nix;
1424+
stardust-xr-sphereland = runTest ./stardust-xr/sphereland.nix;
1425+
stardust-xr-atmosphere = runTest ./stardust-xr/atmosphere.nix;
14221426
stargazer = runTest ./web-servers/stargazer.nix;
14231427
starship = runTest ./starship.nix;
14241428
startx = import ./startx.nix { inherit pkgs runTest; };
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
systemd.user.services.stardust-xr-atmosphere = {
20+
wantedBy = [ "xdg-desktop-autostart.target" ];
21+
requires = [ "stardust-xr-server.service" ];
22+
after = [ "stardust-xr-server.service" ];
23+
script = ''
24+
${lib.getExe pkgs.stardust-xr-atmosphere} install ${pkgs.srcOnly pkgs.stardust-xr-atmosphere}/default_envs/the_grid
25+
${lib.getExe pkgs.stardust-xr-atmosphere} show the_grid
26+
'';
27+
environment.RUST_BACKTRACE = "full";
28+
};
29+
};
30+
31+
testScript =
32+
{ nodes, ... }:
33+
''
34+
@polling_condition()
35+
def atmosphere_running():
36+
machine.wait_for_unit("stardust-xr-atmosphere.service", "alice")
37+
38+
with subtest("Ensure X11 starts"):
39+
start_all()
40+
machine.succeed("loginctl enable-linger alice")
41+
machine.wait_for_x()
42+
43+
with subtest("Ensure system works"):
44+
with atmosphere_running:
45+
# TODO: 10 seconds should be long enough for anything, but this is theoretically flaky
46+
machine.sleep(10)
47+
machine.screenshot("screen")
48+
'';
49+
}

nixos/tests/stardust-xr/common.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
lib,
3+
pkgs,
4+
...
5+
}:
6+
7+
{
8+
imports = [ ../common/openxr.nix ];
9+
10+
systemd.user.services.stardust-xr-server = {
11+
wantedBy = [ "xdg-desktop-autostart.target" ];
12+
requires = [ "monado.service" ];
13+
serviceConfig = {
14+
Type = "notify";
15+
NotifyAccess = "all";
16+
ExecStart = "${lib.getExe pkgs.stardust-xr-server} -e ${pkgs.writeShellScript "notifyReady" "systemd-notify --ready"}";
17+
};
18+
environment.RUST_BACKTRACE = "full";
19+
};
20+
}
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+
}

nixos/tests/stardust-xr/kiara.nix

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{ ... }:
2+
{
3+
name = "stardust-xr-kiara";
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-kiara = {
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-kiara;
24+
environment.RUST_BACKTRACE = "full";
25+
};
26+
27+
systemd.user.services.test-wayland-app = {
28+
wantedBy = [ "xdg-desktop-autostart.target" ];
29+
requires = [ "stardust-xr-kiara.service" ];
30+
after = [ "stardust-xr-kiara.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+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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-sphereland = {
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-sphereland;
24+
environment.RUST_BACKTRACE = "full";
25+
};
26+
27+
systemd.user.services.test-wayland-app = {
28+
wantedBy = [ "xdg-desktop-autostart.target" ];
29+
requires = [ "stardust-xr-sphereland.service" ];
30+
after = [ "stardust-xr-sphereland.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+
# TODO: window is currently off the screen
52+
machine.screenshot("screen")
53+
'';
54+
}

0 commit comments

Comments
 (0)