forked from ooni/probe-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webconnectivitylte): add Cloudflare CAPTCHA test cases (ooni#1476)
## Checklist - [x] I have read the [contribution guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md) - [x] reference issue for this pull request: ooni/probe#1734 - [x] if you changed anything related to how experiments work and you need to reflect these changes in the ooni/spec repository, please link to the related ooni/spec pull request: ooni/spec#284 - [x] if you changed code inside an experiment, make sure you bump its version number: not needed ## Description Closes ooni/probe#1734. See ooni/probe#2661. While there, rename an incorrectly renamed Yandex test. While there, ignore the `/oonireport` binary.
- Loading branch information
1 parent
e9414f9
commit 8daf64f
Showing
18 changed files
with
3,679 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
/oohelper | ||
/oohelperd | ||
/ooniprobe | ||
/oonireport | ||
/ooporthelper | ||
/probe-cli.cov | ||
/tinyjafar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package webconnectivityqa | ||
|
||
import "github.com/ooni/probe-cli/v3/internal/netemx" | ||
|
||
// cloudflareCAPTCHAWithHTTP obtains the cloudflare CAPTCHA using HTTP. | ||
func cloudflareCAPTCHAWithHTTP() *TestCase { | ||
// See https://github.com/ooni/probe/issues/2661 for an explanation of why | ||
// here for now we're forced to declare "http-diff". | ||
return &TestCase{ | ||
Name: "cloudflareCAPTCHAWithHTTP", | ||
Flags: TestCaseFlagNoV04, | ||
Input: "http://www.cloudflare-cache.com/", | ||
Configure: func(env *netemx.QAEnv) { | ||
// nothing | ||
}, | ||
ExpectErr: false, | ||
ExpectTestKeys: &testKeys{ | ||
DNSConsistency: "consistent", | ||
StatusCodeMatch: false, | ||
BodyLengthMatch: false, | ||
BodyProportion: 0.18180740037950663, | ||
HeadersMatch: true, | ||
TitleMatch: false, | ||
XBlockingFlags: 16, // AnalysisBlockingFlagHTTPDiff | ||
Accessible: false, | ||
Blocking: "http-diff", | ||
}, | ||
} | ||
} | ||
|
||
// cloudflareCAPTCHAWithHTTPS obtains the cloudflare CAPTCHA using HTTPS. | ||
func cloudflareCAPTCHAWithHTTPS() *TestCase { | ||
return &TestCase{ | ||
Name: "cloudflareCAPTCHAWithHTTPS", | ||
Flags: TestCaseFlagNoV04, | ||
Input: "https://www.cloudflare-cache.com/", | ||
Configure: func(env *netemx.QAEnv) { | ||
// nothing | ||
}, | ||
ExpectErr: false, | ||
ExpectTestKeys: &testKeys{ | ||
DNSConsistency: "consistent", | ||
StatusCodeMatch: false, | ||
BodyLengthMatch: false, | ||
BodyProportion: 0.18180740037950663, | ||
HeadersMatch: true, | ||
TitleMatch: false, | ||
XBlockingFlags: 32, // AnalysisBlockingFlagSuccess | ||
Accessible: true, | ||
Blocking: false, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.