* [PATCH 2/2] android/tester: Update expected adapter properties
From: Lukasz Rymanowski @ 2013-12-13 8:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Lukasz Rymanowski
In-Reply-To: <1386921905-28047-1-git-send-email-lukasz.rymanowski@tieto.com>
Bluetooth daemon supports now BT_PROPERTY_ADAPTER_BONDED_DEVICES and
BT_PROPERTY_TYPE_OF_DEVICE. Android tester needs to be updated with this
expected properties. Test result with this patch:
Test Summary
------------
Test Init Passed 0.026 seconds
Test Enable - Success Passed 0.027 seconds
Test Enable - Done Passed 0.030 seconds
Test Disable - Success Passed 0.036 seconds
Test Socket Init Passed 0.020 seconds
Test Socket Listen - Invalid sock type Passed 0.088 seconds
Test Socket Listen - Invalid: L2CAP Passed 0.025 seconds
Total: 7, Passed: 7 (100.0%), Failed: 0, Not Run: 0
---
android/android-tester.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/android/android-tester.c b/android/android-tester.c
index 16ddcc4..fbcbb27 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -38,7 +38,8 @@
#define adapter_props adapter_prop_bdaddr, adapter_prop_bdname, \
adapter_prop_uuids, adapter_prop_cod, \
- adapter_prop_scan_mode, adapter_prop_disc_timeout
+ adapter_prop_tod, adapter_prop_scan_mode, \
+ adapter_prop_bonded_devices, adapter_prop_disc_timeout
/*
* those are assigned to HAL methods and callbacks, we use ID later
--
1.8.4
^ permalink raw reply related
* [PATCH 1/2] android/tester: Add new id to hal_bluetooth_callbacks_id
From: Lukasz Rymanowski @ 2013-12-13 8:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Lukasz Rymanowski
Added adapter_prop_tod id to represents BT_PROPERTY_TYPE_OF_DEVICE
property changed.
---
android/android-tester.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/android/android-tester.c b/android/android-tester.c
index a50ed7b..16ddcc4 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -55,6 +55,7 @@ enum hal_bluetooth_callbacks_id {
adapter_prop_uuids,
adapter_prop_cod,
adapter_prop_scan_mode,
+ adapter_prop_tod,
adapter_prop_disc_timeout,
adapter_prop_service_record,
adapter_prop_bonded_devices
@@ -484,7 +485,7 @@ static void adapter_properties_cb(bt_status_t status, int num_properties,
remove_expected_hal_cb();
break;
case BT_PROPERTY_TYPE_OF_DEVICE:
- if (hal_cb != adapter_prop_bdaddr) {
+ if (hal_cb != adapter_prop_tod) {
tester_test_failed();
return;
}
--
1.8.4
^ permalink raw reply related
* Re: [REGRESSION] rfcomm (userland) broken by commit 29cd718b
From: Alexander Holler @ 2013-12-12 23:35 UTC (permalink / raw)
To: Peter Hurley
Cc: Gustavo Padovan, Gianluca Anzolin, marcel, linux-bluetooth,
gregkh, jslaby, linux-kernel
In-Reply-To: <52AA1E62.1030109@hurleysoftware.com>
Am 12.12.2013 21:36, schrieb Peter Hurley:
>> What currently happens is that when one kills rfcomm (and any other
>> terminal which might use that tty), the entry in /dev doesn't
>> disappear. That means the same call to refcomm with the same device
>> (e.g. [/dev/]rfcomm1 doesn't work.
>
> Thanks for the report, Alexander.
>
> Point 4 above details a different situation; something else is
> happening.
>
> Would you please detail the necessary steps to reproduce this regression?
> (How do you 'kill' rfcomm? etc. Shell command lines would be best.)
Just call
rfcomm connect rfcomm9 01:23:45:67:89:ab
wait until the connection happened (a message will appear) and then
press ctrl-c. This still terminates the bluetooth connection, but the
device in /dev is now left.
Regards,
Alexander Holler
^ permalink raw reply
* Re: [REGRESSION] rfcomm (userland) broken by commit 29cd718b
From: Peter Hurley @ 2013-12-12 20:36 UTC (permalink / raw)
To: Alexander Holler, Gustavo Padovan, Gianluca Anzolin, marcel,
linux-bluetooth, gregkh, jslaby, linux-kernel
In-Reply-To: <52AA1854.500@ahsoftware.de>
On 12/12/2013 03:11 PM, Alexander Holler wrote:
> Hello,
>
> since commit 29cd718beba999bda4bdbbf59b5a4d25c07e1547 "rfcomm: don't release the port in rfcomm_dev_state_change()" the userland utility rfcomm (both from bluez 4.101 and 5.12) is broken.
>
> In detail the following note in the patch
>
> Am 19.09.2013 18:24, schrieb Gustavo Padovan:
>> Hi Gianluca,
>>
>> 2013-08-27 Gianluca Anzolin <gianluca@sottospazio.it>:
>>
>>> When the dlc is closed, rfcomm_dev_state_change() tries to release the
>>> port in the case it cannot get a reference to the tty. However this is
>>> racy and not even needed.
>>>
>>> Infact as Peter Hurley points out:
>
> (...)
>
>>> 4. After releasing the dlc lock in rfcomm_dev_add(),
>>> rfcomm_dev_state_change() will 'see' an incomplete rfcomm_dev if a
>>> tty reference could not be obtained. Again, the best thing to do here
>>> is nothing. Any future attempted open() will block on
>>> rfcomm_dev_carrier_raised(). The unconnected device will exist until
>>> released by ioctl(RFCOMMRELEASEDEV).
>>>
>>> The patch removes the aforementioned code and uses the
>>> tty_port_tty_hangup() helper to hangup the tty.
>
> reads like the usage of that ioctl now necessary.
>
> What currently happens is that when one kills rfcomm (and any other terminal which might use that tty), the entry in /dev doesn't disappear. That means the same call to refcomm with the same device (e.g. [/dev/]rfcomm1 doesn't work.
Thanks for the report, Alexander.
Point 4 above details a different situation; something else is
happening.
Would you please detail the necessary steps to reproduce this regression?
(How do you 'kill' rfcomm? etc. Shell command lines would be best.)
> My current solution is to just revert that commit.
> I haven't tested if modifying (the userland utility) rfcomm (adding that ioctl) will help, but that looks only like a longterm solution.
Changes to userspace should not be required; rfcomm should be
handling teardown without help.
Regards,
Peter Hurley
^ permalink raw reply
* [PATCH] Adding missing test scripts to Makefile.tools
From: Sebastian @ 2013-12-12 20:33 UTC (permalink / raw)
To: johan.hedberg; +Cc: linux-bluetooth, Sebastian
In-Reply-To: <1386880421-19461-1-git-send-email-sebastianx.chlad@intel.com>
---
Makefile.tools | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile.tools b/Makefile.tools
index 78034f5..b306c34 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -289,6 +289,7 @@ test_scripts += test/sap_client.py test/bluezutils.py \
test/test-thermometer test/test-profile test/test-health \
test/test-health-sink test/service-record.dtd \
test/service-did.xml test/service-spp.xml test/service-opp.xml \
- test/service-ftp.xml test/simple-player test/test-nap \
+ test/opp-client test/service-ftp.xml test/ftp-client \
+ test/simple-player test/test-nap \
test/test-heartrate test/test-alert test/test-hfp \
- test/test-cyclingspeed
+ test/test-cyclingspeed test/pbap-client test/map-client
--
1.8.1.2
^ permalink raw reply related
* [PATCH] Adding missing test scripts to Makefile.tools
From: Sebastian @ 2013-12-12 20:33 UTC (permalink / raw)
To: johan.hedberg; +Cc: linux-bluetooth
It seems some obex test scripts are missing from the Makefile.
^ permalink raw reply
* Re: [PATCH bluetooth-next] 6lowpan: fix/move/cleanup debug functions
From: Marcel Holtmann @ 2013-12-12 20:16 UTC (permalink / raw)
To: Alexander Aring
Cc: linux-zigbee-devel, werner,
linux-bluetooth@vger.kernel.org development
In-Reply-To: <1386875725-4436-1-git-send-email-alex.aring@gmail.com>
Hi Alex,
> There are several issues on current debug behaviour.
> This patch fix the following issues:
>
> - Fix debug printout only if DEBUG is defined.
> - Move debug functions of 6LoWPAN code into 6lowpan header.
> - Cleanup codestyle of debug functions.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> net/bluetooth/6lowpan.c | 27 ---------------------------
> net/ieee802154/6lowpan.c | 43 +++++--------------------------------------
> net/ieee802154/6lowpan.h | 32 ++++++++++++++++++++++++++++++++
> net/ieee802154/6lowpan_iphc.c | 26 --------------------------
> 4 files changed, 37 insertions(+), 91 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply
* [REGRESSION] rfcomm (userland) broken by commit 29cd718b
From: Alexander Holler @ 2013-12-12 20:11 UTC (permalink / raw)
To: Gustavo Padovan, Gianluca Anzolin, peter, marcel, linux-bluetooth,
gregkh, jslaby, linux-kernel
In-Reply-To: <20130919162413.GG4006@joana>
Hello,
since commit 29cd718beba999bda4bdbbf59b5a4d25c07e1547 "rfcomm: don't
release the port in rfcomm_dev_state_change()" the userland utility
rfcomm (both from bluez 4.101 and 5.12) is broken.
In detail the following note in the patch
Am 19.09.2013 18:24, schrieb Gustavo Padovan:
> Hi Gianluca,
>
> 2013-08-27 Gianluca Anzolin <gianluca@sottospazio.it>:
>
>> When the dlc is closed, rfcomm_dev_state_change() tries to release the
>> port in the case it cannot get a reference to the tty. However this is
>> racy and not even needed.
>>
>> Infact as Peter Hurley points out:
(...)
>> 4. After releasing the dlc lock in rfcomm_dev_add(),
>> rfcomm_dev_state_change() will 'see' an incomplete rfcomm_dev if a
>> tty reference could not be obtained. Again, the best thing to do here
>> is nothing. Any future attempted open() will block on
>> rfcomm_dev_carrier_raised(). The unconnected device will exist until
>> released by ioctl(RFCOMMRELEASEDEV).
>>
>> The patch removes the aforementioned code and uses the
>> tty_port_tty_hangup() helper to hangup the tty.
reads like the usage of that ioctl now necessary.
What currently happens is that when one kills rfcomm (and any other
terminal which might use that tty), the entry in /dev doesn't disappear.
That means the same call to refcomm with the same device (e.g.
[/dev/]rfcomm1 doesn't work.
My current solution is to just revert that commit.
I haven't tested if modifying (the userland utility) rfcomm (adding that
ioctl) will help, but that looks only like a longterm solution.
Regards,
Alexander Holler
^ permalink raw reply
* [PATCH bluetooth-next] 6lowpan: fix/move/cleanup debug functions
From: Alexander Aring @ 2013-12-12 19:15 UTC (permalink / raw)
To: linux-zigbee-devel; +Cc: werner, linux-bluetooth, Alexander Aring
There are several issues on current debug behaviour.
This patch fix the following issues:
- Fix debug printout only if DEBUG is defined.
- Move debug functions of 6LoWPAN code into 6lowpan header.
- Cleanup codestyle of debug functions.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
net/bluetooth/6lowpan.c | 27 ---------------------------
net/ieee802154/6lowpan.c | 43 +++++--------------------------------------
net/ieee802154/6lowpan.h | 32 ++++++++++++++++++++++++++++++++
net/ieee802154/6lowpan_iphc.c | 26 --------------------------
4 files changed, 37 insertions(+), 91 deletions(-)
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 5ad8b48..37239db 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -167,33 +167,6 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
return dev;
}
-/* print data in line */
-static inline void raw_dump_inline(const char *caller, char *msg,
- unsigned char *buf, int len)
-{
- if (msg)
- pr_debug("%s():%s: ", caller, msg);
-
- print_hex_dump_debug("", DUMP_PREFIX_NONE,
- 16, 1, buf, len, false);
-}
-
-/* print data in a table format:
- *
- * addr: xx xx xx xx xx xx
- * addr: xx xx xx xx xx xx
- * ...
- */
-static inline void raw_dump_table(const char *caller, char *msg,
- unsigned char *buf, int len)
-{
- if (msg)
- pr_debug("%s():%s:\n", caller, msg);
-
- print_hex_dump_debug("\t", DUMP_PREFIX_OFFSET,
- 16, 1, buf, len, false);
-}
-
static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
{
struct sk_buff *skb_cp;
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 53d0bd5..48b25c0 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -101,37 +101,6 @@ static inline void lowpan_address_flip(u8 *src, u8 *dest)
(dest)[IEEE802154_ADDR_LEN - i - 1] = (src)[i];
}
-/* list of all 6lowpan devices, uses for package delivering */
-/* print data in line */
-static inline void lowpan_raw_dump_inline(const char *caller, char *msg,
- unsigned char *buf, int len)
-{
-#ifdef DEBUG
- if (msg)
- pr_debug("(%s) %s: ", caller, msg);
- print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE,
- 16, 1, buf, len, false);
-#endif /* DEBUG */
-}
-
-/*
- * print data in a table format:
- *
- * addr: xx xx xx xx xx xx
- * addr: xx xx xx xx xx xx
- * ...
- */
-static inline void lowpan_raw_dump_table(const char *caller, char *msg,
- unsigned char *buf, int len)
-{
-#ifdef DEBUG
- if (msg)
- pr_debug("(%s) %s:\n", caller, msg);
- print_hex_dump(KERN_DEBUG, "\t", DUMP_PREFIX_OFFSET,
- 16, 1, buf, len, false);
-#endif /* DEBUG */
-}
-
static int lowpan_header_create(struct sk_buff *skb,
struct net_device *dev,
unsigned short type, const void *_daddr,
@@ -153,8 +122,8 @@ static int lowpan_header_create(struct sk_buff *skb,
if (!saddr)
saddr = dev->dev_addr;
- lowpan_raw_dump_inline(__func__, "saddr", (unsigned char *)saddr, 8);
- lowpan_raw_dump_inline(__func__, "daddr", (unsigned char *)daddr, 8);
+ raw_dump_inline(__func__, "saddr", (unsigned char *)saddr, 8);
+ raw_dump_inline(__func__, "daddr", (unsigned char *)daddr, 8);
lowpan_header_compress(skb, dev, type, daddr, saddr, len);
@@ -290,8 +259,7 @@ static int process_data(struct sk_buff *skb)
u8 iphc0, iphc1;
const struct ieee802154_addr *_saddr, *_daddr;
- lowpan_raw_dump_table(__func__, "raw skb data dump", skb->data,
- skb->len);
+ raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len);
/* at least two bytes will be used for the encoding */
if (skb->len < 2)
goto drop;
@@ -429,7 +397,7 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
hlen = (type == LOWPAN_DISPATCH_FRAG1) ?
LOWPAN_FRAG1_HEAD_SIZE : LOWPAN_FRAGN_HEAD_SIZE;
- lowpan_raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
+ raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
frag = netdev_alloc_skb(skb->dev,
hlen + mlen + plen + IEEE802154_MFR_SIZE);
@@ -449,8 +417,7 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
skb_copy_to_linear_data_offset(frag, mlen + hlen,
skb_network_header(skb) + offset, plen);
- lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data,
- frag->len);
+ raw_dump_table(__func__, " raw fragment dump", frag->data, frag->len);
return dev_queue_xmit(frag);
}
diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index 535606d..10909e5 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -232,6 +232,38 @@
dest = 16 bit inline */
#define LOWPAN_NHC_UDP_CS_P_11 0xF3 /* source & dest = 0xF0B + 4bit inline */
+#ifdef DEBUG
+/* print data in line */
+static inline void raw_dump_inline(const char *caller, char *msg,
+ unsigned char *buf, int len)
+{
+ if (msg)
+ pr_debug("%s():%s: ", caller, msg);
+
+ print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, buf, len, false);
+}
+
+/* print data in a table format:
+ *
+ * addr: xx xx xx xx xx xx
+ * addr: xx xx xx xx xx xx
+ * ...
+ */
+static inline void raw_dump_table(const char *caller, char *msg,
+ unsigned char *buf, int len)
+{
+ if (msg)
+ pr_debug("%s():%s:\n", caller, msg);
+
+ print_hex_dump_debug("\t", DUMP_PREFIX_OFFSET, 16, 1, buf, len, false);
+}
+#else
+static inline void raw_dump_table(const char *caller, char *msg,
+ unsigned char *buf, int len) { }
+static inline void raw_dump_inline(const char *caller, char *msg,
+ unsigned char *buf, int len) { }
+#endif
+
static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val)
{
if (unlikely(!pskb_may_pull(skb, 1)))
diff --git a/net/ieee802154/6lowpan_iphc.c b/net/ieee802154/6lowpan_iphc.c
index 57c0b7a..88e7da5 100644
--- a/net/ieee802154/6lowpan_iphc.c
+++ b/net/ieee802154/6lowpan_iphc.c
@@ -58,32 +58,6 @@
#include "6lowpan.h"
-/* print data in line */
-static inline void raw_dump_inline(const char *caller, char *msg,
- unsigned char *buf, int len)
-{
- if (msg)
- pr_debug("%s():%s: ", caller, msg);
- print_hex_dump_debug("", DUMP_PREFIX_NONE,
- 16, 1, buf, len, false);
-}
-
-/*
- * print data in a table format:
- *
- * addr: xx xx xx xx xx xx
- * addr: xx xx xx xx xx xx
- * ...
- */
-static inline void raw_dump_table(const char *caller, char *msg,
- unsigned char *buf, int len)
-{
- if (msg)
- pr_debug("%s():%s:\n", caller, msg);
- print_hex_dump_debug("\t", DUMP_PREFIX_OFFSET,
- 16, 1, buf, len, false);
-}
-
/*
* Uncompress address function for source and
* destination address(non-multicast).
--
1.8.5.1
^ permalink raw reply related
* [RFC v2 BlueZ] build: Add coverage support
From: Luiz Augusto von Dentz @ 2013-12-12 18:57 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Coverage is disabled by default but it is automatically enabled by
bootstrap-configure using --enable-coverage, it creates a new make target
'coverage' that can be run after make check or any tester that produces
.gdca files.
The build time using --enable-coverage is considerable bigger so if
that is a problem just disable it, also this is the reason why it is not
added directly under --enable-maintainer-mode so it is possible to
turn off coverage without having to turn off maintainer mode.
Since lcov apparently cannot detect changes to .gcda there is another
make target 'clean-coverage' so after that make coverage can be
run again.
---
Makefile.am | 17 +++++++++++++++++
acinclude.m4 | 8 ++++++++
bootstrap-configure | 1 +
configure.ac | 5 +++++
4 files changed, 31 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 15cc149..4b3351a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -331,5 +331,22 @@ lib/bluetooth/%.h: lib/%.h
$(AM_V_at)$(MKDIR_P) lib/bluetooth
$(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@
+if COVERAGE
+clean-coverage:
+ $(RM) -r coverage
+
+coverage:
+ $(AM_V_at)$(MKDIR_P) -p coverage
+ @lcov --compat-libtool --directory $(top_builddir) --capture \
+ --output-file coverage/check.info
+ @genhtml -o coverage/ coverage/check.info
+
+clean-local: clean-coverage
+ @find $(top_builddir) -name "*.gcda" -exec $(RM) {} \;
+ @find $(top_builddir) -name "*.gcno" -exec $(RM) {} \;
+ @lcov --directory . --zerocounters
+ $(RM) -r lib/bluetooth
+else
clean-local:
$(RM) -r lib/bluetooth
+endif
diff --git a/acinclude.m4 b/acinclude.m4
index 2065852..4bb8bde 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -51,6 +51,14 @@ AC_DEFUN([MISC_FLAGS], [
misc_ldflags="$misc_ldflags -pie"
fi
])
+ AC_ARG_ENABLE(coverage, AC_HELP_STRING([--enable-coverage],
+ [enable coverage flags]), [
+ enable_coverage=${enableval}
+ if (test "${enable_coverage}" = "yes"); then
+ misc_cflags="$misc_cflags --coverage"
+ misc_ldflags="$misc_ldflags --coverage"
+ fi
+ ])
AC_SUBST([MISC_CFLAGS], $misc_cflags)
AC_SUBST([MISC_LDFLAGS], $misc_ldflags)
])
diff --git a/bootstrap-configure b/bootstrap-configure
index c7f08ed..35aa98b 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -14,4 +14,5 @@ fi
--enable-experimental \
--enable-android \
--enable-sixaxis \
+ --enable-coverage \
--disable-datafiles $*
diff --git a/configure.ac b/configure.ac
index 18d0b55..5e684a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,4 +252,9 @@ AC_ARG_ENABLE(android, AC_HELP_STRING([--enable-android],
[enable_android=${enableval}])
AM_CONDITIONAL(ANDROID, test "${enable_android}" = "yes")
+if (test "${enable_coverage}" = "yes"); then
+ AC_CHECK_PROG([LCOV], [lcov], [yes], AC_MSG_ERROR(lcov is required))
+fi
+AM_CONDITIONAL([COVERAGE], [test "${enable_coverage}" = "yes"])
+
AC_OUTPUT(Makefile src/bluetoothd.8 lib/bluez.pc)
--
1.8.3.1
^ permalink raw reply related
* [PATCH 5/5] android/tester: Add bdname get prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-12 17:14 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386868475-9610-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>
This adds bdname set property success test case. First bdname is set and
then is read.
---
android/android-tester.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 407bfbe..280870a 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -623,6 +623,15 @@ static const struct generic_data bluetooth_getprop_bdaddr_success_test = {
.expected_property.len = sizeof(bt_bdaddr_t)
};
+static const struct generic_data bluetooth_getprop_bdname_success_test = {
+ .expected_hal_callbacks = {adapter_prop_bdname, adapter_prop_bdname,
+ adapter_test_end},
+ .expected_adapter_status = BT_STATUS_SUCCESS,
+ .expected_property.type = BT_PROPERTY_BDNAME,
+ .expected_property.val = "test_bdname_setget",
+ .expected_property.len = 17
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -892,6 +901,22 @@ static void test_getprop_bdaddr_success(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_getprop_bdname_success(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+
+ adapter_status = data->if_bluetooth->get_adapter_property((*prop).type);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -942,6 +967,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_getprop_bdaddr_success, teardown);
+ test_bredrle("Test Get BDNAME - Success",
+ &bluetooth_getprop_bdname_success_test,
+ setup_enabled_adapter,
+ test_getprop_bdname_success, teardown);
+
test_bredrle("Test Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
^ permalink raw reply related
* [PATCH 4/5] android/tester: Add bdaddr get prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-12 17:14 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386868475-9610-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>
This adds bdaddr set property success test case.
---
android/android-tester.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 5b7082a..407bfbe 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -615,6 +615,14 @@ static const struct generic_data bluetooth_setprop_disctimeout_success_test = {
.expected_property.len = sizeof(test_setprop_disctimeout_val)
};
+static const struct generic_data bluetooth_getprop_bdaddr_success_test = {
+ .expected_hal_callbacks = {adapter_prop_bdaddr, adapter_test_end},
+ .expected_adapter_status = BT_STATUS_SUCCESS,
+ .expected_property.type = BT_PROPERTY_BDADDR,
+ .expected_property.val = NULL,
+ .expected_property.len = sizeof(bt_bdaddr_t)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -871,6 +879,19 @@ static void test_setprop_disctimeout_succes(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_getprop_bdaddr_success(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t prop = test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->get_adapter_property(prop.type);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -916,6 +937,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_disctimeout_succes, teardown);
+ test_bredrle("Test Get BDADDR - Success",
+ &bluetooth_getprop_bdaddr_success_test,
+ setup_enabled_adapter,
+ test_getprop_bdaddr_success, teardown);
+
test_bredrle("Test Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
^ permalink raw reply related
* [PATCH 3/5] android/tester: Add discovery timeout set prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-12 17:14 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386868475-9610-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>
This adds discovery timeout set property success test case.
---
android/android-tester.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index d2c0e2f..5b7082a 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -42,6 +42,7 @@
static bt_scan_mode_t test_setprop_scanmode_val =
BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
+static uint32_t test_setprop_disctimeout_val = 120;
/*
* those are assigned to HAL methods and callbacks, we use ID later
@@ -606,6 +607,14 @@ static const struct generic_data bluetooth_setprop_scanmode_success_test = {
.expected_property.len = sizeof(bt_scan_mode_t)
};
+static const struct generic_data bluetooth_setprop_disctimeout_success_test = {
+ .expected_hal_callbacks = {adapter_prop_disc_timeout, adapter_test_end},
+ .expected_adapter_status = BT_STATUS_SUCCESS,
+ .expected_property.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
+ .expected_property.val = &test_setprop_disctimeout_val,
+ .expected_property.len = sizeof(test_setprop_disctimeout_val)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -849,6 +858,19 @@ static void test_setprop_scanmode_succes(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_disctimeout_succes(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -889,6 +911,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_scanmode_succes, teardown);
+ test_bredrle("Test Set DISCOVERY_TIMEOUT - Success",
+ &bluetooth_setprop_disctimeout_success_test,
+ setup_enabled_adapter,
+ test_setprop_disctimeout_succes, teardown);
+
test_bredrle("Test Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
^ permalink raw reply related
* [PATCH 2/5] android/tester: Add scan mode set prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-12 17:14 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386868475-9610-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>
This adds scan mode set property success test case.
---
android/android-tester.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index dcc0e33..d2c0e2f 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -40,6 +40,9 @@
adapter_prop_uuids, adapter_prop_cod, \
adapter_prop_scan_mode, adapter_prop_disc_timeout
+static bt_scan_mode_t test_setprop_scanmode_val =
+ BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
+
/*
* those are assigned to HAL methods and callbacks, we use ID later
* on mapped in switch-case due to different functions prototypes.
@@ -594,6 +597,15 @@ static const struct generic_data bluetooth_setprop_bdname_success_test = {
.expected_property.len = 11
};
+static const struct generic_data bluetooth_setprop_scanmode_success_test = {
+ .expected_hal_callbacks = {adapter_prop_scan_mode,
+ adapter_prop_scan_mode, adapter_test_end},
+ .expected_adapter_status = BT_STATUS_SUCCESS,
+ .expected_property.type = BT_PROPERTY_ADAPTER_SCAN_MODE,
+ .expected_property.val = &test_setprop_scanmode_val,
+ .expected_property.len = sizeof(bt_scan_mode_t)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -824,6 +836,19 @@ static void test_setprop_bdname_success(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_scanmode_succes(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -859,6 +884,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_bdname_success, teardown);
+ test_bredrle("Test Set SCAN_MODE - Success",
+ &bluetooth_setprop_scanmode_success_test,
+ setup_enabled_adapter,
+ test_setprop_scanmode_succes, teardown);
+
test_bredrle("Test Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
^ permalink raw reply related
* [PATCH 1/5] android/tester: Add property check and bdname set success test case
From: Grzegorz Kolodziejczyk @ 2013-12-12 17:14 UTC (permalink / raw)
To: linux-bluetooth
This adds handling of property check, bdname set property success.
---
android/android-tester.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index a50ed7b..dcc0e33 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -63,6 +63,7 @@ enum hal_bluetooth_callbacks_id {
struct generic_data {
uint8_t expected_adapter_status;
uint32_t expect_settings_set;
+ bt_property_t expected_property;
uint8_t expected_hal_callbacks[];
};
@@ -93,7 +94,9 @@ struct test_data {
bool mgmt_settings_set;
bool hal_cb_called;
bool status_checked;
+ bool property_checked;
+ bt_property_t test_property;
GSList *expected_callbacks;
};
@@ -109,6 +112,8 @@ static void test_update_state(void)
return;
if (!(data->status_checked))
return;
+ if (!(data->property_checked))
+ return;
tester_test_passed();
}
@@ -175,11 +180,20 @@ static void expected_status_init(struct test_data *data)
data->status_checked = true;
}
+static void test_property_init(struct test_data *data)
+{
+ const struct generic_data *test_data = data->test_data;
+
+ if (!(test_data->expected_property.type))
+ data->property_checked = true;
+}
+
static void init_test_conditions(struct test_data *data)
{
hal_cb_init(data);
mgmt_cb_init(data);
expected_status_init(data);
+ test_property_init(data);
}
static void check_expected_status(uint8_t status)
@@ -195,6 +209,33 @@ static void check_expected_status(uint8_t status)
test_update_state();
}
+static void check_test_property(void)
+{
+ struct test_data *data = tester_get_data();
+ bt_property_t expected_prop = data->test_property;
+ const struct generic_data *test_data = data->test_data;
+ bt_property_t test_prop = test_data->expected_property;
+
+ if (test_prop.type && (expected_prop.type != test_prop.type)) {
+ tester_test_failed();
+ return;
+ }
+
+ if (test_prop.len && (expected_prop.len != test_prop.len)) {
+ tester_test_failed();
+ return;
+ }
+
+ if (test_prop.val && memcmp(expected_prop.val, test_prop.val,
+ expected_prop.len)) {
+ tester_test_failed();
+ return;
+ }
+
+ data->property_checked = true;
+ test_update_state();
+}
+
static int get_expected_hal_cb(void)
{
struct test_data *data = tester_get_data();
@@ -446,6 +487,7 @@ static void adapter_properties_cb(bt_status_t status, int num_properties,
bt_property_t *properties)
{
enum hal_bluetooth_callbacks_id hal_cb;
+ struct test_data *data = tester_get_data();
int i;
for (i = 0; i < num_properties; i++) {
@@ -454,6 +496,12 @@ static void adapter_properties_cb(bt_status_t status, int num_properties,
if (hal_cb == adapter_test_setup_mode)
break;
+ data->test_property = *properties;
+
+ if (g_slist_next(data->expected_callbacks) ==
+ adapter_test_end)
+ check_test_property();
+
switch (properties[i].type) {
case BT_PROPERTY_BDADDR:
if (hal_cb != adapter_prop_bdaddr) {
@@ -538,6 +586,14 @@ static const struct generic_data bluetooth_disable_success_test = {
.expected_hal_callbacks = {adapter_state_changed_off, adapter_test_end}
};
+static const struct generic_data bluetooth_setprop_bdname_success_test = {
+ .expected_hal_callbacks = {adapter_prop_bdname, adapter_test_end},
+ .expected_adapter_status = BT_STATUS_SUCCESS,
+ .expected_property.type = BT_PROPERTY_BDNAME,
+ .expected_property.val = "test_bdname",
+ .expected_property.len = 11
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -754,6 +810,20 @@ clean:
close(sock_fd);
}
+static void test_setprop_bdname_success(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -784,6 +854,11 @@ int main(int argc, char *argv[])
test_bredrle("Test Disable - Success", &bluetooth_disable_success_test,
setup_enabled_adapter, test_disable, teardown);
+ test_bredrle("Test Set BDNAME - Success",
+ &bluetooth_setprop_bdname_success_test,
+ setup_enabled_adapter,
+ test_setprop_bdname_success, teardown);
+
test_bredrle("Test Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
^ permalink raw reply related
* [PATCH] sixaxis: Fix device detection
From: Bastien Nocera @ 2013-12-12 16:16 UTC (permalink / raw)
To: linux-bluetooth
After searching past the end of the structure, the loop sometimes
found matches in the daemon's address space...
This fixes the loop to end after the elements have been exhausted.
---
plugins/sixaxis.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 45fa170..1154c15 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -301,7 +301,7 @@ static int get_supported_device(struct udev_device *udevice, uint16_t *bus)
struct udev_device *hid_parent;
uint16_t vid, pid;
const char *hid_id;
- int i;
+ guint i;
hid_parent = udev_device_get_parent_with_subsystem_devtype(udevice,
"hid", NULL);
@@ -313,7 +313,7 @@ static int get_supported_device(struct udev_device *udevice, uint16_t *bus)
if (sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3)
return -1;
- for (i = 0; G_N_ELEMENTS(devices); i++) {
+ for (i = 0; i < G_N_ELEMENTS(devices); i++) {
if (devices[i].vid == vid && devices[i].pid == pid)
return i;
}
--
1.8.4.2
^ permalink raw reply related
* [PATCH 2/2] android/pts: Add PTS test results for PBAP
From: Szymon Janc @ 2013-12-12 15:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1386862737-30606-1-git-send-email-szymon.janc@tieto.com>
This will allow for better tracking of current state of implementation.
---
android/Makefile.am | 2 +-
android/pts-pbap.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 android/pts-pbap.txt
diff --git a/android/Makefile.am b/android/Makefile.am
index bcd9f2b..79f30d7 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -111,4 +111,4 @@ EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
android/pixit-gap.txt android/pixit-hid.txt \
android/pixit-opp.txt android/pixit-pan.txt \
android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt \
- android/pts-opp.txt
+ android/pts-opp.txt android/pts-pbap.txt
diff --git a/android/pts-pbap.txt b/android/pts-pbap.txt
new file mode 100644
index 0000000..3bf682f
--- /dev/null
+++ b/android/pts-pbap.txt
@@ -0,0 +1,59 @@
+PTS test results for PBAP
+
+PTS version: 4.9
+Tested: 14.11.2013
+
+Results:
+PASS test passed
+FAIL test failed
+INC test is inconclusive
+N/A test is disabled due to PICS setup
+
+-------------------------------------------------------------------------------
+Test Name Result Notes
+-------------------------------------------------------------------------------
+TC_PCE_SSM_BV_01_C N/A
+TC_PCE_SSM_BV_02_C N/A
+TC_PCE_SSM_BV_06_C N/A
+TC_PCE_SSM_BV_08_C N/A
+TC_PCE_SSM_BI_01_C N/A
+TC_PCE_PBD_BV_01_C N/A
+TC_PCE_PBD_BV_04_C N/A
+TC_PCE_PBB_BV_01_C N/A
+TC_PCE_PBB_BV_02_C N/A
+TC_PCE_PBB_BV_03_C N/A
+TC_PCE_PBB_BV_05_C N/A
+TC_PCE_PBF_BV_01_I N/A
+TC_PCE_PBF_BV_02_I N/A
+TC_PCE_PDF_BV_01_I N/A
+TC_PCE_PDF_BV_04_I N/A
+TC_PSE_SSM_BV_03_C PASS
+TC_PSE_SSM_BV_05_C PASS
+TC_PSE_SSM_BV_07_C PASS
+TC_PSE_SSM_BI_02_C INC
+TC_PSE_SSM_BI_03_C N/A
+TC_PSE_SSM_BV_08_I PASS
+TC_PSE_PBD_BV_02_C PASS
+TC_PSE_PBD_BV_03_C PASS
+TC_PSE_PBD_BV_05_C N/A
+TC_PSE_PBD_BI_01_C FAIL
+TC_PSE_PBD_BV_11_C N/A
+TC_PSE_PBD_BV_12_C N/A
+TC_PSE_PBD_BV_13_C N/A
+TC_PSE_PBD_BV_14_C N/A
+TC_PSE_PBD_BV_15_C N/A
+TC_PSE_PBD_BV_16_C N/A
+TC_PSE_PBB_BV_06_C PASS
+TC_PSE_PBB_BV_07_C PASS
+TC_PSE_PBB_BV_08_C PASS
+TC_PSE_PBB_BV_09_C PASS
+TC_PSE_PBB_BV_10_C PASS
+TC_PSE_PBB_BV_11_C INC
+TC_PSE_PBB_BI_01_C PASS
+TC_PSE_PBB_BI_07_C PASS
+TC_PSE_PBF_BV_01_I PASS
+TC_PSE_PBF_BV_02_I PASS
+TC_PSE_PDF_BV_01_I PASS
+TC_PSE_PDF_BV_03_I N/A
+TC_PSE_PDF_BV_05_I N/A
+-------------------------------------------------------------------------------
--
1.8.3.2
^ permalink raw reply related
* [PATCH 1/2] android/pts: Add PTS test results for OPP
From: Szymon Janc @ 2013-12-12 15:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
This will allow for better tracking of current state of implementation.
---
android/Makefile.am | 3 +-
android/pts-opp.txt | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 1 deletion(-)
create mode 100644 android/pts-opp.txt
diff --git a/android/Makefile.am b/android/Makefile.am
index 1dde8c1..bcd9f2b 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -110,4 +110,5 @@ EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
android/pixit-did.txt android/pts-did.txt \
android/pixit-gap.txt android/pixit-hid.txt \
android/pixit-opp.txt android/pixit-pan.txt \
- android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt
+ android/pixit-pbap.txt android/pts-gap.txt android/pts-hid.txt \
+ android/pts-opp.txt
diff --git a/android/pts-opp.txt b/android/pts-opp.txt
new file mode 100644
index 0000000..b9329b9
--- /dev/null
+++ b/android/pts-opp.txt
@@ -0,0 +1,94 @@
+PTS test results for OPP
+
+PTS version: 4.9
+Tested: 14.11.2013
+
+Results:
+PASS test passed
+FAIL test failed
+INC test is inconclusive
+N/A test is disabled due to PICS setup
+
+-------------------------------------------------------------------------------
+Test Name Result Notes
+-------------------------------------------------------------------------------
+TC_CLIENT_OPH_BV_01_I PASS
+TC_CLIENT_OPH_BV_02_I N/A
+TC_CLIENT_OPH_BV_03_I PASS
+TC_CLIENT_OPH_BV_04_I N/A
+TC_CLIENT_OPH_BV_05_I PASS
+TC_CLIENT_OPH_BV_07_I N/A
+TC_CLIENT_OPH_BV_08_I N/A
+TC_CLIENT_OPH_BV_09_I N/A
+TC_CLIENT_OPH_BV_10_I N/A
+TC_CLIENT_OPH_BV_11_I N/A
+TC_CLIENT_OPH_BV_12_I N/A
+TC_CLIENT_OPH_BV_13_I N/A
+TC_CLIENT_OPH_BV_14_I N/A
+TC_CLIENT_OPH_BV_15_I N/A
+TC_CLIENT_OPH_BV_16_I N/A
+TC_CLIENT_OPH_BV_17_I N/A
+TC_CLIENT_OPH_BV_18_I N/A
+TC_CLIENT_OPH_BV_19_I PASS
+TC_CLIENT_OPH_BV_20_I PASS
+TC_CLIENT_OPH_BV_22_I PASS
+TC_CLIENT_OPH_BV_23_I PASS
+TC_CLIENT_OPH_BV_24_I N/A
+TC_CLIENT_OPH_BV_25_I N/A
+TC_CLIENT_OPH_BV_26_I N/A
+TC_CLIENT_OPH_BV_34_I PASS
+TC_CLIENT_OPH_BI_01_C PASS
+TC_CLIENT_BCP_BV_01_I N/A
+TC_CLIENT_BCP_BV_02_I N/A
+TC_CLIENT_BCP_BV_03_I N/A
+TC_CLIENT_BCP_BV_04_I N/A
+TC_CLIENT_BCP_BV_05_I N/A
+TC_CLIENT_BCE_BV_01_I N/A
+TC_CLIENT_BCE_BV_03_I N/A
+TC_CLIENT_BCE_BV_04_I N/A
+TC_CLIENT_BCE_BV_05_I N/A
+TC_CLIENT_BCE_BV_06_I N/A
+TC_CLIENT_BCE_BV_07_I N/A
+TC_SERVER_OPH_BV_01_I PASS
+TC_SERVER_OPH_BV_02_I PASS
+TC_SERVER_OPH_BV_03_I PASS
+TC_SERVER_OPH_BV_04_I PASS
+TC_SERVER_OPH_BV_05_I PASS
+TC_SERVER_OPH_BV_07_I N/A
+TC_SERVER_OPH_BV_08_I N/A
+TC_SERVER_OPH_BV_09_I N/A
+TC_SERVER_OPH_BV_10_I PASS
+TC_SERVER_OPH_BV_11_I N/A
+TC_SERVER_OPH_BV_12_I N/A
+TC_SERVER_OPH_BV_13_I N/A
+TC_SERVER_OPH_BV_14_I PASS
+TC_SERVER_OPH_BV_15_I N/A
+TC_SERVER_OPH_BV_16_I N/A
+TC_SERVER_OPH_BV_17_I N/A
+TC_SERVER_OPH_BV_18_I PASS
+TC_SERVER_OPH_BV_19_I PASS
+TC_SERVER_OPH_BV_21_I N/A
+TC_SERVER_OPH_BV_22_I PASS
+TC_SERVER_OPH_BV_23_I PASS
+TC_SERVER_OPH_BV_24_I N/A
+TC_SERVER_OPH_BV_25_I N/A
+TC_SERVER_OPH_BV_26_I N/A
+TC_SERVER_OPH_BV_34_I PASS
+TC_SERVER_BCP_BV_01_I N/A
+TC_SERVER_BCP_BV_02_I PASS
+TC_SERVER_BCP_BV_03_I N/A
+TC_SERVER_BCP_BV_04_I N/A
+TC_SERVER_BCP_BV_05_I N/A
+TC_SERVER_BCE_BV_01_I N/A
+TC_SERVER_BCE_BV_03_I N/A
+TC_SERVER_BCE_BV_04_I N/A
+TC_SERVER_BCE_BV_05_I N/A
+TC_SERVER_BCE_BV_06_I N/A
+TC_SERVER_BCE_BV_07_I N/A
+TC_CLIENT_OPH_BV_27_I N/A
+TC_SERVER_OPH_BV_27_I N/A
+TC_SERVER_OPH_BV_30_I N/A
+TC_SERVER_OPH_BV_31_I N/A
+TC_SERVER_OPH_BV_32_I N/A
+TC_SERVER_OPH_BV_33_I N/A
+-------------------------------------------------------------------------------
--
1.8.3.2
^ permalink raw reply related
* [PATCH 8/8] android/hal-sock: Fix returning incorrect error code
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
For socket type 0 we shall return BT_STATUS_PARM_INVALID.
---
android/hal-sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/android/hal-sock.c b/android/hal-sock.c
index 301c77f..c39ca6a 100644
--- a/android/hal-sock.c
+++ b/android/hal-sock.c
@@ -81,7 +81,7 @@ static bt_status_t sock_connect(const bt_bdaddr_t *bdaddr, btsock_type_t type,
{
struct hal_cmd_sock_connect cmd;
- if ((!uuid && chan <= 0) || !bdaddr || !sock) {
+ if ((!uuid && chan <= 0) || !bdaddr || !sock || !type) {
error("Invalid params: bd_addr %s, uuid %s, chan %d, sock %p",
bdaddr2str(bdaddr), btuuid2str(uuid), chan, sock);
return BT_STATUS_PARM_INVALID;
--
1.8.3.2
^ permalink raw reply related
* [PATCH 7/8] android/tester: Add Socket test connect invalid sock_type L2CAP
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
android/android-tester.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index a6fbcb5..7518f98 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -715,6 +715,7 @@ static const struct socket_data btsock_inv_param_socktype = {
};
static const struct socket_data btsock_inv_param_socktype_l2cap = {
+ .bdaddr = &bdaddr_dummy,
.sock_type = BTSOCK_L2CAP,
.channel = 1,
.service_uuid = NULL,
@@ -867,5 +868,9 @@ int main(int argc, char *argv[])
&btsock_inv_param_socktype, setup_socket_interface,
test_generic_connect, teardown);
+ test_bredrle("Test Socket Connect - Invalid: sock_type L2CAP",
+ &btsock_inv_param_socktype_l2cap,
+ setup_socket_interface, test_generic_connect, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 6/8] android/tester: Add Socket test connect() invalid sock_type
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
android/android-tester.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 4a96fb8..a6fbcb5 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -71,6 +71,7 @@ struct socket_data {
btsock_type_t sock_type;
const char *service_name;
const uint8_t *service_uuid;
+ const bt_bdaddr_t *bdaddr;
int channel;
int flags;
bt_status_t expected_status;
@@ -699,7 +700,12 @@ static void test_dummy(const void *test_data)
/* Test Socket HAL */
+const bt_bdaddr_t bdaddr_dummy = {
+ .address = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55}
+};
+
static const struct socket_data btsock_inv_param_socktype = {
+ .bdaddr = &bdaddr_dummy,
.sock_type = 0,
.channel = 1,
.service_uuid = NULL,
@@ -780,6 +786,34 @@ clean:
close(sock_fd);
}
+static void test_generic_connect(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct socket_data *test = data->test_data;
+ bt_status_t status;
+ int sock_fd = -1;
+
+ status = data->if_sock->connect(test->bdaddr, test->sock_type,
+ test->service_uuid, test->channel,
+ &sock_fd, test->flags);
+ if (status != test->expected_status) {
+ tester_test_failed();
+ goto clean;
+ }
+
+ /* Check that file descriptor is valid */
+ if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) == -1) {
+ tester_test_failed();
+ return;
+ }
+
+ tester_test_passed();
+
+clean:
+ if (sock_fd >= 0)
+ close(sock_fd);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -829,5 +863,9 @@ int main(int argc, char *argv[])
&btsock_sucess,
setup_socket_interface, test_generic_listen, teardown);
+ test_bredrle("Test Socket Connect - Invalid: sock_type 0",
+ &btsock_inv_param_socktype, setup_socket_interface,
+ test_generic_connect, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 5/8] android/socket: Do not close fd on unref
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
We close file descriptors in cleanup_rfsock() and leaving the default
value gives us glib warnings if we close fd already and got G_IO_NVAL in
server_cb from bt_io.
---
android/socket.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/android/socket.c b/android/socket.c
index 5e8f8e5..9d759be 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -736,6 +736,7 @@ static void handle_listen(const void *buf, uint16_t len)
rfsock->real_sock = g_io_channel_unix_get_fd(io);
g_io_channel_unref(io);
+ g_io_channel_set_close_on_unref(io, FALSE);
DBG("real_sock %d fd %d hal_fd %d", rfsock->real_sock, rfsock->fd,
hal_fd);
--
1.8.3.2
^ permalink raw reply related
* [PATCH 4/8] android/tester: Add Socket test success with valid fd
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Check that Socket listen() returns valid file descriptor
---
android/android-tester.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index bb3f883..4a96fb8 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -727,6 +727,15 @@ static const struct socket_data btsock_inv_params_chan_uuid = {
.expected_status = BT_STATUS_PARM_INVALID,
};
+static const struct socket_data btsock_sucess = {
+ .sock_type = BTSOCK_RFCOMM,
+ .channel = 1,
+ .service_uuid = NULL,
+ .service_name = "Test service",
+ .flags = 0,
+ .expected_status = BT_STATUS_SUCCESS,
+};
+
static void setup_socket_interface(const void *test_data)
{
struct test_data *data = tester_get_data();
@@ -816,5 +825,9 @@ int main(int argc, char *argv[])
&btsock_inv_params_chan_uuid,
setup_socket_interface, test_generic_listen, teardown);
+ test_bredrle("Test Socket Listen - Check returned fd valid",
+ &btsock_sucess,
+ setup_socket_interface, test_generic_listen, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 3/8] android/tester: trivial: Make test cases prints look nice
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
android/android-tester.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/android/android-tester.c b/android/android-tester.c
index 2bb7d73..bb3f883 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -804,11 +804,11 @@ int main(int argc, char *argv[])
test_bredrle("Test Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
- test_bredrle("Test Socket Listen - Invalid sock type",
+ test_bredrle("Test Socket Listen - Invalid: sock_type 0",
&btsock_inv_param_socktype, setup_socket_interface,
test_generic_listen, teardown);
- test_bredrle("Test Socket Listen - Invalid: L2CAP",
+ test_bredrle("Test Socket Listen - Invalid: sock_type L2CAP",
&btsock_inv_param_socktype_l2cap,
setup_socket_interface, test_generic_listen, teardown);
--
1.8.3.2
^ permalink raw reply related
* [PATCH 2/8] android/tester: Check that fd is valid for Success case
From: Andrei Emeltchenko @ 2013-12-12 15:17 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
For the successful test case check that file descriptor is valid through
fcntl which is cheap way.
---
android/android-tester.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 3f763d8..2bb7d73 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <unistd.h>
+#include <fcntl.h>
#include <glib.h>
#include <sys/socket.h>
@@ -757,6 +758,12 @@ static void test_generic_listen(const void *test_data)
goto clean;
}
+ /* Check that file descriptor is valid */
+ if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) == -1) {
+ tester_test_failed();
+ return;
+ }
+
tester_test_passed();
clean:
--
1.8.3.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox