diff options
author | Nikita Uvarov <uv.nikita@gmail.com> | 2019-01-04 22:24:13 +0100 |
---|---|---|
committer | Nikita Uvarov <uv.nikita@gmail.com> | 2019-01-07 14:21:17 +0100 |
commit | 53013ead39a40e51878a76e24f94a4ae46a9b98a (patch) | |
tree | c0c4a446bcff259627cdb0f44654509d4eed1446 /nixos/tests/containers-bridge.nix | |
parent | 9a262a71a1e0ceae8b014aadc1de0e50dbc471b4 (diff) | |
download | nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.tar nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.tar.gz nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.tar.bz2 nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.tar.lz nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.tar.xz nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.tar.zst nixlib-53013ead39a40e51878a76e24f94a4ae46a9b98a.zip |
nixos/containers: add bridge without address specified
According to systemd-nspawn(1), --network-bridge implies --network-veth, and --port option is supported only when private networking is enabled. Fixes #52417.
Diffstat (limited to 'nixos/tests/containers-bridge.nix')
-rw-r--r-- | nixos/tests/containers-bridge.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nixos/tests/containers-bridge.nix b/nixos/tests/containers-bridge.nix index 777cf9a7e7f9..0eae51433d20 100644 --- a/nixos/tests/containers-bridge.nix +++ b/nixos/tests/containers-bridge.nix @@ -45,6 +45,19 @@ import ./make-test.nix ({ pkgs, ...} : { }; }; + containers.web-noip = + { + autoStart = true; + privateNetwork = true; + hostBridge = "br0"; + config = + { services.httpd.enable = true; + services.httpd.adminAddr = "foo@example.org"; + networking.firewall.allowedTCPPorts = [ 80 ]; + }; + }; + + virtualisation.pathsInNixDB = [ pkgs.stdenv ]; }; @@ -56,6 +69,10 @@ import ./make-test.nix ({ pkgs, ...} : { # Start the webserver container. $machine->succeed("nixos-container status webserver") =~ /up/ or die; + # Check if bridges exist inside containers + $machine->succeed("nixos-container run webserver -- ip link show eth0"); + $machine->succeed("nixos-container run web-noip -- ip link show eth0"); + "${containerIp}" =~ /([^\/]+)\/([0-9+])/; my $ip = $1; chomp $ip; |