websocket: updated example to use local websocket echo server

This commit is contained in:
Suren Gabrielyan
2022-10-31 20:53:37 +04:00
parent 698fb3ae00
commit 55dc56462f
3 changed files with 6 additions and 11 deletions

View File

@ -101,7 +101,7 @@ def test_examples_protocol_websocket(dut):
data = json.loads(json_string)
match = dut.expect(
re.compile(b'Json=([a-zA-Z0-9]*).*')).group(0).decode()[5:]
re.compile(b'Json=({[a-zA-Z0-9]*).*}')).group(0).decode()[5:]
if match == str(data[0]):
print('Sent message and received message are equal')
else:
@ -122,7 +122,7 @@ def test_examples_protocol_websocket(dut):
recv_msg = ''
while len(recv_msg) < msg_len:
match = dut.expect(re.compile(
b'Received=([a-zA-Z0-9]*).*')).group(1).decode()
b'Received=([a-zA-Z0-9]*).*\n')).group(1).decode()
recv_msg += match
if recv_msg == send_msg:

View File

@ -1,6 +1,5 @@
CONFIG_WEBSOCKET_URI_FROM_STDIN=n
CONFIG_WEBSOCKET_URI_FROM_STRING=y
CONFIG_WEBSOCKET_URI="ws://echo.websocket.events"
CONFIG_WEBSOCKET_URI_FROM_STDIN=y
CONFIG_WEBSOCKET_URI_FROM_STRING=n
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
CONFIG_EXAMPLE_CONNECT_WIFI=n
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y