Skip to content

Commit

Permalink
[border-agent] use dynamic port (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
bukepo authored Apr 21, 2021
1 parent 26702ff commit e6cf6bb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions tests/integration/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ form_network() {
sudo "${OT_CTL}" state
}

petition_commissioner() {
local ba_port
ba_port="$(sudo "${OT_CTL}" ba port | grep -o '[0-9]\+')"
send_command_to_commissioner "start :: ${ba_port}"
}

start_border_agent_mdns_service() {
## See etc/avahi/services/border-agent.service
## for the service registration.
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/test_announce_begin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ test_announce_begin() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"

petition_commissioner
send_command_to_commissioner "active"
send_command_to_commissioner "announce 0xffffffff 2 32 ff02::2"
stop_commissioner
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test_network_sync()
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "network sync"
stop_commissioner

Expand All @@ -48,7 +48,7 @@ test_get_commissioner_dataset()
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "commdataset get"
stop_commissioner

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_energy_scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_energy_scan() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"
send_command_to_commissioner "energy scan 0xffffffff 2 10 30 ff02::2"
sleep 1
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_joining.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_joining() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"

## enable all MeshCoP joiners
Expand All @@ -52,7 +52,7 @@ test_joining_fail() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"

## meshcop joiners not enabled, it should fail.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_operational_dataset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_active_dataset_set_network_name() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"
send_command_to_commissioner "opdataset set networkname test-network"

Expand All @@ -50,7 +50,7 @@ test_pending_dataset_set_channel() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"
send_command_to_commissioner "opdataset set channel 0 17 60"

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_pan_id_query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_pan_id_query() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"
send_command_to_commissioner "panid query 0xffffffff 0xaabb ff02::2"
sleep 1
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_petition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_petition() {
form_network "${PSKC}"

start_commissioner "${NON_CCM_CONFIG}"
send_command_to_commissioner "start :: 49191"
petition_commissioner
send_command_to_commissioner "active"
stop_commissioner

Expand Down

0 comments on commit e6cf6bb

Please sign in to comment.