v2 / vlib / net / websocket / tests / autobahn / fuzzing_server_wss / check_results.py
35 lines · 27 sloc · 887 bytes · ec973f5c6e32a8871a71a1fb9924bb8b3670967c
Raw
1import json
2
3nr_of_client_errs = 0
4nr_of_client_tests = 0
5
6nr_of_server_errs = 0
7nr_of_server_tests = 0
8
9with open("/reports/clients/index.json") as f:
10 data = json.load(f)
11
12 for i in data["v-client"]:
13 # Count errors
14 if (
15 data["v-client"][i]["behavior"] == "FAILED"
16 or data["v-client"][i]["behaviorClose"] == "FAILED"
17 ):
18 nr_of_client_errs = nr_of_client_errs + 1
19
20 nr_of_client_tests = nr_of_client_tests + 1
21
22
23if nr_of_client_errs > 0 or nr_of_server_errs > 0:
24 print(
25 "FAILED AUTOBAHN TESTS, CLIENT ERRORS {0}(of {1}), SERVER ERRORS {2}(of {3})".format(
26 nr_of_client_errs, nr_of_client_tests, nr_of_server_errs, nr_of_server_tests
27 )
28 )
29 exit(1)
30
31print(
32 "TEST SUCCESS!, CLIENT TESTS({0}), SERVER TESTS ({1})".format(
33 nr_of_client_tests, nr_of_server_tests
34 )
35)
36