| 1 | import json |
| 2 | |
| 3 | nr_of_client_errs = 0 |
| 4 | nr_of_client_tests = 0 |
| 5 | |
| 6 | nr_of_server_errs = 0 |
| 7 | nr_of_server_tests = 0 |
| 8 | |
| 9 | with 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 | with open("/reports/servers/index.json") as f: |
| 23 | data = json.load(f) |
| 24 | |
| 25 | for i in data["AutobahnServer"]: |
| 26 | if ( |
| 27 | data["AutobahnServer"][i]["behavior"] == "FAILED" |
| 28 | or data["AutobahnServer"][i]["behaviorClose"] == "FAILED" |
| 29 | ): |
| 30 | nr_of_server_errs = nr_of_server_errs + 1 |
| 31 | |
| 32 | nr_of_server_tests = nr_of_server_tests + 1 |
| 33 | |
| 34 | if nr_of_client_errs > 0 or nr_of_server_errs > 0: |
| 35 | print( |
| 36 | "FAILED AUTOBAHN TESTS, CLIENT ERRORS {0}(of {1}), SERVER ERRORS {2}(of {3})".format( |
| 37 | nr_of_client_errs, nr_of_client_tests, nr_of_server_errs, nr_of_server_tests |
| 38 | ) |
| 39 | ) |
| 40 | exit(1) |
| 41 | |
| 42 | print( |
| 43 | "TEST SUCCESS!, CLIENT TESTS({0}), SERVER TESTS ({1})".format( |
| 44 | nr_of_client_tests, nr_of_server_tests |
| 45 | ) |
| 46 | ) |
| 47 | |