Commit Graph

596 Commits

Author SHA1 Message Date
Brian Gix
7f0a643d54 test/mesh: Add support for testing more OOB auth
To pass IOP testing, we need to be able to support Input OOB and Out of
band Public Key exchange,  This patch adds agent methods to support
those capabilities, but are turned off because the test code uses
insecure fixed values instead of randomized values.
2021-05-19 12:54:40 -07:00
Manish Mandlik
9f11632b1f test: Fix AdvMonitor RSSI filter properties
Update the creation of Advertisement Monitor object as per the
decoupled RSSIThresholdsAndTimers strucure.
More info: doc/advertisement-monitor-api.txt

Reviewed-by: apusaka@chromium.org
Reviewed-by: howardchung@chromium.org
Reviewed-by: mcchou@chromium.org
Signed-off-by: Manish Mandlik <mmandlik@google.com>
2021-03-30 12:12:26 -07:00
Inga Stotland
301c717357 test/test-mesh: Generate correct value for Device UUID
This ensures that the value of Device UUID when invoking
Join method is compliant with RFC 4122.
2021-02-16 11:51:01 -08:00
Manish Mandlik
6c3c059c52 test: add test app for Advertisement Monitor API
The python test app to test working of the Advertisement Monitor API.

This app:
- registers itself with bluez by invoking the RegisterMonitor with the
  app root path
- exposes multiple monitor objects with both valid and invalid monitor
  parameters
- implements Activate/Release/DeviceFound/DeviceLost methods on the
  monitor object
2020-12-17 10:22:47 -08:00
Sonny Sasaka
4e54b08c94 test: Add test app for Battery Provider API
The python test app simulates an application registering to BlueZ as a
Battery Provider providing three fake batteries drained periodically.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
2020-11-30 16:19:09 -08:00
Tedd Ho-Jeong An
7fe27bbf7d test: Add SPDX License Identifier
This patch adds SPDX License Identifier and removes the license text.

-------------------------------------
       License            COUNT
-------------------------------------
 LGPL-2.1-or-later    :     35

License: LGPL-2.1-or-later
   test/agent.py
   test/bluezutils.py
   test/dbusdef.py
   test/example-advertisement
   test/example-endpoint
   test/example-gatt-client
   test/example-gatt-server
   test/example-player
   test/exchange-business-cards
   test/ftp-client
   test/get-managed-objects
   test/get-obex-capabilities
   test/list-devices
   test/list-folders
   test/map-client
   test/monitor-bluetooth
   test/opp-client
   test/pbap-client
   test/sap_client.py
   test/simple-endpoint
   test/simple-obex-agent
   test/simple-player
   test/test-adapter
   test/test-device
   test/test-discovery
   test/test-gatt-profile
   test/test-health
   test/test-health-sink
   test/test-hfp
   test/test-manager
   test/test-mesh
   test/test-nap
   test/test-network
   test/test-profile
   test/test-sap-server
2020-09-21 16:20:26 -07:00
Inga Stotland
a359a4c405 test/test-mesh: Add "options" to Send/Publish
This adds a new dictionary paramenter (empty by default) when
invoking Send() or Publish() methods.
2020-08-26 08:46:55 -07:00
Inga Stotland
15101b1678 test/test-mesh: Add options to "Models" property
This adds options dictionary to "Models" property to stay
in sync with mesh-api changes.
2020-07-01 12:06:07 -07:00
Inga Stotland
7bcb1086ab mesh: Add "node is busy" check for Leave() & Attach()
This introduces the following behavior change for those methods
on Network interface that specify node token as an input parameter

Leave() method:
If Leave method is called for a node that is being processed as a result
of a Create, Import, Join or Attach method calls in progress, node removal
is not allowed and org.bluez.mesh.Error.Busy error is returned.

Attach() method:
If Attach method is called for a node that is being processed as a result
of a Create, Import or Join method calls in progress, node attachment
is not allowed and org.bluez.mesh.Error.Busy error is returned.
2020-06-10 10:27:17 -07:00
Alvar Penning
440b07fab1 test/example-advertisement: Fix include_tx_power
Adding the Tx Power Level is no longer done via IncludeTxPower, but via
the tx-power value in the Includes array. The previous code did not
throw an error, but neither led to the insertion of the value. As a
result of this change, include_tx_power now adds the Tx Power Level
again.
2020-05-21 09:21:17 -07:00
Inga Stotland
17dc8d1fd8 test: Fix payload and model opcode packing in test-mesh
Use correct packing of multi-byte values in message payload bytearray.
For example, a 2-byte opcode 0x8204 is packed as 0x82 0x04, i.e. in
natural order.

Add transaction ID parameter to "set" commands of generic On/Off
model. Server will ignore the identical commands with the same
transaction ID, source and destination during a timeout period
of 6 seconds.
2020-05-14 06:51:44 -07:00
Brian Gix
c031b5ed4c test/mesh: Remove Provisioner interface
This change removes the Provisioner Initiator from the python test
script, along with the menu commands for create, scan and add. This
makes it a cleaner Python3 example of a simple On/Off node, and a
fuller featured Provisioner/Config Client still exists in the tools
subdirectory.
2020-04-22 08:12:42 -07:00
Brian Gix
ca2163d370 test/mesh: Fix token format to use all 16 digits 2020-04-21 09:12:39 -07:00
Szymon Janc
427033253d test/example-advertisement: Fix advertising when discoverable
If adapter is discoverable (or LE-only) advertising was failing due
to too big adv data being set. Make sure there is enough space left
for flags if needed.
2020-04-09 11:27:30 -07:00
Inga Stotland
08c9d5aaa9 test/test-mesh: Update to match modified APIs
This handles updated parameter list in UnprovisionedScan(),
AddNode() and ScanResult() D-Bus methods
2020-03-30 15:03:56 -07:00
Inga Stotland
14151f9b52 test/test-mesh: Add support for static OOB in the agent
This allows to display a 16-octet key to be entered on the remote
device during provisioning.
2020-03-12 11:19:14 -07:00
Inga Stotland
9695f369d1 test/test-mesh: Fix output of UpdateModelConfig method
This correctly unpacks configuration dictionary received
in the UpdateModelConfig() method
2020-02-26 11:20:08 -08:00
Inga Stotland
5a75f97958 test/test-mesh: Fix output of MessageReceived method
This fixes formatted output of recieved message parameters.
2020-02-18 09:36:56 -08:00
Michał Lowas-Rzechonek
28dbca0e49 mesh: Inform application about model subscriptions 2019-11-26 10:56:44 -08:00
Michał Lowas-Rzechonek
676c91d055 mesh: Provide destination address in MessageReceived API 2019-11-26 10:56:44 -08:00
Michał Lowas-Rzechonek
a73cdc09c0 mesh: Fix test-join to include mandatory VendorModels property 2019-11-26 10:56:44 -08:00
Luiz Augusto von Dentz
f7ca9fef25 test: Add example-player
This adds an example of registering a player with use of
RegisterApplication.
2019-08-10 09:50:29 +03:00
Luiz Augusto von Dentz
9d54c29375 test: Add example-endpoint
This adds an example of registering an endpoint with use of
RegisterApplication.
2019-08-10 09:50:29 +03:00
Inga Stotland
b1ecae6b01 test/test-mesh: Initialize required properties
This initialized required "Models" and "VendorModels" properties
wheher the actual models exist or not, according to the mesh-api.txt.
In case when an element does not contain either SIG defined models or
vendor defineed models, the corresponding properties should contain
empty arrays.
2019-07-26 09:08:58 -07:00
Brian Gix
14bbd6537f test: This extends the mesh tool to exercise Provisioning methods
Note:  This script is *not* a suitable tool for expanding into
a Mesh Provisioner. It is only intended to demonstrate the arguments
and methods required.
2019-07-14 08:32:18 -07:00
Inga Stotland
9acc66c6f1 test: test-mesh - Correctly stop periodic publication
This changes the order of checks for an updated publication period:
check for zero period first, and if this is the case, stop sending
the periodic model publications.
2019-07-01 09:17:43 -07:00
Brian Gix
895ba2cdf9 mesh: Add "create" command to test app
Like "join" this command generates a UUID and calls CreateNetwork()
and displays the UUID and token.
2019-05-15 09:36:42 -07:00
Inga Stotland
88c8968afe test: Enable test-mesh to send raw vendor commands
This adds a sample vendor model to the first element of the
mesh node. A new menu entry allows to generate and send a raw
vendor command.
2019-04-19 08:33:27 -07:00
Inga Stotland
1cb6b17b70 test: Drive test-mesh with a string-based menu
Switch to  string interactive commands to drive testing
of bluetooth-meshd. Re-work the menu to allow global setting of
destination address and AppKey index for outbound mesh messages.
2019-04-19 08:33:27 -07:00
Inga Stotland
ea61add0af test: Add unified test for mesh node example app
This adds one script, test-mesh, to replace three test-join,
example-onoff-server and example-onoff-client.
This is menu driven test that allows provisioning (join) and/or
connecting existing (attach) nodes.
2019-03-11 14:50:03 -07:00
Hunt, Preston
7199478d80 test/example-advertisement: add shutdown code
The previous sample code did not release all resources when shutting
down. This is fine when it's a standalone program since Python will free
all resources automatically when the process terminates. However, in a
long-running process, this will eventually cause problems.

This changeset shows how to properly release all resources, if an optional
command line "--timeout" argument is used. The default is no timeout to
maintain behavior of the previous implementation (advertisements will run
forever).
2019-02-26 11:05:50 +02:00
Inga Stotland
4ed860a452 mesh: Sample Mesh Joiner (provision acceptor)
This implements a simple test to excercise Join() method
of org.bluez.mesh.Network interface.
2019-01-08 08:26:22 -08:00
Inga Stotland
743dfac7ad mesh: Sample On/Off Client and Server
These tests excercise the following methods:
interface org.bluez.mesh.Network - Attach()
interface org.bluez.mesh.Node - Send(), Publish()
2019-01-08 08:26:22 -08:00
Inga Stotland
5261163f01 mesh: Sample Provisioning Agent
This implements a simple provisioning agent to test
org.bluez.mesh.ProvisionAgent interface.
2019-01-08 08:26:22 -08:00
Krzysztof Kozlowski
aa429879c5 test: Switch to Python3
Python2 will be maintained till end of 2019.  Switch to Python3 by
replacing iteritems() with items() to fix error when runnig test-nap:

	AttributeError: 'dbus.Dictionary' object has no attribute 'iteritems'
2018-05-29 14:06:52 +03:00
Hunt, Preston
4c73cc6509 test/example-advertisement: add python3 support
This adds support for python3 to the existing script. The script will
now work with either python2 or python3.
2018-05-07 11:26:33 +03:00
Luiz Augusto von Dentz
4e926f8e3e test/example-advertisement: Add Data property
This adds Data property using TDS AD type:

@ MGMT Command: Add Advertising (0x003e) plen 59
        Instance: 1
        Flags: 0x00000001
          Switch into Connectable mode
        Duration: 0
        Timeout: 0
        Advertising data length: 29
        16-bit Service UUIDs (complete): 2 entries
          Heart Rate (0x180d)
          Battery Service (0x180f)
        Company: internal use (65535)
          Data: 0001020304
        Service Data (UUID 0x9999): 0001020304
        Transport Discovery Data
          Organization: Bluetooth SIG (0x01)
          Flags: 0x01
            Role: 0x01
              Seeker Only
            Transport Data Incomplete: False (0x00)
            Transport State: 0x00
              Off
          Length: 0
          Data:
        Scan response length: 19
        Name (complete): TestAdvertisement
2018-05-02 12:22:46 +03:00
Luiz Augusto von Dentz
4ad73272ce tests: Remove test-thermometer
Thermomether interfaces no longer exists.
2017-11-02 16:42:20 +02:00
Luiz Augusto von Dentz
9e7c2416f4 test/example-gatt-server: Don't change measuments if not notifying
This makes it clearer when notifications are actually in effect.
2017-10-23 14:17:07 +03:00
Tomasz Duszynski
b7742ccc1f test/example-advertisement: add LocalName to properties
Since local name in advertisement is useful for telling the difference
between devices expose LocalName via properties.
2017-09-14 11:22:27 +03:00
Luiz Augusto von Dentz
161691ae36 build: Cleanup GATT profiles
Alert, cyclingspeed, heartrate and proximity can all be implemented
using the GATT D-Bus API so they no longer need dedicated APIs.
2017-09-06 17:22:08 +03:00
Szymon Janc
3d117bc965 test/example-gatt-server: Make test service primary
This allows to test from Android until included services support is
added.
2016-09-22 10:52:34 +03:00
Szymon Janc
ba38b538a8 test/example-gatt-server: Fix few copy-paste errors 2016-09-22 10:52:08 +03:00
Alexander Aring
cf944b2cdd tests/example-gatt-server: Fix using GATT_CHRC_IFACE in Descriptor
This patch changes GATT_CHRC_IFACE to GATT_DESC_IFACE when querying
properties for Descriptor class.
2016-09-22 10:45:50 +03:00
Luiz Augusto von Dentz
2abf31b9f0 test/example-advertisement: Fix data format of properties
D-Bus dictionaries always except the values to be of variant type.
2016-08-16 11:16:03 +03:00
Luiz Augusto von Dentz
80326b5f22 test/example-gatt-server: Add more comments
This adds more comments what the example is doing.
2016-08-02 14:30:34 +03:00
Luiz Augusto von Dentz
24739efd35 test/example-gatt-client: Add more comments
This adds more comments what the example is doing.
2016-08-02 14:05:15 +03:00
Luiz Augusto von Dentz
e3199baab8 test/example-gatt-server: Fix error on Property.GetAll
get_properties is a method not a dictionary which cause the following
error:
  TypeError: 'method' object is not subscriptable
2016-07-14 15:42:37 +03:00
Luiz Augusto von Dentz
55192ae2c4 test/simple-endpoint: Fix ClearConfiguration signature 2016-05-30 12:57:11 +03:00
Luiz Augusto von Dentz
206c0c88ed test: Update GATT examples with the new API 2016-05-18 14:16:28 +03:00