From 4c61faa009df175b77148ce587ade14fe9b31b12 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 18 Dec 2015 07:09:42 +0100 Subject: [PATCH] nixos/tests/networking: Add a test for loopback It serves as a regression test, because right now if you enable networking.useNetworkd the default loopback interface doesn't get assigned any IP addresses. To be sure, I have bisected this and it has been introduced with the update to systemd 228 in 1da87d4. Only the "scripted" networking tests have to succeed in order to trigger a channel update of nixos-unstable, so I'm leaving this test as broken and we have to figure out next what's the *exact* reason for the breakage. Signed-off-by: aszlig --- nixos/release-combined.nix | 1 + nixos/release.nix | 2 ++ nixos/tests/networking.nix | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 9a2a77b31554..06890b458efa 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -71,6 +71,7 @@ in rec { (all nixos.tests.misc) (all nixos.tests.nat.firewall) (all nixos.tests.nat.standalone) + (all nixos.tests.networking.scripted.loopback) (all nixos.tests.networking.scripted.static) (all nixos.tests.networking.scripted.dhcpSimple) (all nixos.tests.networking.scripted.dhcpOneIf) diff --git a/nixos/release.nix b/nixos/release.nix index b5ac97b3b94f..e1235c5fe28e 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -256,6 +256,7 @@ in rec { tests.mysqlReplication = callTest tests/mysql-replication.nix {}; tests.nat.firewall = callTest tests/nat.nix { withFirewall = true; }; tests.nat.standalone = callTest tests/nat.nix { withFirewall = false; }; + tests.networking.networkd.loopback = callTest tests/networking.nix { networkd = true; test = "loopback"; }; tests.networking.networkd.static = callTest tests/networking.nix { networkd = true; test = "static"; }; tests.networking.networkd.dhcpSimple = callTest tests/networking.nix { networkd = true; test = "dhcpSimple"; }; tests.networking.networkd.dhcpOneIf = callTest tests/networking.nix { networkd = true; test = "dhcpOneIf"; }; @@ -264,6 +265,7 @@ in rec { tests.networking.networkd.macvlan = callTest tests/networking.nix { networkd = true; test = "macvlan"; }; tests.networking.networkd.sit = callTest tests/networking.nix { networkd = true; test = "sit"; }; tests.networking.networkd.vlan = callTest tests/networking.nix { networkd = true; test = "vlan"; }; + tests.networking.scripted.loopback = callTest tests/networking.nix { networkd = false; test = "loopback"; }; tests.networking.scripted.static = callTest tests/networking.nix { networkd = false; test = "static"; }; tests.networking.scripted.dhcpSimple = callTest tests/networking.nix { networkd = false; test = "dhcpSimple"; }; tests.networking.scripted.dhcpOneIf = callTest tests/networking.nix { networkd = false; test = "dhcpOneIf"; }; diff --git a/nixos/tests/networking.nix b/nixos/tests/networking.nix index 6a7f63702c41..813d7c2bf516 100644 --- a/nixos/tests/networking.nix +++ b/nixos/tests/networking.nix @@ -31,6 +31,17 @@ import ./make-test.nix ({ pkgs, networkd, test, ... }: }; }; testCases = { + loopback = { + name = "Loopback"; + machine.networking.useNetworkd = networkd; + testScript = '' + startAll; + $machine->waitForUnit("network-interfaces.target"); + $machine->waitForUnit("network.target"); + $machine->succeed("ip addr show lo | grep -q 'inet 127.0.0.1/8 '"); + $machine->succeed("ip addr show lo | grep -q 'inet6 ::1/128 '"); + ''; + }; static = { name = "Static"; nodes.router = router;