connman-pan-network-access manual
medium
- Image Types:
- basesdk-amd64 / hmi-armhf / hmi-arm64 / hmi-amd64 / sdk-amd64
- Image Deployment:
- APT, OSTree
- Type:
- functional
Description
Test ConnMan support for bluetooth PAN Network Access Profile. This test will test internet access from Apertis to a bluetooth device sharing its internet connection. The underlying connection makes use of Bluetooth Network Access Profile with connman. First the two devices will be paired, then connection will be established. It will then be possible to verify that internet is usable from Apertis.
Resources
- A USB Bluetooth adapter.
- A phone supporting PAN NAP. A computer can also be used to share its internet connection.
Pre Conditions
- From a PC, download and unpack the test data tarball from the gitlab test repository:
- Copy the connman-pan-network-access-* folder to the target device:
- Log into the target device:
- After log into the DUT, enter the test directory
- Note that the tarball may change depending on the release/branch being tested, please make sure to download the correct tarball for the release in question.
- Make sure an Internet connection is active on the phone and can be shared. The steps are phone specific.
- Ensure the bluetooth adapter is detected in Apertis: In VirtualBox menu, select "Devices > USB" and check the entry corresponding to the selected bluetooth adapter.
- Please note that connman disables bluetooth by default on a fresh image. If it's already enabled, connmanctl will give an "In progress" error that may be ignored. To enable the device:
$ wget https://gitlab.apertis.org/tests/connman-pan-network-access/-/archive/apertis/v2025pre/connman-pan-network-access.tar.gz
$ tar -xvf connman-pan-network-access.tar.gz
$ DUT_IP=<device-ip>
$ scp -r connman-pan-network-access-* user@$DUT_IP:
$ ssh user@$DUT_IP
$ cd connman-pan-network-access-*
$ connmanctl enable bluetooth
Execution Steps
- To ensure effective usage of bluetooth and not ethernet, one can use:
- The phone must be in discoverable mode for starting this test. Look for the phone in this list, and save the BT address. It will be used while running the test.
- Execute the test suite inside an environment with dbus:
- There are some options:
- Once the test begins, after Apertis finishes pairing with the phone, you must initiate pairing from the phone and do the pairing again as part of the test. You may need to unpair Apertis from within the phone first. The test will display the following message when that is required:
- After you've initiated the pairing from the phone, the test will continue.
- If the pairing fails from the test, try to do the pairing separately, and then run the test using './bluez-phone.sh -a <phone addr> -s'. To do a separate pairing: unpair the phone, and run 'bluetoothctl'. Then, in bluetoothctl prompt, issue the following commands in order: 'remove <phone addr>', 'discoverable on', 'agent off', 'agent NoInputNoOutput', 'default-agent'. The either 'pairable on' to pair from phone, or 'pair <phone addr>' to issue a pairing to the phone. '<phone addr>' is the phone address of the form 'a1:b2:c3:d4:e5:f6'.
$ connmanctl disable ethernet
$ ./connman-pan-network-access.sh
-a select which device you want to pair with (specify the address)
-s skip pairing because the device is already paired. -a must be present when using this.
-x enables test debugging (only useful if a test fails)
Start a pairing from the phone! was it successful (y/n).
Expected
If PASSED is displayed, all of the test have passed. The output should be similar to that:
select_adapter
Selected /org/bluez/hci0
select_device: Discovering...
Device found: F0:39:42:86:2E:1B Charge 2
Device found: 88:83:22:2F:56:2A Galaxy A5 2016
Input device address: 88:83:22:2F:56:2A
Selected address: 88:83:22:2F:56:2A
start_agent
test_pairing_initiator
Scanning in progress...
Pairing request to 88:83:22:2F:56:2A in progress...
Device found: /org/bluez/hci0/dev_88_83_22_2F_56_2A
Device 88_83_22_2F_56_2A is paired
test_pairing_responder
Start a pairing from the phone! was it successful (y/n):
y
Device found: /org/bluez/hci0/dev_88_83_22_2F_56_2A
Device 88_83_22_2F_56_2A is paired
test_profile_nap
()
PING www.google.com (142.250.76.196) : 56 data bytes
64 bytes from 142.250.76.196: seq=0 ttl=115 time=143.53ms
64 bytes from 142.250.76.196: seq=1 ttl=115 time=98.99ms
64 bytes from 142.250.76.196: seq=2 ttl=115 time=102.334ms
64 bytes from 142.250.76.196: seq=3 ttl=115 time=85.894ms
64 bytes from 142.250.76.196: seq=4 ttl=115 time=56.789ms
()
--- www.google.com ping statistics ---
5 packets transmitted , 5 packets received , 0%packet loss
round-trip min/avg/max = 185.720/117.88/198.340 ms
()
PASSED
Post Conditions
- Enable ethernet again if it was disabled
$ connmanctl enable ethernet
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.