Skip to content

Commit acc2a25

Browse files
committed
fix: Update test_dcl_server.py for Python 3.x compatibility
Update the DCL server script to support newer Python versions for TC-CGEN-2.12 manual test case execution. The script provides terms and conditions functionality required for testing the DCL flow. Testing: 1. Start the DCL server in terminal 1: ```bash python3 ./examples/chip-tool/commands/dcl/test_dcl_server.py ``` 2. Launch terms and conditions app in terminal 2: ```bash rm /tmp/chip* ; ./out/linux-x64-terms-and-conditions/chip-terms-and-conditions-app \ --version 0 --custom-flow 2 --capabilities 6 --discriminator 3840 \ --passcode 20202021 --KVS /tmp/chip_kvs.bin --trace_file /tmp/chip_trace.log \ --trace_log 1 --trace_decode 1 ``` 3. Execute pairing command in terminal 3: ```bash yes | ./out/linux-x64-chip-tool/chip-tool pairing code 0x12344321 \ MT:-24J029Q00KA0648G00 --use-dcl true --dcl-hostname localhost --dcl-port 4443 ```
1 parent 7d67dc9 commit acc2a25

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/chip-tool/commands/dcl/test_dcl_server.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ def run_https_server(cert_file="cert.pem", key_file="key.pem"):
214214
httpd = http.server.HTTPServer(
215215
(DEFAULT_HOSTNAME, DEFAULT_PORT), RESTRequestHandler)
216216

217-
httpd.socket = ssl.wrap_socket(
217+
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
218+
context.load_cert_chain(certfile="server.crt", keyfile="server.key")
219+
httpd.socket = context.wrap_socket(
218220
httpd.socket,
219221
server_side=True,
220-
certfile=cert_file,
221-
keyfile=key_file,
222-
ssl_version=ssl.PROTOCOL_TLS,
222+
# certfile=cert_file,
223+
# keyfile=key_file,
224+
# ssl_version=ssl.PROTOCOL_TLS,
223225
)
224226

225227
print(f"Serving on https://{DEFAULT_HOSTNAME}:{DEFAULT_PORT}")

0 commit comments

Comments
 (0)