Skip to content

Commit

Permalink
fix build fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonghui Tang committed Aug 19, 2020
1 parent 40adcb6 commit ff5686d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
3 changes: 0 additions & 3 deletions tests/rest/test-rest-server
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ on_exit()
local status=$?

sudo killall otbr-agent || true
sudo killall nginx || true
sudo killall expect || true
sudo killall ot-cli-ftd || true
sudo killall ot-cli-mtd || true
Expand Down Expand Up @@ -85,8 +84,6 @@ send "thread start\r\n"
expect "Done"
wait
EOF
sleep 10
nginx
sleep 10
sudo python3 "${CMAKE_CURRENT_SOURCE_DIR}"/test_rest.py
}
Expand Down
18 changes: 8 additions & 10 deletions tests/rest/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@

rest_api_addr = "http://0.0.0.0:8081"

web_api_addr = "http://0.0.0.0"

def get_data_from_url(url, result, index):
response = urllib.request.urlopen(urllib.request.Request(url))
body = response.read()
Expand Down Expand Up @@ -438,7 +436,7 @@ def error_test(thread_num):


def commissioner():
url = web_api_addr + "/v1/networks/current/commission"
url = rest_api_addr + "/v1/networks/current/commission"
data = {
'passphase': '123445',
'pskd': 'ABCDEF',
Expand Down Expand Up @@ -468,7 +466,7 @@ def commissioner():


def add_remove_prefix():
url = web_api_addr + "/v1/networks/current/prefix"
url = rest_api_addr + "/v1/networks/current/prefix"
data = {
'prefix': 'fd13:22::',
'defaultRoute': True,
Expand Down Expand Up @@ -499,14 +497,14 @@ def add_remove_prefix():


def form_network_test():
url = web_api_addr + "/v1/node/network-name"
url = rest_api_addr + "/v1/node/network-name"

response = urllib.request.urlopen(urllib.request.Request(url))
body = response.read()
data = json.loads(body)
assert data != 'OpenThreadTest1'

url = web_api_addr + "/v1/networks"
url = rest_api_addr + "/v1/networks"
data = {
'networkName': 'OpenThreadTest1',
'extPanId': '1111111122222222',
Expand All @@ -527,7 +525,7 @@ def form_network_test():

time.sleep(10)

url = web_api_addr + "/v1/node/network-name"
url = rest_api_addr + "/v1/node/network-name"
response = urllib.request.urlopen(urllib.request.Request(url))
body = response.read()
data = json.loads(body)
Expand All @@ -536,7 +534,7 @@ def form_network_test():


def scan():
url = web_api_addr + "/v1/networks"
url = rest_api_addr + "/v1/networks"
response = urllib.request.urlopen(urllib.request.Request(url))
body = response.read()
data = json.loads(body)
Expand All @@ -551,7 +549,7 @@ def scan():


def join():
url = web_api_addr + "/v1/networks/current"
url = rest_api_addr + "/v1/networks/current"

data = {
'extPanId': 'dead00beef00cafe',
Expand All @@ -573,7 +571,7 @@ def join():

time.sleep(10)

url = web_api_addr + "/v1/diagnostics"
url = rest_api_addr + "/v1/diagnostics"
response = urllib.request.urlopen(urllib.request.Request(url))
body = response.read()
data = json.loads(body)
Expand Down

0 comments on commit ff5686d

Please sign in to comment.