From 1bd2145d6b87b51bee295f2f16f44f1313314f37 Mon Sep 17 00:00:00 2001 From: yuanjm Date: Thu, 16 Jun 2022 10:09:46 +0800 Subject: [PATCH] ci: Add PING test for ci --- .../https_server/wss_server/wss_server_example_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/protocols/https_server/wss_server/wss_server_example_test.py b/examples/protocols/https_server/wss_server/wss_server_example_test.py index 7e16256913..b7e088b4a1 100644 --- a/examples/protocols/https_server/wss_server/wss_server_example_test.py +++ b/examples/protocols/https_server/wss_server/wss_server_example_test.py @@ -155,6 +155,16 @@ def test_examples_protocol_https_wss_server(env, extra_data): # type: (tiny_tes raise RuntimeError('Failed to receive the correct echo response') Utility.console_log('Correct echo response obtained from the wss server') + # Test for PING + Utility.console_log('Testing for send PING') + ws.write(data=DATA, opcode=OPCODE_PING) + dut1.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') + Utility.console_log('Passed the test for PING') + # Test for keepalive Utility.console_log('Testing for keep alive (approx time = 20s)') start_time = time.time()