From 25b71e18f50ed951ada5ad63e32f25d990abec5e Mon Sep 17 00:00:00 2001 From: Martin Bornhold Date: Thu, 16 Nov 2017 14:54:13 +0100 Subject: [PATCH] nixos-container: Modify existing test to cover show-ip command Modified the existing test to check that the 'nixos-container show-ip' command can handle ipv4 addresses with submask in CIDR notation. --- nixos/tests/containers-bridge.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/tests/containers-bridge.nix b/nixos/tests/containers-bridge.nix index 598abd22e61..b8d4759684c 100644 --- a/nixos/tests/containers-bridge.nix +++ b/nixos/tests/containers-bridge.nix @@ -69,6 +69,12 @@ import ./make-test.nix ({ pkgs, ...} : { $machine->succeed("ping -n -c 1 $ip6"); $machine->succeed("curl --fail http://[$ip6]/ > /dev/null"); + # Check that nixos-container show-ip works in case of an ipv4 address with + # subnetmask in CIDR notation. + my $result = $machine->succeed("nixos-container show-ip webserver"); + chomp $result; + $result eq $ip or die; + # Stop the container. $machine->succeed("nixos-container stop webserver"); $machine->fail("curl --fail --connect-timeout 2 http://$ip/ > /dev/null");