diff options
author | Martin Milata <martin@martinmilata.cz> | 2019-12-01 02:29:24 +0100 |
---|---|---|
committer | Martin Milata <martin@martinmilata.cz> | 2019-12-08 18:16:01 +0100 |
commit | 6fbb76cf7664aa12170ba77b17687c759a860506 (patch) | |
tree | 7cad6e6253d02bea27e8010c85920b07ee6c543a /nixos/tests/containers-macvlans.nix | |
parent | cf5ec7ac6e9741e1ee3e0b2aa428fad83becbd73 (diff) |
nixosTests.containers*: port rest to python
Diffstat (limited to 'nixos/tests/containers-macvlans.nix')
-rw-r--r-- | nixos/tests/containers-macvlans.nix | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/nixos/tests/containers-macvlans.nix b/nixos/tests/containers-macvlans.nix index 2bdb926a8e2b7..0e8f67bc76f0b 100644 --- a/nixos/tests/containers-macvlans.nix +++ b/nixos/tests/containers-macvlans.nix @@ -6,7 +6,7 @@ let containerIp2 = "192.168.1.254"; in -import ./make-test.nix ({ pkgs, ...} : { +import ./make-test-python.nix ({ pkgs, ...} : { name = "containers-macvlans"; meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ montag451 ]; @@ -64,19 +64,23 @@ import ./make-test.nix ({ pkgs, ...} : { }; testScript = '' - startAll; - $machine1->waitForUnit("default.target"); - $machine2->waitForUnit("default.target"); + start_all() + machine1.wait_for_unit("default.target") + machine2.wait_for_unit("default.target") - # Ping between containers to check that macvlans are created in bridge mode - $machine1->succeed("nixos-container run test1 -- ping -n -c 1 ${containerIp2}"); + with subtest( + "Ping between containers to check that macvlans are created in bridge mode" + ): + machine1.succeed("nixos-container run test1 -- ping -n -c 1 ${containerIp2}") - # Ping containers from the host (machine1) - $machine1->succeed("ping -n -c 1 ${containerIp1}"); - $machine1->succeed("ping -n -c 1 ${containerIp2}"); + with subtest("Ping containers from the host (machine1)"): + machine1.succeed("ping -n -c 1 ${containerIp1}") + machine1.succeed("ping -n -c 1 ${containerIp2}") - # Ping containers from the second machine to check that containers are reachable from the outside - $machine2->succeed("ping -n -c 1 ${containerIp1}"); - $machine2->succeed("ping -n -c 1 ${containerIp2}"); + with subtest( + "Ping containers from the second machine to check that containers are reachable from the outside" + ): + machine2.succeed("ping -n -c 1 ${containerIp1}") + machine2.succeed("ping -n -c 1 ${containerIp2}") ''; }) |