urfkill

Description

This is a test plan for urfkill as used by Ubuntu Touch. It does not cover scenarios and/or test cases for urfkill installed on the desktop.

urfkill is the central daemon responsible for managing radio power on a Touch device. As such, it's responsible for monitoring the radio power states for Bluetooth, GSM, and Wi-Fi. It also implements the FlightMode mechanism for the device. When FlightMode is activated via urfkill's DBus API, it will save the current state of all the radios, and power them all down. It keeps track of subsequent radio power state changes ( as BT and Wi-Fi can be re-enabled while FlightMode is active ), and handles restoring the correct states whenever FlightMode is disabled.

Note -- urfkill is the sole component that manages the GSM radio power state. Previously both telephathy-ofono and network-manager had logic to toggle ofono's Online property ( which in turn controls the radio power state ).

Setup

urfkill testing requires usage of the ofono-scripts ( /usr/share/ofono/scripts ), as well as a few test scripts used to communicate with urfkill's DBus API. These latter scripts have not yet been packaged, but will be made available soon.

Test Cases

1. Modem Set Online Post-Boot

Purpose

Ensure that the modem is set online by default when during device start-up.

Steps:

  • boot the device

Verification:

  • verify that the modem is online:

   # /usr/share/ofono/scripts/list-modems | grep Online
     Online = 1

Automation Status

Automation of the urfkill testing is currently blocked pending improvements to the emulator's telephony support.


2. FlightMode Enabled - Modem Set Offline

Purpose

Ensure that the modem is set offline when FlightMode is enabled.

Steps:

  • boot the device
  • enable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 1

Verification:

  • verify that the modem is offline:

   # /usr/share/ofono/scripts/list-modems | grep Online
     Online = 0

Automation Status

Same as above.


3. Disable Flightmode - Modem set Online

Purpose

Ensure that the modem becomes online again when FlightMode is disabled.

Steps:

  • disable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 0

Verification:

  • verify that the modem is online:

   # /usr/share/ofono/scripts/list-modems | grep Online
     Online = 1

Automation Status

Same as above.


4. FlightMode Enabled - All Radios Powered Off

Purpose

Ensure that all radios are off while in flight mode.

Steps:

  • enable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 1

Verification:

  • verify that killswitches are listed as blocked (note that the WLAN device will just not be listed for devices with MTK SoC, as in that case the wlan driver is unloaded when flight mode is set):

   # rfkill list
   0: phy0: Wireless LAN
       Soft blocked: yes
       Hard blocked: no
   1: hci0: Bluetooth
       Soft blocked: yes
       Hard blocked: no

Automation Status

Same as above.


5. FlightMode Enabled - Reboot

Purpose

Ensure that all radios are off after a reboot with flight mode enabled.

Steps:

  • enable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 1
  • reboot

Verification:

  • verify that killswitches are listed as blocked (note that the WLAN device will just not be listed for devices with MTK SoC, as in that case the wlan driver is unloaded when flight mode is set):

   # rfkill list
   0: phy0: Wireless LAN
       Soft blocked: yes
       Hard blocked: no
   1: hci0: Bluetooth
       Soft blocked: yes
       Hard blocked: no
  • Verify that flight mode is enabled:

   # /usr/share/urfkill/scripts/flight-mode
   1

Automation Status

Same as above.


5a. Wi-Fi On, FlightMode Enabled, Reboot, FlightMode Disabled

Purpose

Ensure that all Wi-Fi is on after reboot and FlightMode disabled.

Steps:

Verification:

Automation Status

Same as above.


5b. Wi-Fi Off, FlightMode Enabled, Reboot, FlightMode Disabled

Purpose

Ensure that all Wi-Fi is off after reboot and FlightMode disabled.

Steps:

Verification:

Automation Status

Same as above.


6. FlightMode Disabled - All Radios Powered

Purpose

Ensure that all radios are on when flight mode is disabled.

Steps:

  • disable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 0

Verification:

  • verify that killswitches are listed as not blocked:

   # rfkill list
   0: phy0: Wireless LAN
       Soft blocked: no
       Hard blocked: no
   1: hci0: Bluetooth
       Soft blocked: no
       Hard blocked: no
  • Verify that flight mode is disabled:

   # /usr/share/urfkill/scripts/flight-mode
   0

Automation Status

Same as above.


7. FlightMode Enabled, WiFi Enabled, FlightMode Disabled

Purpose

Ensure that wifi can be enabled independently.

Steps:

  • enable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 1
  • unblock wifi:

   # /usr/share/urfkill/scripts/block wifi 0
  • do verifications
  • disable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 0
  • do verifications again

Verification:

  • verify that killswitches are listed in the correct state:

   # rfkill list
  • Verify that flight mode is in the correct state:

   # /usr/share/urfkill/scripts/flight-mode

Automation Status

Same as above.


8. FlightMode Enabled, Bluetooth Enabled, FlightMode Disabled

Purpose

Ensure that bluetooth can be enabled independently. Warning /!\ May not work on some devices due to the way they currently handle bluetooth initialization.

Steps:

  • enable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 1
  • unblock bluetooth:

   # /usr/share/urfkill/scripts/block bluetooth 0
  • do verifications
  • disable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 0
  • do verifications again

Verification:

  • verify that killswitches are listed in the correct state:

   # rfkill list
  • Verify that flight mode is in the correct state:

   # /usr/share/urfkill/scripts/flight-mode

Automation Status

Same as above.


9. Recover from bad modem state

Purpose

Ensure that we can recover access to the mobile network after exiting flight mode.

Steps:

  • offline modems using ofono scripts (repeat with /ril_1 for dual SIM phones):

   # /usr/share/ofono/scripts/offline-modem /ril_0
  • enable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 1
  • disable FlightMode:

   # /usr/share/urfkill/scripts/flight-mode 0

Verification:

  • verify that the modems are online and that we register to the mobile network:

   # /usr/share/ofono/scripts/list-modems

Process/Merges/TestPlans/urfkill (last edited 2015-03-18 15:35:11 by alfonsosanchezbeato)