connman-services-switchover manual
critical
- Image Types:
- basesdk-amd64 / hmi-armhf / hmi-amd64 / sdk-amd64
- Image Deployment:
- APT, OSTree
- Type:
- functional
Description
Tests Network connection management: ensuring that ConnMan can connect to actual networks even after the device under test is rebooted
Pre Conditions
- Ensure Rootfs is remounted as read/write.
- Install dependencies
- Restart the system to restore the filesystem state to read-only before running the test.
- The device must have wifi, otherwise skip this test.
- A mobile Hot-Spot must be setup
- Please note that connman disables wifi by default on a fresh image. To enable:
- If it's already enabled, connmanctl will give the error "Error wifi: Already enabled" that may be ignored.
$ sudo mount -o remount,rw /
$ sudo apt install wget
$ sudo reboot
$ connmanctl enable wifi
Execution Steps
- Run the ConnMan CLI Interface:
- When run without arguments, connmanctl will launch in interactive mode with a "connmanctl>" prompt.
- Scan wifi:
- Wait for "Scan completed for wifi" before continuing (this may take a few seconds and will appear above connmanctl prompt).
- Turn on the agent, to manage additional information if required:
- connmanctl should return "Agent registered".
- List services available:
- Select required service and use the "service ID" (second column) to connect:
- If it's connecting to a Wi-Fi service that needs additional information connmanctl will output an "Agent RequestInput (…)" line followed by a prompt for the required information, such as "Passphrase? ".
- Ensure ConnMan returns "Connected <service ID>" before continuing.
- Quit from connmanctl interactive mode with:
- On the terminal enter $wget www.google.com
- Wget is successfull and the connection is establised via Wi-Fi
- Disconnect from the Wi-Fi network
- Connect to the mobile hot-spot that you have setup on your phone by entering the right password
- Quit from connmanctl interactive mode with:
$ connmanctl
$connmanctl> scan wifi
$connmanctl> agent on
$connmanctl> services
$connmanctl> connect <service ID>
$connmanctl> quit
$ connmanctl
$connmanctl> scan wifi
$connmanctl> quit
$ connmanctl
$connmanctl> scan wifi
$ "Connect back to the Wi-Fi network"
Expected
If success "Connected <service ID>" will be printed by connmanctl, otherwise "Agent ReportError <service ID>" will be printed.
On executing the wget command the connection should succeed and you should be able to ping any website
On switching over from the mobile hot-spot to Wi-Fi network connman should not ask the user to re-enter the password for the Wi-Fi network
Notes
- Warning: Connman changes are persistent (over reboot!). After finishing testing, it might be wise to perform the dhcp test to ensure that the network is in a sensible state.
- For ALL tests the enable step will give an "In progress" error if the device is already enabled. This is to be expected.
- When testing the SDK image in VirtualBox with an Asus USB-N10 Wireless adapter, firmware-realtek needs to be installed on the host.