nixos/hibernate: port test to python

This commit is contained in:
Jan Hrnko 2019-11-09 20:05:18 +01:00 committed by Florian Klink
parent c999eab3e7
commit 66c9911264

View File

@ -1,6 +1,6 @@
# Test whether hibernation from partition works.
import ./make-test.nix (pkgs: {
import ./make-test-python.nix (pkgs: {
name = "hibernate";
nodes = {
@ -28,16 +28,17 @@ import ./make-test.nix (pkgs: {
testScript =
''
$machine->waitForUnit("multi-user.target");
$machine->succeed("mkswap /dev/vdb");
$machine->succeed("swapon -a");
$machine->startJob("listener");
$machine->waitForOpenPort(4444);
$machine->succeed("systemctl hibernate &");
$machine->waitForShutdown;
$probe->waitForUnit("multi-user.target");
$machine->start;
$probe->waitUntilSucceeds("echo test | nc machine 4444 -N");
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("mkswap /dev/vdb")
machine.succeed("swapon -a")
machine.start_job("listener")
machine.wait_for_open_port(4444)
machine.succeed("systemctl hibernate &")
machine.wait_for_shutdown()
probe.wait_for_unit("multi-user.target")
machine.start()
probe.wait_until_succeeds("echo test | nc machine 4444 -N")
'';
})