/
success.go
57 lines (53 loc) · 1.37 KB
/
success.go
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
47
48
49
50
51
52
53
54
55
56
57
package webconnectivityqa
var successCheckers = []Checker{
// See https://github.com/ooni/probe/issues/2674
&ReadWriteEventsExistentialChecker{},
// See https://github.com/ooni/probe/issues/2676
&ClientResolverCorrectnessChecker{},
}
// successWithHTTP ensures we can successfully measure an HTTP URL.
func successWithHTTP() *TestCase {
return &TestCase{
Name: "successWithHTTP",
Flags: 0,
Input: "http://www.example.com/",
Configure: nil,
ExpectErr: false,
ExpectTestKeys: &TestKeys{
DNSConsistency: "consistent",
BodyLengthMatch: true,
BodyProportion: 1,
StatusCodeMatch: true,
HeadersMatch: true,
TitleMatch: true,
XStatus: 2,
XBlockingFlags: 32,
Accessible: true,
Blocking: false,
},
Checkers: successCheckers,
}
}
// successWithHTTPS ensures we can successfully measure an HTTPS URL.
func successWithHTTPS() *TestCase {
return &TestCase{
Name: "successWithHTTPS",
Flags: 0,
Input: "https://www.example.com/",
Configure: nil,
ExpectErr: false,
ExpectTestKeys: &TestKeys{
DNSConsistency: "consistent",
BodyLengthMatch: true,
BodyProportion: 1,
StatusCodeMatch: true,
HeadersMatch: true,
TitleMatch: true,
XStatus: 1,
XBlockingFlags: 32,
Accessible: true,
Blocking: false,
},
Checkers: successCheckers,
}
}