Meego Wiki
Views

Quality/TestSuite/oFono Modem API Test Specification

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
m (Created page with "== Introduction == Blts-ofono package is meant to test oFono framework. Currently testing is done over D-Bus as well as those test coming with oFono. Difference is that these are…")
m
Line 158: Line 158:
<u>Arguments: </u>
<u>Arguments: </u>
-
{|cellspacing="0" border="1"
+
{{:Quality/TestSuite/Common_General_Switch}}
-
!|Switch  
+
{|style="width:100%" cellspacing="0" border="1"
-
!|Function
+
!style="width:20%"|Optional Switch  
-
 
+
!style="width:80%"|Function  
-
|-
+
-
|| -C || Used configuration file and path, for example /usr/share/blts-ofono-tests/blts-ofono.cnf
+
-
|-
+
-
|| -l  || Used log file, Used log file, default blts_ofono_log
+
-
|-
+
-
|| -e || Execute single or multiple selected tests, for example -e 1,4,5.
+
-
|-
+
-
|| -en || Execute test by name, for example -en "My test X"
+
-
|-
+
-
|| -s || Show list of all tests
+
-
|-
+
-
|| -? || Help message 
+
-
|-
+
-
|| -nc || Do not output log to terminal
+
-
|-
+
-
!|Optional switch
+
-
!|Function  
+
|-
|-
|| -r || Recipient address / phone number for voice call/SMS  
|| -r || Recipient address / phone number for voice call/SMS  
Line 194: Line 177:
|| -y || PIN code type ("pin", "pin2", "puk", ..)   
|| -y || PIN code type ("pin", "pin2", "puk", ..)   
|-
|-
-
|| -v || Call volume for Microphone/Speaker (0-100%)   
+
|| -V || Call volume for Microphone/Speaker (0-100%)   
|-
|-
|| -a || Accumulated Call Meter maximum value   
|| -a || Accumulated Call Meter maximum value   

Revision as of 13:04, 14 December 2010

Contents

Introduction

Blts-ofono package is meant to test oFono framework. Currently testing is done over D-Bus as well as those test coming with oFono. Difference is that these are written with C.

Test Coverage

The test cases are:

  • oFono - Call meters near max warning: Creates call and waits if call meter maximum warnin signal is received
  • oFono - Call meters reset: Resets all call meters to zero
  • oFono - Call meters set: Sets call meters unit conversion, currency code and call meter maximum
  • oFono - Call meters read: Read call meters status
  • oFono - Set muted: Sets call muted in middle of call
  • oFono - Set speaker volume: Speaker volume change in middle of call
  • oFono - Set microphone volume: Microphone volume change in middle of call
  • oFono - Call barrings test: Tests different barring rules setting
  • oFono - Change password for barrings: Changes PIN code for barrings
  • oFono - Disable barrings: Disables barring rules
  • oFono - Disable incoming barrings: Disables barring from incoming calls
  • oFono - Disable outgoing barrings: Disables barring from outgoing calls
  • oFono - Check barring properties: Show current barring settings
  • oFono - Forward if not reachable: Sets forward rule if not reachable
  • oFono - Forward if no reply: Sets forward rule when no reply
  • oFono - Forward if busy: Sets forward rule when busy
  • oFono - Unconditional forwarding: Sets unconditional forwarding
  • oFono - Disable forwardings: Disables forward rules
  • oFono - Call and send DTMF: Sends DMTF tones
  • oFono - Hold and answer: Answer to incoming call while other call active
  • oFono - Release and answer: Answer to incoming call and disconnecting other active call
  • oFono - Swap: Putting calls on hold and back to active state
  • oFono - Transfer: To see that you can join two calls together and leave out yourself
  • oFono - Cancel voicecall: Cancels incoming voicecall
  • oFono - Answer to voicecall and remote hang up: Tests that remote hangup works
  • oFono - Answer to voicecall and deflect: Deflect incoming call
  • oFono - Answer to voicecall and hangup all: Tests hangup all functionality
  • oFono - Answer to voicecall and hangup: Voicecall answer test
  • oFono - Create call with hidden caller ID and hangup: Tests if call can be made with hidden ID
  • oFono - Create call and hangup: Call creation test
  • oFono - Unlock PIN: Unlocks specific PIN code
  • oFono - Lock PIN: Lock specific PIN code
  • oFono - Reset PIN: Uses PUK code to reset PIN code
  • oFono - Enter PIN: Enters PIN code and enables SIM if not done
  • oFono - Change PIN: Changes SIM pin codes (pin, pin2,...)
  • oFono - Receive SMS: Receiving SMS
  • oFono - Send SMS: Sending SMS message
  • oFono - Information Query: Tries specific interfaces from modem. Phonebook, network and modem interface.
  • oFono - List all properties: Goes thought all possible interfaces and properties that oFono has
  • oFono - Register to network: Registers device in network
  • oFono - De-register from network: De-registers device from network
  • oFono - Enable modems: Enables as in powers up all modems in device
  • oFono - Set modems online: Makes modems go Online, aka turn off Flight mode
  • oFono - Set modems offline: Makes modems go Offline, aka turn on Flight mode
  • oFono - Propose scan: Ask networks statuses
  • oFono - SMSC number test: Test proper SMSC number validation
  • oFono - Multiparty call test: Test multiparty call case
  • oFono - Private call test: Tests creation of private chat out of multiparty call

Software Coverage

Current D-Bus API coverage for oFono tests:

Current oFono AT modem API coverage for oFono tests:

  • oFono-coverage-at-modem.ods

Hardware Coverage

Blts-ofono tests oFono framework more than it tests actual hardware. Different hardware may have different modems and you must specify which modem to use with oFono by setting up oFono correctly.

Limitations

Test suite functionality depends on implementation of used modem driver in oFono. Some test cases may fail if driver implementation does not support such behaviour.

NOTE: All following installation and execution instructions for oFono and phonesim are for reference only. Later releases may work differently and it is advised to follow the installation and usage guidelines provided with both software packages as baseline for all testing.

Future Improvements

More coverage with tests for oFono.

Running the tests

Setting up oFono

If test environment or device comes with oFono pre-installed, this section can be skipped.

In case oFono is not available, it is possible to either install binaries from repositories (if supported by test environment) or by downloading and building source codes from oFono.org.

To build oFono, follow these steps (replace /directory with the directory where make install should put the files):

$ ./configure --prefix=/directory
$ make
$ make install

Edit /directory/etc/ofono/modem.conf and add suitable configuration according to the DUT modem HW. The following example is for N900.

[isimodem]
Driver=isimodem

NOTE: You can also try to uncomment and enable oFono to use AT command based generic driver.

Prepare DUT:

  1. Copy everything from /directory to device root
  2. Copy all tests from test/ directory to device
  3. Copy src/ofono.conf to device /etc/dbus-1/system.d/
  4. Start oFono daemon (use -n and -d parameters for debug information):
$ ofonod -n -d

Setting up phonesim

If there is no suitable HW available for test execution or there is a need for verifying test case functionality, it is possible to run virtually all the test cases with phonesim. Phonesim basically emulates a modem device and network operation. It includes a GUI for testing for example creating voice calls and sending sms messages.

NOTE: Phonesim requires at least kernel version 2.6.28 with phonet support.

To use phonesim with oFono, follow the instructions below:

  • Download and install oFono from source packages as described above with following differences
  • Edit /etc/ofono/modem.conf and uncomment following lines
[phonesim]
Driver=phonesim
Address=127.0.0.1
Port=12345
  • Copy modem.conf to /usr/local/etc/ofono/ (this depends on your configure --prefix settings)
  • Do not run oFono yet!
  • Download phonesim source package from ofono.org
  • Build phonesim (You will need g++ and Qt packages, download and install as needed)
$ ./configure
$ make
  • Run phonesim directly from src/ (terminal session will freeze and nothing visible happens)
$ ./phonesim -p 12345 -gui default.xml
  • Run oFono directly from src/ with debugging mode (terminal session will freeze)
$ ./ofonod -n -d
  • poke phonesim virtual modem to powered state via dbus:
$ dbus-send --system --print-reply --type=method_call --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:true

or alternatively you may try to enable modem with oFono python script available with oFono source package

$ ./enable-modem

Phonesim GUI should now pop into screen. Tests can be executed as usual and you can make incoming calls and messages using phonesim GUI.

Executing tests

Compile blts-ofono-tests with corresponding environment

$ dpkg-buildpackge

and install package to DUT. You'll need to have SIM card in DUT with correct pin number entered. Now you can execute tests from command prompt Execute from host end command line:

$ blts-ofono

Test case arguments

Arguments:

General Switch Function
-l Used log file
-e Execute single or multiple selected tests, for example -e 1,4,5.
-en Execute test by name, for example -en "My test X"
-s Show list of all tests
-C Used configuration file
-? Help message
-xml, -axml Create result XML. -axml appends results to an existing XML file.
-auto Silent logging for test automation. Only the results are printed to stdout.
-v Verbose logging (default)
-vv Even more verbose logging
Optional Switch Function
-r Recipient address / phone number for voice call/SMS
-m SMS center address for SMS send
-f Number to forward calls in forward cases
-t Hangup timeout
-n New PIN code
-o Old (current) PIN code
-y PIN code type ("pin", "pin2", "puk", ..)
-V Call volume for Microphone/Speaker (0-100%)
-a Accumulated Call Meter maximum value
-p Price Per Unit conversion value
-c Three character currency code

Test cases

Test cases must be run with root priviliges.

NOTE: Running cases always resets call forwardings and call barrings with each test case use -o switch to give blts-ofono access to do so or use configuration file. If no pin code is given then default 3579 will be used.

Test cases marked with bold are able to be executed with variable data. See Test cases with variables.

Test case execution notices:

Case name Notice
oFono - Information Query
oFono - List all properties
oFono - Register to network
oFono - De-register from network
oFono - Enable modems
oFono - Set modems online
oFono - Set modems offline
oFono - Create voicecall -r <number> chooses recipient
oFono - Create voicecall with hidden caller ID -r <number> : Use <number> as call receiver
oFono - Answer to voicecall and hangup when "Start listening calls" is printed, call to DUT
oFono - Answer to voicecall and hangup all when "Start listening calls" is printed, call to DUT
oFono - Answer to voicecall and deflect when "Start listening calls" is printed, call to DUT
oFono - Answer to voicecall and remote hangup when "Start listening calls" is printed, call to DUT, wait a moment and hang up
oFono - Cancel voicecall when "Start listening calls" is printed, call to DUT
oFono - Transfer when "Start listening calls" is printed, call to DUT from two different number
oFono - Swap when "Start listening calls" is printed, call to DUT from two different number
oFono - Release and answer when "Start listening calls" is printed, call to DUT from two different number
oFono - Hold and answer when "Start listening calls" is printed, call to DUT from two different number
oFono - Call and send DTMF -r <number> : Use <number> as deflect call receiver, -t <timeout> : Use <timeout> how long call is active.
oFono - Disable forwardings Disable all forwardings. Run this after any other forwarding case
oFono - Unconditional forwarding Forward all incoming calls, -f <number> chooses recipient
oFono - Forward if busy DUT makes call to given number, verify functionality by calling to DUT. -f <number> chooses recipient
oFono - Forward if no reply Forwards calls if not call is not replied, -f <number> chooses recipient
oFono - Forward if not reachable Forward call when DUT not reachable, -f <number> chooses recipient
oFono - Send SMS -r <number> chooses recipient , -m <number> chooses service centre (optional on NTN)
oFono - Receive SMS When "Waiting for message..." is printed, send SMS to DUT
oFono - Change PIN -n <code> : New PIN, -o <code> : Old PIN, -y <type> : Password type (pin, pin2,...)
oFono - Enter PIN -o <code> : PIN code, -y <type> : Password type (pin, pin2,...)
oFono - Reset PIN -n <code> : PIN, -o <code> : PUK, -y <type> : Password type (pin, pin2,...)
oFono - Lock PIN -o <code> : PIN code, -y <type> : Password type (pin, pin2,...)
oFono - Unlock PIN -o <code> : Old PIN code, -y <type> : Password type (pin, pin2,...)
oFono - Set microphone volume -r <number> : Use <number> as call receiver, -v <volume> : Use <volume> as volume percent
oFono - Set speaker volume -r <number> : Use <number> as call receiver, -v <volume> : Use <volume> as volume percent.
oFono - Set muted -r <number> : Use <number> as call receiver
oFono - Call meters read -r <number> : Use <number> as call receiver
oFono - Call meters set -r <number> : Use <number> as call receiver, -o <code> : Old (current) PIN, -a <value> : Use <value> as accumulated call meter maximum - optional, -p <value> : Use <value> as price per unit conversion - optional, -c <code> : Use <code> as three character currency code - optional
oFono - Call meters reset -r <number> : Use <number> as call receiver, -o <code> : Old (current) PIN
oFono - Call meters near max warning -r <number> : Use <number> as call receiver, -o <code> : Old (current) PIN
oFono - Check barring properties
oFono - Disable barrings
oFono - Disable incoming barrings
oFono - Disable outgoing barrings
oFono - Disable barrings
oFono - Change password for barrings -n <code> : New PIN, -o <code> : Old PIN
oFono - Call barrings test Tries to set barrings. It would be wise to execute "disable barrings" after this.
oFono - Propose scan
oFono - SMSC number test
oFono - Multiparty call test
oFono - Private call test

Test cases with variables

To run test case with variable data you need to specify where configuration file is located. You can edit the configuration file yourself.

To run "oFono - Call and send DTMF" case you can use:

blts-ofono -l /var/log/tests/oFono%20-%20Call%20and%20send%20DTMF.log -en "oFono - Call and send DTMF" -r 123456 -C /usr/share/blts-ofono-tests/blts-ofono.cnf

Example of DTMF case variation:

##############
# DTMF cases #
##############

[parameter]
   name dtmf_length
   const 1 5
[end_parameter]

[parameter]
   name dtmf_chars
   const "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "*" "#"
[end_parameter]

[parameter]
   name dtmf_negative_chars
   const "A" "B" "C" "D" "E" "F"
[end_parameter]

[parameter]
   name dtmf_tones
   generate dtmf_generator dtmf_chars dtmf_length
[end_parameter]

[test]
   name "oFono - Call and send DTMF"
   params remote_address dtmf_tones
[end_test]

N900 specific

Before executing tests run kill-telepathy and after executing run enable-telepathy and boot device.

Module Design and Architecture

The test module can be compiled to both a self-sufficient command line program and a Min test framework module. Debian packaging is provided.

Architecture diagram

References

oFono.org oFono website]

Change History

Version Date Handled By Status Comments
0.1 22-sep-2010 Iekku Huttunen Draft Page created
Personal tools