connman-pan-network-access manual

medium

Image Types:
basesdk-amd64 / hmi-armhf / 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

  1. From a PC, download and unpack the test data tarball from the gitlab test repository:
  2. $ wget https://gitlab.apertis.org/tests/connman-pan-network-access/-/archive/apertis/v2023dev3/connman-pan-network-access.tar.gz
    $ tar -xvf connman-pan-network-access.tar.gz
  3. Copy the connman-pan-network-access-* folder to the target device:
  4. $ DUT_IP=<device-ip>
    $ scp -r connman-pan-network-access-* user@$DUT_IP:
  5. Log into the target device:
  6. $ ssh user@$DUT_IP
  7. After log into the DUT, enter the test directory
  8. $ cd connman-pan-network-access-*
  9. 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.
  10. Make sure an Internet connection is active on the phone and can be shared. The steps are phone specific.
  11. Ensure the bluetooth adapter is detected in Apertis: In VirtualBox menu, select "Devices > USB" and check the entry corresponding to the selected bluetooth adapter.
  12. 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:
  13. $ connmanctl enable bluetooth

Execution Steps

  1. To ensure effective usage of bluetooth and not ethernet, one can use:
  2. $ connmanctl disable ethernet
  3. 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.
  4. Execute the test suite inside an environment with dbus:
  5. $ ./connman-pan-network-access.sh
  6. There are some options:
  7. -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)

  8. 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:
  9. Start a pairing from the phone! was it successful (y/n).

  10. After you've initiated the pairing from the phone, the test will continue.
  11. 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'.

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

  1. Enable ethernet again if it was disabled
  2. $ 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.