feat(ci-wlan): use wpa_supplicant
This commit is contained in:
parent
9fdae776de
commit
e44b081d49
7 changed files with 63 additions and 4 deletions
|
@ -27,6 +27,7 @@ let
|
||||||
modules = [
|
modules = [
|
||||||
{
|
{
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
|
source = nixpkgs;
|
||||||
overlays = [ overlay ];
|
overlays = [ overlay ];
|
||||||
config.permittedInsecurePackages = [
|
config.permittedInsecurePackages = [
|
||||||
"python-2.7.18.8"
|
"python-2.7.18.8"
|
||||||
|
|
|
@ -194,7 +194,11 @@ extraPkgs // {
|
||||||
});
|
});
|
||||||
in h.override { openssl = null; sqlite = null; };
|
in h.override { openssl = null; sqlite = null; };
|
||||||
|
|
||||||
|
wpa_supplicant = prev.wpa_supplicant.override {
|
||||||
|
dbusSupport = false;
|
||||||
|
withPcsclite = false;
|
||||||
|
wpa_supplicant_gui = null;
|
||||||
|
};
|
||||||
|
|
||||||
kexec-tools-static = prev.kexec-tools.overrideAttrs(o: {
|
kexec-tools-static = prev.kexec-tools.overrideAttrs(o: {
|
||||||
# For kexecboot we copy kexec into a ramdisk on the system being
|
# For kexecboot we copy kexec into a ramdisk on the system being
|
||||||
|
|
|
@ -7,6 +7,7 @@ in rec {
|
||||||
../../modules/wlan.nix
|
../../modules/wlan.nix
|
||||||
../../modules/hostapd
|
../../modules/hostapd
|
||||||
../../modules/network
|
../../modules/network
|
||||||
|
./wpa_supplicant.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.hostap = config.system.service.hostapd.build {
|
services.hostap = config.system.service.hostapd.build {
|
||||||
|
@ -27,5 +28,21 @@ in rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultProfile.packages = with pkgs; [ tcpdump ] ;
|
services.wpa_supplicant = config.system.service.wpa_supplicant.build {
|
||||||
|
interface = "wlan1";
|
||||||
|
driver = "nl80211";
|
||||||
|
config-file = pkgs.writeText "wpa_supplicant.conf" ''
|
||||||
|
country=us
|
||||||
|
update_config=1
|
||||||
|
ctrl_interface=/run/wpa_supplicant
|
||||||
|
|
||||||
|
network={
|
||||||
|
scan_ssid=1
|
||||||
|
ssid="liminix"
|
||||||
|
psk="colourless green ideas"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultProfile.packages = with pkgs; [ tcpdump wpa_supplicant ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
, nixpkgs
|
, nixpkgs
|
||||||
}:
|
}:
|
||||||
let img = (import liminix {
|
let img = (import liminix {
|
||||||
|
inherit nixpkgs;
|
||||||
device = import "${liminix}/devices/qemu/";
|
device = import "${liminix}/devices/qemu/";
|
||||||
liminix-config = ./configuration.nix;
|
liminix-config = ./configuration.nix;
|
||||||
}).outputs.default;
|
}).outputs.default;
|
||||||
|
|
|
@ -14,10 +14,10 @@ expect {
|
||||||
}
|
}
|
||||||
expect "#"
|
expect "#"
|
||||||
while { $FINISHED < 10 } {
|
while { $FINISHED < 10 } {
|
||||||
send "date && grep AP-ENABLED /run/uncaught-logs/* || echo \$NOT\r\n"
|
send "date && grep CTRL-EVENT-CONNECTED /run/uncaught-logs/* || echo \$NOT\r\n"
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
"wlan0: AP-ENABLED" { set FINISHED 999; set EXIT 0; }
|
"wlan1: CTRL-EVENT-CONNECTED" { set FINISHED 999; set EXIT 0; }
|
||||||
"not_present" { send_user "waiting ...\n" ; sleep 5 }
|
"not_present" { send_user "waiting ...\n" ; sleep 5 }
|
||||||
}
|
}
|
||||||
set FINISHED [ expr $FINISHED + 1 ]
|
set FINISHED [ expr $FINISHED + 1 ]
|
||||||
|
|
21
tests/wlan/wpa_service.nix
Normal file
21
tests/wlan/wpa_service.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
liminix,
|
||||||
|
wpa_supplicant,
|
||||||
|
lib,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
interface,
|
||||||
|
driver,
|
||||||
|
config-file,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (liminix.services) longrun;
|
||||||
|
inherit (lib.strings) escapeShellArg;
|
||||||
|
in
|
||||||
|
longrun {
|
||||||
|
name = "wpa_supplicant";
|
||||||
|
run =
|
||||||
|
''
|
||||||
|
${wpa_supplicant}/bin/wpa_supplicant -D${driver} -i${interface} -c ${config-file}
|
||||||
|
'';
|
||||||
|
}
|
15
tests/wlan/wpa_supplicant.nix
Normal file
15
tests/wlan/wpa_supplicant.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib; {
|
||||||
|
options.system.service.wpa_supplicant = mkOption { type = pkgs.liminix.lib.types.serviceDefn; };
|
||||||
|
config.system.service.wpa_supplicant = config.system.callService ./wpa_service.nix {
|
||||||
|
interface = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
driver = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
config-file = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue