about summary refs log tree commit diff
path: root/nixos/tests/openarena.nix
diff options
context:
space:
mode:
authorMartin Milata <martin@martinmilata.cz>2019-12-01 01:34:37 +0100
committerMartin Milata <martin@martinmilata.cz>2019-12-01 01:34:37 +0100
commit8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c (patch)
tree1adb47c0a3000e3dff64508a231db29ed324983a /nixos/tests/openarena.nix
parent555e06c7888205ed8c7eeab4aa5b30e49980f11b (diff)
downloadnixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.tar
nixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.tar.gz
nixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.tar.bz2
nixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.tar.lz
nixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.tar.xz
nixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.tar.zst
nixlib-8f6bea4ae9b6d8021ee65532acb33d91c3e28f0c.zip
nixosTests.openarena: port to python
Diffstat (limited to 'nixos/tests/openarena.nix')
-rw-r--r--nixos/tests/openarena.nix15
1 files changed, 10 insertions, 5 deletions
diff --git a/nixos/tests/openarena.nix b/nixos/tests/openarena.nix
index 4cc4db229637..b315426532ba 100644
--- a/nixos/tests/openarena.nix
+++ b/nixos/tests/openarena.nix
@@ -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"
+      )
     '';
 })