mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
openarena: add test
This commit is contained in:
parent
230fc22e61
commit
6d90d17a96
2 changed files with 37 additions and 0 deletions
|
@ -201,6 +201,7 @@ in
|
||||||
novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
|
novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
|
||||||
nsd = handleTest ./nsd.nix {};
|
nsd = handleTest ./nsd.nix {};
|
||||||
nzbget = handleTest ./nzbget.nix {};
|
nzbget = handleTest ./nzbget.nix {};
|
||||||
|
openarena = handleTest ./openarena.nix {};
|
||||||
openldap = handleTest ./openldap.nix {};
|
openldap = handleTest ./openldap.nix {};
|
||||||
opensmtpd = handleTest ./opensmtpd.nix {};
|
opensmtpd = handleTest ./opensmtpd.nix {};
|
||||||
openssh = handleTest ./openssh.nix {};
|
openssh = handleTest ./openssh.nix {};
|
||||||
|
|
36
nixos/tests/openarena.nix
Normal file
36
nixos/tests/openarena.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import ./make-test.nix ({ pkgs, ...} : {
|
||||||
|
name = "openarena";
|
||||||
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
|
maintainers = [ tomfitzhenry ];
|
||||||
|
};
|
||||||
|
|
||||||
|
machine =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{ imports = [];
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
socat
|
||||||
|
];
|
||||||
|
services.openarena = {
|
||||||
|
enable = true;
|
||||||
|
extraFlags = [
|
||||||
|
"+set dedicated 2"
|
||||||
|
"+set sv_hostname 'My NixOS server'"
|
||||||
|
"+map oa_dm1"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript =
|
||||||
|
''
|
||||||
|
$machine->waitForUnit("openarena.service");
|
||||||
|
$machine->waitUntilSucceeds("ss --numeric --udp --listening | grep -q 27960");
|
||||||
|
|
||||||
|
# The log line containing 'resolve address' is last and only message that occurs after
|
||||||
|
# the server starts accepting clients.
|
||||||
|
$machine->waitUntilSucceeds("journalctl -u openarena.service | grep 'resolve address: dpmaster.deathmask.net'");
|
||||||
|
|
||||||
|
# Check it's possible to join the server.
|
||||||
|
$machine->succeed("echo -n -e '\\xff\\xff\\xff\\xffgetchallenge' | socat - UDP4-DATAGRAM:127.0.0.1:27960 | grep -q challengeResponse");
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue