aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/net/websocket/tests/autobahn/fuzzing_server/check_results.py
blob: 9275c3cb86692167ccb95bc0a3a2951494c1013e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import json

nr_of_client_errs = 0
nr_of_client_tests = 0

nr_of_server_errs = 0
nr_of_server_tests = 0

with open("/reports/clients/index.json") as f:
    data = json.load(f)

    for i in data["v-client"]:
        # Count errors
        if (
            data["v-client"][i]["behavior"] == "FAILED"
            or data["v-client"][i]["behaviorClose"] == "FAILED"
        ):
            nr_of_client_errs = nr_of_client_errs + 1

        nr_of_client_tests = nr_of_client_tests + 1

with open("/reports/servers/index.json") as f:
    data = json.load(f)

    for i in data["AutobahnServer"]:
        if (
            data["AutobahnServer"][i]["behavior"] == "FAILED"
            or data["AutobahnServer"][i]["behaviorClose"] == "FAILED"
        ):
            nr_of_server_errs = nr_of_server_errs + 1

        nr_of_server_tests = nr_of_server_tests + 1

if nr_of_client_errs > 0 or nr_of_server_errs > 0:
    print(
        "FAILED AUTOBAHN TESTS, CLIENT ERRORS {0}(of {1}), SERVER ERRORS {2}(of {3})".format(
            nr_of_client_errs, nr_of_client_tests, nr_of_server_errs, nr_of_server_tests
        )
    )
    exit(1)

print(
    "TEST SUCCESS!, CLIENT TESTS({0}), SERVER TESTS ({1})".format(
        nr_of_client_tests, nr_of_server_tests
    )
)