mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-01 18:44:07 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
86 lines
2.4 KiB
Nix
86 lines
2.4 KiB
Nix
import ./make-test-python.nix (
|
|
{ pkgs, lib, ... }:
|
|
{
|
|
name = "connman";
|
|
meta = with lib.maintainers; {
|
|
maintainers = [ rnhmjoj ];
|
|
};
|
|
|
|
# Router running radvd on VLAN 1
|
|
nodes.router =
|
|
{ ... }:
|
|
{
|
|
imports = [ ../modules/profiles/minimal.nix ];
|
|
|
|
virtualisation.vlans = [ 1 ];
|
|
|
|
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
|
|
|
|
networking = {
|
|
useDHCP = false;
|
|
interfaces.eth1.ipv6.addresses = [
|
|
{
|
|
address = "fd12::1";
|
|
prefixLength = 64;
|
|
}
|
|
];
|
|
};
|
|
|
|
services.radvd = {
|
|
enable = true;
|
|
config = ''
|
|
interface eth1 {
|
|
AdvSendAdvert on;
|
|
AdvManagedFlag on;
|
|
AdvOtherConfigFlag on;
|
|
prefix fd12::/64 {
|
|
AdvAutonomous off;
|
|
};
|
|
};
|
|
'';
|
|
};
|
|
};
|
|
|
|
# Client running connman, connected to VLAN 1
|
|
nodes.client =
|
|
{ ... }:
|
|
{
|
|
virtualisation.vlans = [ 1 ];
|
|
|
|
# add a virtual wlan interface
|
|
boot.kernelModules = [ "mac80211_hwsim" ];
|
|
boot.extraModprobeConfig = ''
|
|
options mac80211_hwsim radios=1
|
|
'';
|
|
|
|
# Note: the overrides are needed because the wifi is
|
|
# disabled with mkVMOverride in qemu-vm.nix.
|
|
services.connman.enable = lib.mkOverride 0 true;
|
|
services.connman.networkInterfaceBlacklist = [ "eth0" ];
|
|
networking.wireless.enable = lib.mkOverride 0 true;
|
|
networking.wireless.interfaces = [ "wlan0" ];
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
|
|
with subtest("Router is ready"):
|
|
router.wait_for_unit("radvd.service")
|
|
|
|
with subtest("Daemons are running"):
|
|
client.wait_for_unit("wpa_supplicant-wlan0.service")
|
|
client.wait_for_unit("connman.service")
|
|
client.wait_until_succeeds("connmanctl state | grep -q ready")
|
|
|
|
with subtest("Wired interface is configured"):
|
|
client.wait_until_succeeds("ip -6 route | grep -q fd12::/64")
|
|
client.wait_until_succeeds("ping -c 1 fd12::1")
|
|
|
|
with subtest("Can set up a wireless access point"):
|
|
client.succeed("connmanctl enable wifi")
|
|
client.wait_until_succeeds("connmanctl tether wifi on nixos-test reproducibility | grep -q 'Enabled'")
|
|
client.wait_until_succeeds("iw wlan0 info | grep -q nixos-test")
|
|
'';
|
|
}
|
|
)
|