about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/networking.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/networking.nix')
-rw-r--r--nixpkgs/nixos/tests/networking.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/networking.nix b/nixpkgs/nixos/tests/networking.nix
index c8756207f27b..22f7ca5a9b82 100644
--- a/nixpkgs/nixos/tests/networking.nix
+++ b/nixpkgs/nixos/tests/networking.nix
@@ -721,6 +721,24 @@ let
         assert "mtu 1442" in client.succeed("ip l show dummy0")
       '';
     };
+    wlanInterface = let
+      testMac = "06:00:00:00:02:00";
+    in {
+      name = "WlanInterface";
+      machine = { pkgs, ... }: {
+        boot.kernelModules = [ "mac80211_hwsim" ];
+        networking.wlanInterfaces = {
+          wlan0 = { device = "wlan0"; };
+          wap0 = { device = "wlan0"; mac = testMac; };
+        };
+      };
+      testScript = ''
+        machine.start()
+        machine.wait_for_unit("network.target")
+        machine.wait_until_succeeds("ip address show wap0 | grep -q ${testMac}")
+        machine.fail("ip address show wlan0 | grep -q ${testMac}")
+      '';
+    };
   };
 
 in mapAttrs (const (attrs: makeTest (attrs // {