nixos/quake3: convert test to python
This commit is contained in:
parent
2af2d59fd6
commit
8b12f0ddcc
|
@ -1,4 +1,4 @@
|
|||
import ./make-test.nix ({ pkgs, ...} :
|
||||
import ./make-test-python.nix ({ pkgs, ...} :
|
||||
|
||||
let
|
||||
|
||||
|
@ -59,37 +59,37 @@ rec {
|
|||
|
||||
testScript =
|
||||
''
|
||||
startAll;
|
||||
start_all()
|
||||
|
||||
$server->waitForUnit("quake3-server");
|
||||
$client1->waitForX;
|
||||
$client2->waitForX;
|
||||
server.wait_for_unit("quake3-server")
|
||||
client1.wait_for_x()
|
||||
client2.wait_for_x()
|
||||
|
||||
$client1->execute("quake3 +set r_fullscreen 0 +set name Foo +connect server &");
|
||||
$client2->execute("quake3 +set r_fullscreen 0 +set name Bar +connect server &");
|
||||
client1.execute("quake3 +set r_fullscreen 0 +set name Foo +connect server &")
|
||||
client2.execute("quake3 +set r_fullscreen 0 +set name Bar +connect server &")
|
||||
|
||||
$server->waitUntilSucceeds("grep -q 'Foo.*entered the game' /tmp/log");
|
||||
$server->waitUntilSucceeds("grep -q 'Bar.*entered the game' /tmp/log");
|
||||
server.wait_until_succeeds("grep -q 'Foo.*entered the game' /tmp/log")
|
||||
server.wait_until_succeeds("grep -q 'Bar.*entered the game' /tmp/log")
|
||||
|
||||
$server->sleep(10); # wait for a while to get a nice screenshot
|
||||
server.sleep(10) # wait for a while to get a nice screenshot
|
||||
|
||||
$client1->block();
|
||||
client1.block()
|
||||
|
||||
$server->sleep(20);
|
||||
server.sleep(20)
|
||||
|
||||
$client1->screenshot("screen1");
|
||||
$client2->screenshot("screen2");
|
||||
client1.screenshot("screen1")
|
||||
client2.screenshot("screen2")
|
||||
|
||||
$client1->unblock();
|
||||
client1.unblock()
|
||||
|
||||
$server->sleep(10);
|
||||
server.sleep(10)
|
||||
|
||||
$client1->screenshot("screen3");
|
||||
$client2->screenshot("screen4");
|
||||
client1.screenshot("screen3")
|
||||
client2.screenshot("screen4")
|
||||
|
||||
$client1->shutdown();
|
||||
$client2->shutdown();
|
||||
$server->stopJob("quake3-server");
|
||||
client1.shutdown()
|
||||
client2.shutdown()
|
||||
server.stop_job("quake3-server")
|
||||
'';
|
||||
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue