1 import ./make-test-python.nix ({ pkgs, lib, ...}:
4 meta = with lib.maintainers; {
5 maintainers = [ rnhmjoj ];
8 # Router running radvd on VLAN 1
9 nodes.router = { ... }: {
10 imports = [ ../modules/profiles/minimal.nix ];
12 virtualisation.vlans = [ 1 ];
14 boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
18 interfaces.eth1.ipv6.addresses =
19 [ { address = "fd12::1"; prefixLength = 64; } ];
28 AdvOtherConfigFlag on;
37 # Client running connman, connected to VLAN 1
38 nodes.client = { ... }: {
39 virtualisation.vlans = [ 1 ];
41 # add a virtual wlan interface
42 boot.kernelModules = [ "mac80211_hwsim" ];
43 boot.extraModprobeConfig = ''
44 options mac80211_hwsim radios=1
47 # Note: the overrides are needed because the wifi is
48 # disabled with mkVMOverride in qemu-vm.nix.
49 services.connman.enable = lib.mkOverride 0 true;
50 services.connman.networkInterfaceBlacklist = [ "eth0" ];
51 networking.wireless.enable = lib.mkOverride 0 true;
52 networking.wireless.interfaces = [ "wlan0" ];
59 with subtest("Router is ready"):
60 router.wait_for_unit("radvd.service")
62 with subtest("Daemons are running"):
63 client.wait_for_unit("wpa_supplicant-wlan0.service")
64 client.wait_for_unit("connman.service")
65 client.wait_until_succeeds("connmanctl state | grep -q ready")
67 with subtest("Wired interface is configured"):
68 client.wait_until_succeeds("ip -6 route | grep -q fd12::/64")
69 client.wait_until_succeeds("ping -c 1 fd12::1")
71 with subtest("Can set up a wireless access point"):
72 client.succeed("connmanctl enable wifi")
73 client.wait_until_succeeds("connmanctl tether wifi on nixos-test reproducibility | grep -q 'Enabled'")
74 client.wait_until_succeeds("iw wlan0 info | grep -q nixos-test")