git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit25b71e18f50ed951ada5ad63e32f25d990abec5e authorMartin Bornhold <mb@bo-tech.de> dateThu 16 Nov 2017, 14:54 (9 years ago) parentac7edee
1 file changed+6
nixos/tests/containers-bridge.nix+6
nixos/tests/containers-bridge.nix+6
@@ -69,6 +69,12 @@ import ./make-test.nix ({ pkgs, ...} : {
6969 $machine->succeed("ping -n -c 1 $ip6");
7070 $machine->succeed("curl --fail http://[$ip6]/ > /dev/null");
7171
72+ # Check that nixos-container show-ip works in case of an ipv4 address with
73+ # subnetmask in CIDR notation.
74+ my $result = $machine->succeed("nixos-container show-ip webserver");
75+ chomp $result;
76+ $result eq $ip or die;
77+
7278 # Stop the container.
7379 $machine->succeed("nixos-container stop webserver");
7480 $machine->fail("curl --fail --connect-timeout 2 http://$ip/ > /dev/null");