2020-02-01 14:23:55 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} :
|
|
|
|
|
|
|
|
let
|
|
|
|
client =
|
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
{ imports = [ ./common/x11.nix ];
|
2024-06-16 10:50:18 +00:00
|
|
|
hardware.graphics.enable = true;
|
2020-02-01 14:23:55 +00:00
|
|
|
environment.systemPackages = [ pkgs.openarena ];
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2019-10-22 14:20:56 +00:00
|
|
|
name = "openarena";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2020-02-01 14:23:55 +00:00
|
|
|
maintainers = [ fpletz ];
|
2019-10-22 14:20:56 +00:00
|
|
|
};
|
|
|
|
|
2020-02-01 14:23:55 +00:00
|
|
|
nodes =
|
|
|
|
{ server =
|
|
|
|
{ services.openarena = {
|
|
|
|
enable = true;
|
|
|
|
extraFlags = [ "+set g_gametype 0" "+map oa_dm7" "+addbot Angelyss" "+addbot Arachna" ];
|
|
|
|
openPorts = true;
|
|
|
|
};
|
|
|
|
};
|
2019-10-22 14:20:56 +00:00
|
|
|
|
2020-02-01 14:23:55 +00:00
|
|
|
client1 = client;
|
|
|
|
client2 = client;
|
2019-10-22 14:20:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
2020-02-01 14:23:55 +00:00
|
|
|
start_all()
|
2019-10-22 14:20:56 +00:00
|
|
|
|
2020-02-01 14:23:55 +00:00
|
|
|
server.wait_for_unit("openarena")
|
|
|
|
server.wait_until_succeeds("ss --numeric --udp --listening | grep -q 27960")
|
|
|
|
|
|
|
|
client1.wait_for_x()
|
|
|
|
client2.wait_for_x()
|
2019-10-22 14:20:56 +00:00
|
|
|
|
2021-11-05 00:43:22 +00:00
|
|
|
client1.execute("openarena +set r_fullscreen 0 +set name Foo +connect server >&2 &")
|
|
|
|
client2.execute("openarena +set r_fullscreen 0 +set name Bar +connect server >&2 &")
|
2020-02-01 14:23:55 +00:00
|
|
|
|
|
|
|
server.wait_until_succeeds(
|
|
|
|
"journalctl -u openarena -e | grep -q 'Foo.*entered the game'"
|
|
|
|
)
|
|
|
|
server.wait_until_succeeds(
|
|
|
|
"journalctl -u openarena -e | grep -q 'Bar.*entered the game'"
|
2019-12-01 00:34:37 +00:00
|
|
|
)
|
2020-02-01 14:23:55 +00:00
|
|
|
|
|
|
|
server.sleep(10) # wait for a while to get a nice screenshot
|
|
|
|
|
|
|
|
client1.screenshot("screen_client1_1")
|
|
|
|
client2.screenshot("screen_client2_1")
|
|
|
|
|
|
|
|
client1.block()
|
|
|
|
|
|
|
|
server.sleep(10)
|
|
|
|
|
|
|
|
client1.screenshot("screen_client1_2")
|
|
|
|
client2.screenshot("screen_client2_2")
|
|
|
|
|
|
|
|
client1.unblock()
|
|
|
|
|
|
|
|
server.sleep(10)
|
|
|
|
|
|
|
|
client1.screenshot("screen_client1_3")
|
|
|
|
client2.screenshot("screen_client2_3")
|
2019-10-22 14:20:56 +00:00
|
|
|
'';
|
2020-02-01 14:23:55 +00:00
|
|
|
|
2019-10-22 14:20:56 +00:00
|
|
|
})
|