about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/release-combined.nix1
-rw-r--r--nixos/release.nix2
-rw-r--r--nixos/tests/networking.nix11
3 files changed, 14 insertions, 0 deletions
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;