From 552e583ef0977cdb6a17299971a62019e003c0c0 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 19 Mar 2019 11:01:57 +0100 Subject: [PATCH 1/2] nixos/containers: create veths if only IPv6 is configured This fixes the failing nixos.tests.containers-ipv6 test. Thanks to andir. --- nixos/modules/virtualisation/containers.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 7c9909ae278..d10c4feecb4 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -36,8 +36,9 @@ let #! ${pkgs.runtimeShell} -e # Initialise the container side of the veth pair. - if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ] || [ -n "$HOST_BRIDGE" ]; then - + if [ -n "$HOST_ADDRESS" ] || [ -n "$HOST_ADDRESS6" ] || + [ -n "$LOCAL_ADDRESS" ] || [ -n "$LOCAL_ADDRESS6" ] || + [ -n "$HOST_BRIDGE" ]; then ip link set host0 name eth0 ip link set dev eth0 up @@ -88,7 +89,8 @@ let extraFlags+=" --private-network" fi - if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ]; then + if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ] || + [ -n "$HOST_ADDRESS6" ] || [ -n "$LOCAL_ADDRESS6" ]; then extraFlags+=" --network-veth" fi @@ -159,7 +161,8 @@ let # Clean up existing machined registration and interfaces. machinectl terminate "$INSTANCE" 2> /dev/null || true - if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ]; then + if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ] || + [ -n "$HOST_ADDRESS6" ] || [ -n "$LOCAL_ADDRESS6" ]; then ip link del dev "ve-$INSTANCE" 2> /dev/null || true ip link del dev "vb-$INSTANCE" 2> /dev/null || true fi @@ -208,7 +211,8 @@ let ''; in '' - if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ]; then + if [ -n "$HOST_ADDRESS" ] || [ -n "$LOCAL_ADDRESS" ] || + [ -n "$HOST_ADDRESS6" ] || [ -n "$LOCAL_ADDRESS6" ]; then if [ -z "$HOST_BRIDGE" ]; then ifaceHost=ve-$INSTANCE ip link set dev $ifaceHost up From 862615b86eaf00b56316dd5cbf070be957e8a98b Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sun, 24 Mar 2019 18:09:39 +0100 Subject: [PATCH 2/2] nixos/release: make ipv6 tests as important as legacy IP tests IPv6 container support broke a while ago and we didn't notice it. Making them part of the (small) release test set should fix that. At this point in time they should be granted the same amount of importance as the legacy IP tests. --- nixos/release-combined.nix | 1 + nixos/release-small.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 6c313f8dd3e..b9a9515f94e 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -64,6 +64,7 @@ in rec { #(all nixos.tests.containers) (all nixos.tests.containers-imperative) (all nixos.tests.containers-ipv4) + (all nixos.tests.containers-ipv6) nixos.tests.chromium.x86_64-linux or [] (all nixos.tests.firefox) (all nixos.tests.firewall) diff --git a/nixos/release-small.nix b/nixos/release-small.nix index 4bfb9a423f7..b5b09dc38d0 100644 --- a/nixos/release-small.nix +++ b/nixos/release-small.nix @@ -33,6 +33,7 @@ in rec { inherit (nixos'.tests) containers-imperative containers-ipv4 + containers-ipv6 firewall ipv6 login