Merge pull request #74759 from mmilata/openarena-python-test

nixosTests.openarena: port to python
This commit is contained in:
Florian Klink 2019-12-02 20:29:04 +01:00 committed by GitHub
commit fdb65314fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...} : {
import ./make-test-python.nix ({ pkgs, ...} : {
name = "openarena";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ tomfitzhenry ];
@ -23,14 +23,19 @@ import ./make-test.nix ({ pkgs, ...} : {
testScript =
''
$machine->waitForUnit("openarena.service");
$machine->waitUntilSucceeds("ss --numeric --udp --listening | grep -q 27960");
machine.wait_for_unit("openarena.service")
machine.wait_until_succeeds("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'");
machine.wait_until_succeeds(
"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");
# Can't use substring match instead of grep because the output is not utf-8
machine.succeed(
"echo -n -e '\\xff\\xff\\xff\\xffgetchallenge' | socat - UDP4-DATAGRAM:127.0.0.1:27960 | grep -q challengeResponse"
)
'';
})