nixos/containers-hosts: Port test to python

This commit is contained in:
Jacek Galowicz 2019-11-25 21:57:46 +01:00
parent acb53c777c
commit e4abed35be

View file

@ -1,6 +1,6 @@
# Test for NixOS' container support.
import ./make-test.nix ({ pkgs, ...} : {
import ./make-test-python.nix ({ pkgs, ...} : {
name = "containers-hosts";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ montag451 ];
@ -42,11 +42,11 @@ import ./make-test.nix ({ pkgs, ...} : {
};
testScript = ''
startAll;
$machine->waitForUnit("default.target");
start_all()
machine.wait_for_unit("default.target")
# Ping the containers using the entries added in /etc/hosts
$machine->succeed("ping -n -c 1 simple.containers");
$machine->succeed("ping -n -c 1 netmask.containers");
with subtest("Ping the containers using the entries added in /etc/hosts"):
for host in "simple.containers", "netmask.containers":
machine.succeed(f"ping -n -c 1 {host}")
'';
})