Skip to content
Snippets Groups Projects

Adding Wi-Fi AP testcases to Apertis

Merged Benani Sagar Kishore requested to merge wip/Wi-Fi_AP into apertis/v2023dev1
Compare and
4 files
+ 352
0
Compare changes
  • Side-by-side
  • Inline
Files
4
metadata:
name: wifi-accesspoint-uncontrolled-shutdown-reboot
format: "Apertis Test Definition 1.0"
image-types:
hmi: [ armhf ]
image-deployment:
- OSTree
type: functional
exec-type: manual
priority: critical
maintainer: "Apertis Project"
description: "Test that the Wi-Fi AP connection is re-established after rebooting the AP, which is setup on the target."
resources:
- "Two Wi-Fi USB dongles, see https://www.apertis.org/reference_hardware/extras/"
pre-conditions:
- "Make sure to connect the Wi-Fi USB dongles to both target and SDK."
expected:
- "After rebooting the target device, you should be able to reconnect from
the SDK to the Wi-Fi access point 'KEYMNGMT_TRNSMODE' running on the target device."
- "On the SDK, ensure to be connected to the 'KEYMNGMT_TRNSMODE' network"
- |
>$ connmanctl> services
*AR KEYMNGMT_TRNSMODE wifi_1c872cc7c71d_4b45594d4e474d545f50534b_managed_psk
connmanctl>
- "On the target device the 'hostapd' output log should show a successful connection:"
- |
>$ journalctl -b -u hostapd
wlan0: AP-STA-CONNECTED 0c:9d:92:70:fd:4c
wlan0: STA 0c:9d:92:70:fd:4c RADIUS: starting accounting session 97DB26400B1D3921
wlan0: AP-STA-DISCONNECTED 0c:9d:92:70:fd:4c
wlan0: STA 0c:9d:92:70:fd:4c IEEE 802.11: authenticated
wlan0: STA 0c:9d:92:70:fd:4c IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED 0c:9d:92:70:fd:4c
wlan0: STA 0c:9d:92:70:fd:4c RADIUS: starting accounting session AEBCF08534CAE0B6
wlan0: AP-STA-DISCONNECTED 0c:9d:92:70:fd:4c
wlan0: interface state ENABLED->DISABLED
wlan0: AP-DISABLED
wlan0: CTRL-EVENT-TERMINATING
nl80211: deinit ifname=wlx1c872cc7c71d disabled_11b_rates=0
run:
steps:
- "On the target device execute the below steps."
- "Check the wifi interface name (e.g. 'wlan0') running:"
- $ WIFI_SERVICE=$(connmanctl services | grep -m 1 -o 'wifi_.*')
- $ WIFI_IFACE=$(connmanctl services "$WIFI_SERVICE" | grep -o 'Interface=\w\+' | sed s/Interface=//)
- "Execute the steps as in wifi-wpa3-transition-mode-accesspoint-setup.yaml but with the below changes to the '/etc/hostapd/hostapd.conf' file"
- "ssid=KEYMNGMT_TRNSMODE"
- "auth_algs=1"
- "wpa=2"
- "wpa_key_mgmt=WPA-PSK SAE"
- "wpa_passphrase=12345678"
- "sae_password=12345678"
- "ieee80211w=1"
- "sae_require_mfp=1"
- "Create the file '/lib/systemd/network/hostapd.network' as in wifi-wpa3-transition-mode-accesspoint-setup.yaml"
- "Finally, run the following commands on the target device as in wifi-wpa3-transition-mode-accesspoint-setup.yaml:"
- "On the SDK, connect to 'KEYMNGMT_TRNSMODE' running the following commands:"
- |
>$ connmanctl
connmanctl> enable wifi
connmanctl> agent on
Agent registered
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
KEYMNGMT_TRNSMODE wifi_1c872cc7c71d_4b45594d4e474d545f50534b_managed_psk
connmanctl> connect wifi_1c872cc7c71d_4b45594d4e474d545f50534b_managed_psk
Agent RequestInput wifi_1c872cc7c71d_4b45594d4e474d545f50534b_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory ]
Passphrase? 12345678
Connected wifi_1c872cc7c71d_4b45594d4e474d545f50534b_managed_psk
connmanctl> services
*AR KEYMNGMT_TRNSMODE wifi_1c872cc7c71d_4b45594d4e474d545f50534b_managed_psk
connmanctl>
- "After the connection has been established, reboot the access point by
pressing the reboot button on the target device. Then, on the target device,
restart the 'hostapd' daemon and 'systemd-networkd' service, by running:"
- "$ sudo systemctl restart systemd-networkd"
- "$ sudo systemctl restart hostapd"
- "On the SDK, reconnect to 'KEYMNGMT_TRNSMODE' by re-running the previous
'connmanctl' commands."
Loading