From 16cf6d7bf3a73d1311f1c6359a43f29330bd6702 Mon Sep 17 00:00:00 2001 From: yuanjm Date: Wed, 8 Jun 2022 16:14:01 +0800 Subject: [PATCH] ci: Add PING test for ci --- .../https_server/wss_server/pytest_https_wss_server.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/protocols/https_server/wss_server/pytest_https_wss_server.py b/examples/protocols/https_server/wss_server/pytest_https_wss_server.py index 07e1cd52dd..f9c5f82d3c 100644 --- a/examples/protocols/https_server/wss_server/pytest_https_wss_server.py +++ b/examples/protocols/https_server/wss_server/pytest_https_wss_server.py @@ -143,6 +143,16 @@ def test_examples_protocol_https_wss_server(dut: Dut) -> None: raise RuntimeError('Failed to receive the correct echo response') logging.info('Correct echo response obtained from the wss server') + # Test for PING + logging.info('Testing for send PING') + ws.write(data=DATA, opcode=OPCODE_PING) + dut.expect('Got a WS PING frame, Replying PONG') + opcode, data = ws.read() + data = data.decode('UTF-8') + if data != DATA or opcode != OPCODE_PONG: + raise RuntimeError('Failed to receive the PONG response') + logging.info('Passed the test for PING') + # Test for keepalive logging.info('Testing for keep alive (approx time = 20s)') start_time = time.time()