summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-15 17:16:32 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-15 16:30:04 +0000
commit1b5c6d088673ed6813f9f0e59bd1bb9101b84d51 (patch)
tree0fc4f9f3513453cdd8571c405820a0be95388c4a
parent1d27c58523e498d60e9214867b0e3cf2d278900b (diff)
downloadalpine-conf-1b5c6d088673ed6813f9f0e59bd1bb9101b84d51.zip
setup-interfaces: use iw instead of wireless-tools
also fix so we can join networks without PSK filter out hidden (\x00) SSIDs fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10518 fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10475
-rw-r--r--setup-interfaces.in11
-rwxr-xr-xtests/bin/iw965
-rwxr-xr-xtests/bin/iwlist66
-rwxr-xr-xtests/setup_interfaces_test33
4 files changed, 1002 insertions, 73 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in
index 6e4fb35..07427a0 100644
--- a/setup-interfaces.in
+++ b/setup-interfaces.in
@@ -122,10 +122,11 @@ find_essids() {
export essids_list=wlans
# Supports only open or PSK
$MOCK ip link set dev "$iface" up
- iwlist $iface scanning | awk -F: '
- /ESSID/ { gsub(/"/, "", $2); essid=$2 }
- /Authentication Suites/ { gsub(/^ +/, "", $2); printf "%s/%s\n", essid, $2 }
- ' | grep -v 802.1x | sort -u >"$essids_list"
+ (iw dev wlan0 scan; echo BSS) | awk -F": " '
+ /^BSS/ { if (ssid) { print ssid "/" auth }; ssid=""; auth="" }
+ $1 ~ /SSID/ { ssid=$2 }
+ $1 ~ /Authentication suites/ { auth=$2 }' \
+ | grep -E -v '(802.1x|\\x00)' | sort -u >"$essids_list"
if [ -s "$essids_list" ]; then
# we use / as separator since it is an illegal char in ssids
awk -F/ '{print $1}' "$essids_list"
@@ -197,7 +198,7 @@ config_iface() {
echo "raw_device=\"$raw_device\"" >> $conf
fi
if is_wifi $iface; then
- $MOCK apk add --quiet --no-progress wireless-tools wpa_supplicant || return
+ $MOCK apk add --quiet --no-progress iw wpa_supplicant || return
local wifi_configured=false
while ! $wifi_configured; do
echo "Available wireless networks (scanning):"
diff --git a/tests/bin/iw b/tests/bin/iw
new file mode 100755
index 0000000..1107a6c
--- /dev/null
+++ b/tests/bin/iw
@@ -0,0 +1,965 @@
+#!/bin/sh
+
+cat <<EOF
+BSS 98:77:e7:e6:75:2f(on wlan0)
+ last seen: 32823.268s [boottime]
+ TSF: 14449267512 usec (0d, 04:00:49)
+ freq: 2412
+ beacon interval: 100 TUs
+ capability: ESS Privacy SpectrumMgmt ShortSlotTime (0x0511)
+ signal: -70.00 dBm
+ last seen: 534 ms ago
+ Information elements from Probe Response frame:
+ SSID: Telenor0366rar
+ Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0
+ DS Parameter set: channel 1
+ Country: NO Environment: Indoor/Outdoor
+ Channels [1 - 13] @ 20 dBm
+ Power constraint: 0 dB
+ TPC report: TX power: 17 dBm
+ ERP: Barker_Preamble_Mode
+ Extended supported rates: 6.0 9.0 12.0 48.0
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
+ BSS Load:
+ * station count: 0
+ * channel utilisation: 30/255
+ * available admission capacity: 0 [*32us]
+ HT capabilities:
+ Capabilities: 0x9bc
+ HT20
+ SM Power Save disabled
+ RX Greenfield
+ RX HT20 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 7935 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 8 usec (0x06)
+ HT RX MCS rate indexes supported: 0-15
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 1
+ * secondary channel offset: no secondary
+ * STA channel width: 20 MHz
+ * RIFS: 1
+ * HT protection: no
+ * non-GF present: 1
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * Operating Mode Notification
+ WPS: * Version: 1.0
+ * Wi-Fi Protected Setup State: 2 (Configured)
+ * Response Type: 3 (AP)
+ * UUID: 39383737-4537-f536-f735-323739383737
+ * Manufacturer: Kaon
+ * Model: DG2200TN
+ * Model Number: 1.1
+ * Serial Number: 071202804172938
+ * Primary Device Type: 6-0050f204-1
+ * Device name: WiFi Ruter
+ * Config methods: Ethernet, Label
+ * RF Bands: 0x3
+ * Version2: 2.0
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS 98:77:e7:e6:75:30(on wlan0)
+ last seen: 32823.249s [boottime]
+ TSF: 14449248712 usec (0d, 04:00:49)
+ freq: 2412
+ beacon interval: 100 TUs
+ capability: ESS Privacy SpectrumMgmt ShortSlotTime (0x0511)
+ signal: -68.00 dBm
+ last seen: 554 ms ago
+ Information elements from Probe Response frame:
+ SSID: Telenor0366rar-5GHz
+ Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0
+ DS Parameter set: channel 1
+ Country: NO Environment: Indoor/Outdoor
+ Channels [1 - 13] @ 20 dBm
+ Power constraint: 0 dB
+ TPC report: TX power: 17 dBm
+ ERP: Barker_Preamble_Mode
+ Extended supported rates: 6.0 9.0 12.0 48.0
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
+ BSS Load:
+ * station count: 1
+ * channel utilisation: 30/255
+ * available admission capacity: 0 [*32us]
+ HT capabilities:
+ Capabilities: 0x9bc
+ HT20
+ SM Power Save disabled
+ RX Greenfield
+ RX HT20 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 7935 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 8 usec (0x06)
+ HT RX MCS rate indexes supported: 0-15
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 1
+ * secondary channel offset: no secondary
+ * STA channel width: 20 MHz
+ * RIFS: 1
+ * HT protection: no
+ * non-GF present: 1
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * Operating Mode Notification
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS 98:77:e7:e6:75:28(on wlan0)
+ last seen: 32823.596s [boottime]
+ TSF: 3253548449222 usec (37d, 15:45:48)
+ freq: 5500
+ beacon interval: 100 TUs
+ capability: ESS Privacy SpectrumMgmt (0x0111)
+ signal: -61.00 dBm
+ last seen: 207 ms ago
+ Information elements from Probe Response frame:
+ SSID: Telenor0366rar
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ Country: NO Environment: Indoor/Outdoor
+ Channels [36 - 36] @ 23 dBm
+ Channels [40 - 40] @ 23 dBm
+ Channels [44 - 44] @ 23 dBm
+ Channels [48 - 48] @ 23 dBm
+ Channels [52 - 52] @ 23 dBm
+ Channels [56 - 56] @ 23 dBm
+ Channels [60 - 60] @ 23 dBm
+ Channels [64 - 64] @ 23 dBm
+ Channels [100 - 100] @ 30 dBm
+ Channels [104 - 104] @ 30 dBm
+ Channels [108 - 108] @ 30 dBm
+ Channels [112 - 112] @ 30 dBm
+ Channels [116 - 116] @ 30 dBm
+ Channels [132 - 132] @ 30 dBm
+ Channels [136 - 136] @ 30 dBm
+ Channels [140 - 140] @ 30 dBm
+ Power constraint: 0 dB
+ TPC report: TX power: 24 dBm
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
+ BSS Load:
+ * station count: 1
+ * channel utilisation: 27/255
+ * available admission capacity: 0 [*32us]
+ Measurement Pilot Transmission:
+ * interval: 0 TUs
+ HT capabilities:
+ Capabilities: 0x1ef
+ RX LDPC
+ HT20/HT40
+ SM Power Save disabled
+ RX HT20 SGI
+ RX HT40 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 4 usec (0x05)
+ HT RX MCS rate indexes supported: 0-31
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 100
+ * secondary channel offset: above
+ * STA channel width: any
+ * RIFS: 0
+ * HT protection: no
+ * non-GF present: 1
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * Operating Mode Notification
+ * Max Number Of MSDUs In A-MSDU is unlimited
+ VHT capabilities:
+ VHT Capabilities (0x0f836992):
+ Max MPDU length: 11454
+ Supported Channel Width: neither 160 nor 80+80
+ RX LDPC
+ TX STBC
+ SU Beamformer
+ VHT RX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT RX highest supported: 0 Mbps
+ VHT TX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT TX highest supported: 0 Mbps
+ VHT extended NSS: not supported
+ VHT operation:
+ * channel width: 1 (80 MHz)
+ * center freq segment 1: 106
+ * center freq segment 2: 0
+ * VHT basic MCS set: 0x0000
+ Transmit Power Envelope:
+ * Local Maximum Transmit Power For 20 MHz: 1 dBm
+ * Local Maximum Transmit Power For 40 MHz: 1 dBm
+ * Local Maximum Transmit Power For 80 MHz: 1 dBm
+ WPS: * Version: 1.0
+ * Wi-Fi Protected Setup State: 2 (Configured)
+ * Response Type: 3 (AP)
+ * UUID: 39383737-4537-f536-f735-323739383737
+ * Manufacturer: Kaon
+ * Model: DG2200TN
+ * Model Number: 1.1
+ * Serial Number: 071202804172938
+ * Primary Device Type: 6-0050f204-1
+ * Device name: WiFi Ruter
+ * Config methods: Ethernet, Label
+ * RF Bands: 0x3
+ * Version2: 2.0
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS 98:77:e7:e6:75:29(on wlan0)
+ last seen: 32823.597s [boottime]
+ TSF: 3253548450629 usec (37d, 15:45:48)
+ freq: 5500
+ beacon interval: 100 TUs
+ capability: ESS Privacy SpectrumMgmt (0x0111)
+ signal: -62.00 dBm
+ last seen: 207 ms ago
+ Information elements from Probe Response frame:
+ SSID: Telenor0366rar-5GHz
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ Country: NO Environment: Indoor/Outdoor
+ Channels [36 - 36] @ 23 dBm
+ Channels [40 - 40] @ 23 dBm
+ Channels [44 - 44] @ 23 dBm
+ Channels [48 - 48] @ 23 dBm
+ Channels [52 - 52] @ 23 dBm
+ Channels [56 - 56] @ 23 dBm
+ Channels [60 - 60] @ 23 dBm
+ Channels [64 - 64] @ 23 dBm
+ Channels [100 - 100] @ 30 dBm
+ Channels [104 - 104] @ 30 dBm
+ Channels [108 - 108] @ 30 dBm
+ Channels [112 - 112] @ 30 dBm
+ Channels [116 - 116] @ 30 dBm
+ Channels [132 - 132] @ 30 dBm
+ Channels [136 - 136] @ 30 dBm
+ Channels [140 - 140] @ 30 dBm
+ Power constraint: 0 dB
+ TPC report: TX power: 24 dBm
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
+ BSS Load:
+ * station count: 3
+ * channel utilisation: 27/255
+ * available admission capacity: 0 [*32us]
+ Measurement Pilot Transmission:
+ * interval: 0 TUs
+ HT capabilities:
+ Capabilities: 0x1ef
+ RX LDPC
+ HT20/HT40
+ SM Power Save disabled
+ RX HT20 SGI
+ RX HT40 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 4 usec (0x05)
+ HT RX MCS rate indexes supported: 0-31
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 100
+ * secondary channel offset: above
+ * STA channel width: any
+ * RIFS: 0
+ * HT protection: no
+ * non-GF present: 1
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * Operating Mode Notification
+ * Max Number Of MSDUs In A-MSDU is unlimited
+ VHT capabilities:
+ VHT Capabilities (0x0f836992):
+ Max MPDU length: 11454
+ Supported Channel Width: neither 160 nor 80+80
+ RX LDPC
+ TX STBC
+ SU Beamformer
+ VHT RX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT RX highest supported: 0 Mbps
+ VHT TX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT TX highest supported: 0 Mbps
+ VHT extended NSS: not supported
+ VHT operation:
+ * channel width: 1 (80 MHz)
+ * center freq segment 1: 106
+ * center freq segment 2: 0
+ * VHT basic MCS set: 0x0000
+ Transmit Power Envelope:
+ * Local Maximum Transmit Power For 20 MHz: 1 dBm
+ * Local Maximum Transmit Power For 40 MHz: 1 dBm
+ * Local Maximum Transmit Power For 80 MHz: 1 dBm
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS 70:3a:cb:f9:ea:13(on wlan0)
+ last seen: 32823.670s [boottime]
+ TSF: 2609379901842 usec (30d, 04:49:39)
+ freq: 5180
+ beacon interval: 100 TUs
+ capability: ESS Privacy RadioMeasure (0x1011)
+ signal: -59.00 dBm
+ last seen: 134 ms ago
+ Information elements from Probe Response frame:
+ SSID: kano1
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ DS Parameter set: channel 36
+ Country: NL Environment: Indoor/Outdoor
+ Channels [36 - 48] @ 20 dBm
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
+ RM enabled capabilities:
+ Capabilities: 0x72 0x00 0x00 0x00 0x00
+ Neighbor Report
+ Beacon Passive Measurement
+ Beacon Active Measurement
+ Beacon Table Measurement
+ Nonoperating Channel Max Measurement Duration: 0
+ Measurement Pilot Capability: 0
+ Supported operating classes:
+ * current operating class: 128
+ HT capabilities:
+ Capabilities: 0x1ef
+ RX LDPC
+ HT20/HT40
+ SM Power Save disabled
+ RX HT20 SGI
+ RX HT40 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 8 usec (0x06)
+ HT TX/RX MCS rate indexes supported: 0-15
+ HT operation:
+ * primary channel: 36
+ * secondary channel offset: above
+ * STA channel width: any
+ * RIFS: 0
+ * HT protection: no
+ * non-GF present: 1
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * SSID List
+ * Operating Mode Notification
+ * FTM Responder
+ * Max Number Of MSDUs In A-MSDU is unlimited
+ VHT capabilities:
+ VHT Capabilities (0x338139b2):
+ Max MPDU length: 11454
+ Supported Channel Width: neither 160 nor 80+80
+ RX LDPC
+ short GI (80 MHz)
+ TX STBC
+ SU Beamformer
+ SU Beamformee
+ RX antenna pattern consistency
+ TX antenna pattern consistency
+ VHT RX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: not supported
+ 4 streams: not supported
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT RX highest supported: 0 Mbps
+ VHT TX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: not supported
+ 4 streams: not supported
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT TX highest supported: 0 Mbps
+ VHT extended NSS: not supported
+ VHT operation:
+ * channel width: 1 (80 MHz)
+ * center freq segment 1: 42
+ * center freq segment 2: 0
+ * VHT basic MCS set: 0xfffc
+ Transmit Power Envelope:
+ * Local Maximum Transmit Power For 20 MHz: 20 dBm
+ * Local Maximum Transmit Power For 40 MHz: 20 dBm
+ * Local Maximum Transmit Power For 80 MHz: 20 dBm
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS 98:77:e7:e6:74:d7(on wlan0)
+ last seen: 32823.533s [boottime]
+ TSF: 6880319488624 usec (79d, 15:11:59)
+ freq: 5260
+ beacon interval: 100 TUs
+ capability: ESS Privacy SpectrumMgmt (0x0111)
+ signal: -90.00 dBm
+ last seen: 270 ms ago
+ SSID: \x00\x00\x00\x00\x00\x00
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ TIM: DTIM Count 0 DTIM Period 3 Bitmap Control 0x0 Bitmap[0] 0x0
+ Country: NO Environment: Indoor/Outdoor
+ Channels [36 - 36] @ 23 dBm
+ Channels [40 - 40] @ 23 dBm
+ Channels [44 - 44] @ 23 dBm
+ Channels [48 - 48] @ 23 dBm
+ Channels [52 - 52] @ 23 dBm
+ Channels [56 - 56] @ 23 dBm
+ Channels [60 - 60] @ 23 dBm
+ Channels [64 - 64] @ 23 dBm
+ Channels [100 - 100] @ 30 dBm
+ Channels [104 - 104] @ 30 dBm
+ Channels [108 - 108] @ 30 dBm
+ Channels [112 - 112] @ 30 dBm
+ Channels [116 - 116] @ 30 dBm
+ Channels [132 - 132] @ 30 dBm
+ Channels [136 - 136] @ 30 dBm
+ Channels [140 - 140] @ 30 dBm
+ Power constraint: 0 dB
+ TPC report: TX power: 20 dBm
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
+ BSS Load:
+ * station count: 0
+ * channel utilisation: 7/255
+ * available admission capacity: 0 [*32us]
+ Measurement Pilot Transmission:
+ * interval: 0 TUs
+ HT capabilities:
+ Capabilities: 0x1ef
+ RX LDPC
+ HT20/HT40
+ SM Power Save disabled
+ RX HT20 SGI
+ RX HT40 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 4 usec (0x05)
+ HT RX MCS rate indexes supported: 0-31
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 52
+ * secondary channel offset: above
+ * STA channel width: any
+ * RIFS: 0
+ * HT protection: no
+ * non-GF present: 1
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * Operating Mode Notification
+ * Max Number Of MSDUs In A-MSDU is unlimited
+ VHT capabilities:
+ VHT Capabilities (0x0f836992):
+ Max MPDU length: 11454
+ Supported Channel Width: neither 160 nor 80+80
+ RX LDPC
+ TX STBC
+ SU Beamformer
+ VHT RX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT RX highest supported: 0 Mbps
+ VHT TX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT TX highest supported: 0 Mbps
+ VHT extended NSS: not supported
+ VHT operation:
+ * channel width: 1 (80 MHz)
+ * center freq segment 1: 58
+ * center freq segment 2: 0
+ * VHT basic MCS set: 0x0000
+ Transmit Power Envelope:
+ * Local Maximum Transmit Power For 20 MHz: 1 dBm
+ * Local Maximum Transmit Power For 40 MHz: 1 dBm
+ * Local Maximum Transmit Power For 80 MHz: 1 dBm
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS fa:8f:ca:7a:98:1c(on wlan0)
+ last seen: 32823.548s [boottime]
+ TSF: 7227059405167 usec (83d, 15:30:59)
+ freq: 5500
+ beacon interval: 100 TUs
+ capability: ESS (0x0001)
+ signal: -86.00 dBm
+ last seen: 254 ms ago
+ SSID:
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ TIM: DTIM Count 0 DTIM Period 2 Bitmap Control 0x0 Bitmap[0] 0x0 (+ 1 octet)
+ HT capabilities:
+ Capabilities: 0x12c
+ HT20
+ SM Power Save disabled
+ RX HT20 SGI
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: No restriction (0x00)
+ HT RX MCS rate indexes supported: 0-7
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 100
+ * secondary channel offset: no secondary
+ * STA channel width: 20 MHz
+ * RIFS: 0
+ * HT protection: nonmember
+ * non-GF present: 0
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ WMM: * Parameter version 1
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS 34:21:09:2c:0c:ea(on wlan0)
+ last seen: 32823.263s [boottime]
+ TSF: 94245752 usec (0d, 00:01:34)
+ freq: 2412
+ beacon interval: 100 TUs
+ capability: ESS Privacy ShortPreamble ShortSlotTime (0x0431)
+ signal: -38.00 dBm
+ last seen: 540 ms ago
+ Information elements from Probe Response frame:
+ SSID: Lynx2C0CEA
+ Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0
+ DS Parameter set: channel 1
+ ERP: <no flags>
+ Extended supported rates: 24.0 36.0 48.0 54.0
+ HT capabilities:
+ Capabilities: 0x1ad
+ RX LDPC
+ HT20
+ SM Power Save disabled
+ RX HT20 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 8 usec (0x06)
+ HT TX/RX MCS rate indexes supported: 0-23
+ HT operation:
+ * primary channel: 1
+ * secondary channel offset: no secondary
+ * STA channel width: 20 MHz
+ * RIFS: 0
+ * HT protection: nonmember
+ * non-GF present: 0
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Overlapping BSS scan params:
+ * passive dwell: 20 TUs
+ * active dwell: 10 TUs
+ * channel width trigger scan interval: 300 s
+ * scan passive total per channel: 200 TUs
+ * scan active total per channel: 20 TUs
+ * BSS width channel transition delay factor: 5
+ * OBSS Scan Activity Threshold: 0.25 %
+ Extended capabilities:
+ * HT Information Exchange Supported
+ * Operating Mode Notification
+ WMM: * Parameter version 1
+ * u-APSD
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
+ WPA: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+BSS 34:21:09:2c:0c:e9(on wlan0)
+ last seen: 32823.655s [boottime]
+ TSF: 106862001 usec (0d, 00:01:46)
+ freq: 5220
+ beacon interval: 100 TUs
+ capability: ESS SpectrumMgmt ShortSlotTime (0x0501)
+ signal: -52.00 dBm
+ last seen: 147 ms ago
+ Information elements from Probe Response frame:
+ SSID: Lynx2C0CEA_5G
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ DS Parameter set: channel 44
+ Country: NO Environment: Indoor/Outdoor
+ Channels [36 - 36] @ 20 dBm
+ Channels [40 - 40] @ 20 dBm
+ Channels [44 - 44] @ 20 dBm
+ Channels [48 - 48] @ 20 dBm
+ Channels [52 - 52] @ 20 dBm
+ Channels [56 - 56] @ 20 dBm
+ Channels [60 - 60] @ 20 dBm
+ Channels [64 - 64] @ 20 dBm
+ Channels [100 - 100] @ 27 dBm
+ Channels [104 - 104] @ 27 dBm
+ Channels [108 - 108] @ 27 dBm
+ Channels [112 - 112] @ 27 dBm
+ Channels [116 - 116] @ 27 dBm
+ Channels [120 - 120] @ 27 dBm
+ Channels [124 - 124] @ 27 dBm
+ Channels [128 - 128] @ 27 dBm
+ Channels [132 - 132] @ 27 dBm
+ Channels [136 - 136] @ 27 dBm
+ Channels [140 - 140] @ 27 dBm
+ Power constraint: 3 dB
+ HT capabilities:
+ Capabilities: 0x9ef
+ RX LDPC
+ HT20/HT40
+ SM Power Save disabled
+ RX HT20 SGI
+ RX HT40 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 7935 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 8 usec (0x06)
+ HT TX/RX MCS rate indexes supported: 0-23
+ HT operation:
+ * primary channel: 44
+ * secondary channel offset: above
+ * STA channel width: any
+ * RIFS: 1
+ * HT protection: no
+ * non-GF present: 0
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Operating Mode Notification
+ * Max Number Of MSDUs In A-MSDU is unlimited
+ VHT capabilities:
+ VHT Capabilities (0x338001b2):
+ Max MPDU length: 11454
+ Supported Channel Width: neither 160 nor 80+80
+ RX LDPC
+ short GI (80 MHz)
+ TX STBC
+ RX antenna pattern consistency
+ TX antenna pattern consistency
+ VHT RX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: not supported
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT RX highest supported: 0 Mbps
+ VHT TX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: not supported
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT TX highest supported: 0 Mbps
+ VHT extended NSS: not supported
+ VHT operation:
+ * channel width: 1 (80 MHz)
+ * center freq segment 1: 42
+ * center freq segment 2: 0
+ * VHT basic MCS set: 0xfffc
+ Transmit Power Envelope:
+ * Local Maximum Transmit Power For 20 MHz: -20 dBm
+ * Local Maximum Transmit Power For 40 MHz: -20 dBm
+ * Local Maximum Transmit Power For 80 MHz: -20 dBm
+ WMM: * Parameter version 1
+ * u-APSD
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+BSS ec:be:dd:b3:ed:6a(on wlan0)
+ last seen: 32823.714s [boottime]
+ TSF: 2700558540874 usec (31d, 06:09:18)
+ freq: 5540
+ beacon interval: 100 TUs
+ capability: ESS Privacy SpectrumMgmt (0x0111)
+ signal: -86.00 dBm
+ last seen: 90 ms ago
+ SSID: Get-B3ED64
+ Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0
+ TIM: DTIM Count 0 DTIM Period 1 Bitmap Control 0x0 Bitmap[0] 0x0
+ Country: NO Environment: Indoor/Outdoor
+ Channels [36 - 36] @ 23 dBm
+ Channels [40 - 40] @ 23 dBm
+ Channels [44 - 44] @ 23 dBm
+ Channels [48 - 48] @ 23 dBm
+ Channels [52 - 52] @ 23 dBm
+ Channels [56 - 56] @ 23 dBm
+ Channels [60 - 60] @ 23 dBm
+ Channels [64 - 64] @ 23 dBm
+ Channels [100 - 100] @ 30 dBm
+ Channels [104 - 104] @ 30 dBm
+ Channels [108 - 108] @ 30 dBm
+ Channels [112 - 112] @ 30 dBm
+ Channels [116 - 116] @ 30 dBm
+ Channels [120 - 120] @ 30 dBm
+ Channels [124 - 124] @ 30 dBm
+ Channels [128 - 128] @ 30 dBm
+ Channels [132 - 132] @ 30 dBm
+ Channels [136 - 136] @ 30 dBm
+ Channels [140 - 140] @ 30 dBm
+ Power constraint: 0 dB
+ TPC report: TX power: 23 dBm
+ RSN: * Version: 1
+ * Group cipher: CCMP
+ * Pairwise ciphers: CCMP
+ * Authentication suites: PSK
+ * Capabilities: 16-PTKSA-RC 1-GTKSA-RC MFP-capable (0x008c)
+ * 0 PMKIDs
+ * Group mgmt cipher suite: AES-128-CMAC
+ BSS Load:
+ * station count: 0
+ * channel utilisation: 3/255
+ * available admission capacity: 0 [*32us]
+ HT capabilities:
+ Capabilities: 0x1e3
+ RX LDPC
+ HT20/HT40
+ Static SM Power Save
+ RX HT20 SGI
+ RX HT40 SGI
+ TX STBC
+ RX STBC 1-stream
+ Max AMSDU length: 3839 bytes
+ No DSSS/CCK HT40
+ Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
+ Minimum RX AMPDU time spacing: 4 usec (0x05)
+ HT RX MCS rate indexes supported: 0-32
+ HT TX MCS rate indexes are undefined
+ HT operation:
+ * primary channel: 108
+ * secondary channel offset: above
+ * STA channel width: any
+ * RIFS: 0
+ * HT protection: no
+ * non-GF present: 0
+ * OBSS non-GF present: 0
+ * dual beacon: 0
+ * dual CTS protection: 0
+ * STBC beacon: 0
+ * L-SIG TXOP Prot: 0
+ * PCO active: 0
+ * PCO phase: 0
+ Extended capabilities:
+ * Extended Channel Switching
+ * BSS Transition
+ * Operating Mode Notification
+ * Max Number Of MSDUs In A-MSDU is unlimited
+ VHT capabilities:
+ VHT Capabilities (0x0f8b79b2):
+ Max MPDU length: 11454
+ Supported Channel Width: neither 160 nor 80+80
+ RX LDPC
+ short GI (80 MHz)
+ TX STBC
+ SU Beamformer
+ SU Beamformee
+ MU Beamformer
+ VHT RX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT RX highest supported: 0 Mbps
+ VHT TX MCS set:
+ 1 streams: MCS 0-9
+ 2 streams: MCS 0-9
+ 3 streams: MCS 0-9
+ 4 streams: MCS 0-9
+ 5 streams: not supported
+ 6 streams: not supported
+ 7 streams: not supported
+ 8 streams: not supported
+ VHT TX highest supported: 0 Mbps
+ VHT extended NSS: not supported
+ VHT operation:
+ * channel width: 0 (20 or 40 MHz)
+ * center freq segment 1: 110
+ * center freq segment 2: 0
+ * VHT basic MCS set: 0x0000
+ Transmit Power Envelope:
+ * Local Maximum Transmit Power For 20 MHz: 1 dBm
+ * Local Maximum Transmit Power For 40 MHz: 1 dBm
+ WPS: * Version: 1.0
+ * Wi-Fi Protected Setup State: 2 (Configured)
+ * UUID: 57285ad6-0672-af03-d074-f343b8f2f6e5
+ * RF Bands: 0x3
+ * Version2: 2.0
+ WMM: * Parameter version 1
+ * u-APSD
+ * BE: CW 15-1023, AIFSN 3
+ * BK: CW 15-1023, AIFSN 7
+ * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
+ * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
+EOF
diff --git a/tests/bin/iwlist b/tests/bin/iwlist
deleted file mode 100755
index 6b92726..0000000
--- a/tests/bin/iwlist
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-cat<<EOF
-wlan0 Scan completed :
- Cell 01 - Address: 98:77:E7:E6:75:2F
- Channel:1
- Frequency:2.412 GHz (Channel 1)
- Quality=45/70 Signal level=-65 dBm
- Encryption key:on
- ESSID:"Telenor0366rar"
- Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
- 24 Mb/s; 36 Mb/s; 54 Mb/s
- Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
- Mode:Master
- Extra:tsf=00000167602af804
- Extra: Last beacon: 2067ms ago
- IE: Unknown: 000E54656C656E6F7230333636726172
- IE: Unknown: 010882848B962430486C
- IE: Unknown: 030101
- IE: Unknown: 07064E4F20010D14
- IE: Unknown: 200100
- IE: Unknown: 23021100
- IE: Unknown: 2A0104
- IE: Unknown: 32040C121860
- IE: IEEE 802.11i/WPA2 Version 1
- Group Cipher : CCMP
- Pairwise Ciphers (1) : CCMP
- Authentication Suites (1) : PSK
- IE: Unknown: 0B0501002E0000
- IE: Unknown: 2D1ABC091BFFFF000000000000000000000000000000000000000000
- IE: Unknown: 3D1601080400000000000000000000000000000000000000
- IE: Unknown: 7F080400080000000040
- IE: Unknown: DD840050F204104A0001101044000102103B00010310470010393837374537F536F735323739383737102100044B616F6E10230008444732323030544E10240003312E311042000F3037313230323830343137323933381054000800060050F20400011011000A57694669205275746572100800020006103C0001031049000600372A000120
- IE: Unknown: DD090010180201001C0000
- IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
- Cell 02 - Address: 98:77:E7:E6:75:30
- Channel:1
- Frequency:2.412 GHz (Channel 1)
- Quality=45/70 Signal level=-65 dBm
- Encryption key:on
- ESSID:"Telenor0366rar-5GHz"
- Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
- 24 Mb/s; 36 Mb/s; 54 Mb/s
- Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
- Mode:Master
- Extra:tsf=00000167602b053e
- Extra: Last beacon: 2064ms ago
- IE: Unknown: 001354656C656E6F72303336367261722D3547487A
- IE: Unknown: 010882848B962430486C
- IE: Unknown: 030101
- IE: Unknown: 07064E4F20010D14
- IE: Unknown: 200100
- IE: Unknown: 23021100
- IE: Unknown: 2A0104
- IE: Unknown: 32040C121860
- IE: IEEE 802.11i/WPA2 Version 1
- Group Cipher : CCMP
- Pairwise Ciphers (1) : CCMP
- Authentication Suites (1) : PSK
- IE: Unknown: 0B0504002E0000
- IE: Unknown: 2D1ABC091BFFFF000000000000000000000000000000000000000000
- IE: Unknown: 3D1601080400000000000000000000000000000000000000
- IE: Unknown: 7F080400080000000040
- IE: Unknown: DD090010180204001C0000
- IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
-EOF
diff --git a/tests/setup_interfaces_test b/tests/setup_interfaces_test
index e210b26..e848da3 100755
--- a/tests/setup_interfaces_test
+++ b/tests/setup_interfaces_test
@@ -9,7 +9,8 @@ init_tests \
setup_interfaces_interactive_vlan0_ng \
setup_interfaces_interactive_br0 \
setup_interfaces_interactive_bond0 \
- setup_interfaces_interactive_wlan0
+ setup_interfaces_interactive_wlan0_psk \
+ setup_interfaces_interactive_wlan0_none
setup_interfaces_usage_body() {
test_usage setup-interfaces
@@ -154,7 +155,7 @@ setup_interfaces_interactive_bond0_body() {
setup-interfaces <answers
}
-setup_interfaces_interactive_wlan0_body() {
+setup_interfaces_interactive_wlan0_psk_body() {
init_env
create_fake_ifaces lo eth0 wlan2
mkdir -p sys/class/net/wlan2/phy80211
@@ -173,7 +174,35 @@ setup_interfaces_interactive_wlan0_body() {
)>answers
atf_check -s exit:0 \
-o match:"Available interfaces are: eth0 wlan2" \
+ -o match:"Lynx2C0CEA_5G" \
+ -o match:"Get-B3ED64" \
+ -o not-match:"x00" \
-o match:"Type the \"Telenor0366rar\" network Pre-Shared Key" \
-o match:"Ip address for wlan2" \
setup-interfaces <answers
}
+
+setup_interfaces_interactive_wlan0_none_body() {
+ init_env
+ create_fake_ifaces lo eth0 wlan0
+ mkdir -p sys/class/net/wlan0/phy80211
+
+ (
+ # Which one do you want to initialize? (or '?' or 'done') [eth0]
+ echo wlan0
+ # Type the wireless network name to connect to:
+ echo Lynx2C0CEA_5G
+ # Ip address for wlan0? (or 'dhcp', 'none', '?') [dhcp]
+ echo dhcp
+ # Do you want to do any manual network configuration? (y/n) [n]
+ echo n
+ )>answers
+ atf_check -s exit:0 \
+ -o match:"Available interfaces are: eth0 wlan0" \
+ -o match:"Telenor0366rar" \
+ -o match:"Get-B3ED64" \
+ -o not-match:"x00" \
+ -o not-match:"Type the \"Lynx2C0CEA_5g\" network Pre-Shared Key" \
+ -o match:"Ip address for wlan0" \
+ setup-interfaces <answers
+}