Fix the VM tests

This commit is contained in:
Eelco Dolstra 2013-01-21 22:36:23 +01:00
parent 96fbbbde55
commit 1943b60ad8
2 changed files with 6 additions and 6 deletions

View File

@ -13,14 +13,14 @@ makeTest ({ pkgs, ... }: let pkgA = pkgs.aterm; pkgB = pkgs.wget; in {
virtualisation.pathsInNixDB = [ pkgA ]; virtualisation.pathsInNixDB = [ pkgA ];
environment.nix = nix; environment.nix = nix;
}; };
server = server =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ services.openssh.enable = true; { services.openssh.enable = true;
virtualisation.writableStore = true; virtualisation.writableStore = true;
virtualisation.pathsInNixDB = [ pkgB ]; virtualisation.pathsInNixDB = [ pkgB ];
environment.nix = nix; environment.nix = nix;
}; };
}; };
testScript = { nodes }: testScript = { nodes }:
@ -36,8 +36,8 @@ makeTest ({ pkgs, ... }: let pkgA = pkgs.aterm; pkgB = pkgs.wget; in {
# Install the SSH key on the server. # Install the SSH key on the server.
$server->succeed("mkdir -m 700 /root/.ssh"); $server->succeed("mkdir -m 700 /root/.ssh");
$server->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys"); $server->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys");
$server->waitForJob("sshd"); $server->waitForUnit("sshd");
$client->waitForJob("network-interfaces"); $client->waitForUnit("network.target");
$client->succeed("ssh -o StrictHostKeyChecking=no " . $server->name() . " 'echo hello world'"); $client->succeed("ssh -o StrictHostKeyChecking=no " . $server->name() . " 'echo hello world'");
# Copy the closure of package A from the client to the server. # Copy the closure of package A from the client to the server.

View File

@ -72,11 +72,11 @@ in
$client->succeed("chmod 600 /root/.ssh/id_dsa"); $client->succeed("chmod 600 /root/.ssh/id_dsa");
# Install the SSH key on the slaves. # Install the SSH key on the slaves.
$client->waitForJob("network-interfaces"); $client->waitForUnit("network.target");
foreach my $slave ($slave1, $slave2) { foreach my $slave ($slave1, $slave2) {
$slave->succeed("mkdir -m 700 /root/.ssh"); $slave->succeed("mkdir -m 700 /root/.ssh");
$slave->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys"); $slave->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys");
$slave->waitForJob("sshd"); $slave->waitForUnit("sshd");
$client->succeed("ssh -o StrictHostKeyChecking=no " . $slave->name() . " 'echo hello world'"); $client->succeed("ssh -o StrictHostKeyChecking=no " . $slave->name() . " 'echo hello world'");
} }