2015-04-05 18:39:23

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ 1/3] doc: fix minor typos

The documentation contained minor typos which are being fixed here.

Signed-off-by: Florian Grandel <[email protected]>
---
doc/coding-style.txt | 2 +-
doc/maintainer-guidelines.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index b3fbd2e..f0bf880 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -61,7 +61,7 @@ if (err || !S_ISDIR(st.st_mode))
M2: Multiple line comment
=========================

-If your comments have more then one line, please start it from the second line.
+If your comment has more than one line, please start it from the second line.

Example:
/*
diff --git a/doc/maintainer-guidelines.txt b/doc/maintainer-guidelines.txt
index fef90c8..21162d4 100644
--- a/doc/maintainer-guidelines.txt
+++ b/doc/maintainer-guidelines.txt
@@ -99,7 +99,7 @@ verified first:
- Check that the names are acceptible with other maintainers
- Ensure that the file modes are correct
- Verify that the license & copyright headers are correct
- - If the file is supposed to be part of the release taraball,
+ - If the file is supposed to be part of the release tarball,
make sure that it gets picked up by 'make dist' (particularly
important for documentation or other files that are not code)

--
1.9.1



2015-04-09 09:49:26

by Florian Grandel

[permalink] [raw]
Subject: Re: [BlueZ v2 0/3] Minor improvements to the docs and mgmt API tests

> One note: I had to manually remove the "Signed-off-by" from one patch
> 1/3 since we don't use that for the user space tree.

Oups, sorry. And thanks for your review. :-)

2015-04-09 09:42:43

by Johan Hedberg

[permalink] [raw]
Subject: Re: [BlueZ v2 0/3] Minor improvements to the docs and mgmt API tests

Hi Florian,

On Sun, Apr 05, 2015, Florian Grandel wrote:
> v1 -> v2: found more instances of misleading test messages
>
> Florian Grandel (3):
> doc: fix minor typos
> tools: fix misleading test output
> tools: add read adv features success tests
>
> doc/coding-style.txt | 2 +-
> doc/maintainer-guidelines.txt | 2 +-
> doc/test-coverage.txt | 2 +-
> tools/mgmt-tester.c | 37 +++++++++++++++++++++++++++++++++----
> 4 files changed, 36 insertions(+), 7 deletions(-)

All three patches have been applied. Thanks.

One note: I had to manually remove the "Signed-off-by" from one patch
1/3 since we don't use that for the user space tree.

Johan

2015-04-05 19:11:28

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ v2 3/3] tools: add read adv features success tests

The mgmt-tester did not yet contain tests for the success path of the
MGMT_OP_READ_ADV_FEATURES command. This patch adds two tests: one
calling the command without an advertising instance and one with one
advertising instance added.
---
doc/test-coverage.txt | 2 +-
tools/mgmt-tester.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index fa8a04a..19bb73c 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -39,7 +39,7 @@ Automated end-to-end testing

Application Count Description
-------------------------------------------
-mgmt-tester 293 Kernel management interface testing
+mgmt-tester 295 Kernel management interface testing
l2cap-tester 27 Kernel L2CAP implementation testing
rfcomm-tester 9 Kernel RFCOMM implementation testing
bnep-tester 1 Kernel BNEP implementation testing
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 72e9bd9..c0f58ce 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -3862,6 +3862,28 @@ static const struct generic_data read_adv_features_invalid_index_test = {
.expect_status = MGMT_STATUS_INVALID_INDEX,
};

+static const uint8_t read_adv_features_rsp_1[] = {
+ 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x01, 0x00,
+};
+
+static const struct generic_data read_adv_features_success_1 = {
+ .send_opcode = MGMT_OP_READ_ADV_FEATURES,
+ .expect_param = read_adv_features_rsp_1,
+ .expect_len = sizeof(read_adv_features_rsp_1),
+ .expect_status = MGMT_STATUS_SUCCESS,
+};
+
+static const uint8_t read_adv_features_rsp_2[] = {
+ 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x01, 0x01, 0x01
+};
+
+static const struct generic_data read_adv_features_success_2 = {
+ .send_opcode = MGMT_OP_READ_ADV_FEATURES,
+ .expect_param = read_adv_features_rsp_2,
+ .expect_len = sizeof(read_adv_features_rsp_2),
+ .expect_status = MGMT_STATUS_SUCCESS,
+};
+
static const uint8_t add_advertising_param_1[] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
0x03, 0x02, 0x0d, 0x18,
@@ -6384,6 +6406,13 @@ int main(int argc, char *argv[])
test_bredrle("Read Advertising Features - Invalid index",
&read_adv_features_invalid_index_test,
NULL, test_command_generic);
+ test_bredrle("Read Advertising Features - Success 1 (No instance)",
+ &read_adv_features_success_1,
+ NULL, test_command_generic);
+ test_bredrle("Read Advertising Features - Success 2 (One instance)",
+ &read_adv_features_success_2,
+ setup_add_advertising,
+ test_command_generic);

test_bredrle("Add Advertising - Failure: LE off",
&add_advertising_fail_1,
--
1.9.1


2015-04-05 19:11:27

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ v2 2/3] tools: fix misleading test output

The setup_add_advertising() function claimed to add an advertising
instance while unpowered although it actually adds the instance while
powered. This patch fixes several tester output instances accordingly.
---

Notes:
v1 -> v2: found and corrected more instances of this problem

tools/mgmt-tester.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 6a9b527..72e9bd9 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -4894,7 +4894,7 @@ static void setup_add_advertising(const void *test_data)
unsigned char adv_param[sizeof(*cp) + 6];
unsigned char param[] = { 0x01 };

- tester_print("Adding advertising instance while unpowered");
+ tester_print("Adding advertising instance while powered");

cp = (struct mgmt_cp_add_advertising *) adv_param;
memset(cp, 0, sizeof(*cp));
@@ -4929,7 +4929,7 @@ static void setup_add_advertising_connectable(const void *test_data)
unsigned char adv_param[sizeof(*cp) + 6];
unsigned char param[] = { 0x01 };

- tester_print("Adding advertising instance while unpowered");
+ tester_print("Adding advertising instance while connectable");

cp = (struct mgmt_cp_add_advertising *) adv_param;
memset(cp, 0, sizeof(*cp));
@@ -4968,7 +4968,7 @@ static void setup_add_advertising_timeout(const void *test_data)
unsigned char adv_param[sizeof(*cp) + 6];
unsigned char param[] = { 0x01 };

- tester_print("Adding advertising instance while unpowered");
+ tester_print("Adding advertising instance with timeout");

cp = (struct mgmt_cp_add_advertising *) adv_param;
memset(cp, 0, sizeof(*cp));
@@ -5004,7 +5004,7 @@ static void setup_set_and_add_advertising(const void *test_data)
unsigned char adv_param[sizeof(*cp) + 6];
unsigned char param[] = { 0x01 };

- tester_print("Adding advertising instance while unpowered");
+ tester_print("Set and add advertising instance");

cp = (struct mgmt_cp_add_advertising *) adv_param;
memset(cp, 0, sizeof(*cp));
--
1.9.1


2015-04-05 19:11:26

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ v2 1/3] doc: fix minor typos

The documentation contained minor typos which are being fixed here.

Signed-off-by: Florian Grandel <[email protected]>
---
doc/coding-style.txt | 2 +-
doc/maintainer-guidelines.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index b3fbd2e..f0bf880 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -61,7 +61,7 @@ if (err || !S_ISDIR(st.st_mode))
M2: Multiple line comment
=========================

-If your comments have more then one line, please start it from the second line.
+If your comment has more than one line, please start it from the second line.

Example:
/*
diff --git a/doc/maintainer-guidelines.txt b/doc/maintainer-guidelines.txt
index fef90c8..21162d4 100644
--- a/doc/maintainer-guidelines.txt
+++ b/doc/maintainer-guidelines.txt
@@ -99,7 +99,7 @@ verified first:
- Check that the names are acceptible with other maintainers
- Ensure that the file modes are correct
- Verify that the license & copyright headers are correct
- - If the file is supposed to be part of the release taraball,
+ - If the file is supposed to be part of the release tarball,
make sure that it gets picked up by 'make dist' (particularly
important for documentation or other files that are not code)

--
1.9.1


2015-04-05 19:11:25

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ v2 0/3] Minor improvements to the docs and mgmt API tests

v1 -> v2: found more instances of misleading test messages

Florian Grandel (3):
doc: fix minor typos
tools: fix misleading test output
tools: add read adv features success tests

doc/coding-style.txt | 2 +-
doc/maintainer-guidelines.txt | 2 +-
doc/test-coverage.txt | 2 +-
tools/mgmt-tester.c | 37 +++++++++++++++++++++++++++++++++----
4 files changed, 36 insertions(+), 7 deletions(-)

--
1.9.1


2015-04-05 18:39:25

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ 3/3] tools: add read adv features success tests

The mgmt-tester did not yet contains tests for the happy path of the
MGMT_OP_READ_ADV_FEATURES command. This patch adds two tests: one
calling the command without an advertising instance and one with one
advertising instance added.
---
doc/test-coverage.txt | 2 +-
tools/mgmt-tester.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index fa8a04a..19bb73c 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -39,7 +39,7 @@ Automated end-to-end testing

Application Count Description
-------------------------------------------
-mgmt-tester 293 Kernel management interface testing
+mgmt-tester 295 Kernel management interface testing
l2cap-tester 27 Kernel L2CAP implementation testing
rfcomm-tester 9 Kernel RFCOMM implementation testing
bnep-tester 1 Kernel BNEP implementation testing
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 174c3b7..d9e1c6f 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -3862,6 +3862,28 @@ static const struct generic_data read_adv_features_invalid_index_test = {
.expect_status = MGMT_STATUS_INVALID_INDEX,
};

+static const uint8_t read_adv_features_rsp_1[] = {
+ 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x01, 0x00,
+};
+
+static const struct generic_data read_adv_features_success_1 = {
+ .send_opcode = MGMT_OP_READ_ADV_FEATURES,
+ .expect_param = read_adv_features_rsp_1,
+ .expect_len = sizeof(read_adv_features_rsp_1),
+ .expect_status = MGMT_STATUS_SUCCESS,
+};
+
+static const uint8_t read_adv_features_rsp_2[] = {
+ 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x01, 0x01, 0x01
+};
+
+static const struct generic_data read_adv_features_success_2 = {
+ .send_opcode = MGMT_OP_READ_ADV_FEATURES,
+ .expect_param = read_adv_features_rsp_2,
+ .expect_len = sizeof(read_adv_features_rsp_2),
+ .expect_status = MGMT_STATUS_SUCCESS,
+};
+
static const uint8_t add_advertising_param_1[] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
0x03, 0x02, 0x0d, 0x18,
@@ -6384,6 +6406,13 @@ int main(int argc, char *argv[])
test_bredrle("Read Advertising Features - Invalid index",
&read_adv_features_invalid_index_test,
NULL, test_command_generic);
+ test_bredrle("Read Advertising Features - Success 1 (No instance)",
+ &read_adv_features_success_1,
+ NULL, test_command_generic);
+ test_bredrle("Read Advertising Features - Success 2 (One instance)",
+ &read_adv_features_success_2,
+ setup_add_advertising,
+ test_command_generic);

test_bredrle("Add Advertising - Failure: LE off",
&add_advertising_fail_1,
--
1.9.1


2015-04-05 18:39:24

by Florian Grandel

[permalink] [raw]
Subject: [BlueZ 2/3] tools: fix misleading test output

The setup_add_advertising() function claimed to add an advertising
instance while unpowered although it actually adds the instance while
powered. This patch fixes the tester output accordingly.
---
tools/mgmt-tester.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 6a9b527..174c3b7 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -4894,7 +4894,7 @@ static void setup_add_advertising(const void *test_data)
unsigned char adv_param[sizeof(*cp) + 6];
unsigned char param[] = { 0x01 };

- tester_print("Adding advertising instance while unpowered");
+ tester_print("Adding advertising instance while powered");

cp = (struct mgmt_cp_add_advertising *) adv_param;
memset(cp, 0, sizeof(*cp));
--
1.9.1