Skip to content

Commit

Permalink
chore(webconnectivitylte): add large file test cases (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Jan 31, 2024
1 parent bf471b3 commit 9b59892
Show file tree
Hide file tree
Showing 16 changed files with 4,889 additions and 0 deletions.
47 changes: 47 additions & 0 deletions internal/experiment/webconnectivityqa/largefile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package webconnectivityqa

import "github.com/ooni/probe-cli/v3/internal/netemx"

// largeFileWithHTTP is the case where we download a large file.
func largeFileWithHTTP() *TestCase {
return &TestCase{
Name: "largeFileWithHTTP",
Flags: TestCaseFlagNoV04,
Input: "http://largefile.com/",
Configure: func(env *netemx.QAEnv) {
// nothing
},
ExpectErr: false,
ExpectTestKeys: &testKeys{
DNSConsistency: "consistent",
StatusCodeMatch: true,
HeadersMatch: true,
TitleMatch: true,
XBlockingFlags: 32, // AnalysisBlockingFlagSuccess
Accessible: true,
Blocking: false,
},
}
}

// largeFileWithHTTPS is the case where we download a large file.
func largeFileWithHTTPS() *TestCase {
return &TestCase{
Name: "largeFileWithHTTPS",
Flags: TestCaseFlagNoV04,
Input: "https://largefile.com/",
Configure: func(env *netemx.QAEnv) {
// nothing
},
ExpectErr: false,
ExpectTestKeys: &testKeys{
DNSConsistency: "consistent",
StatusCodeMatch: true,
HeadersMatch: true,
TitleMatch: true,
XBlockingFlags: 32, // AnalysisBlockingFlagSuccess
Accessible: true,
Blocking: false,
},
}
}
3 changes: 3 additions & 0 deletions internal/experiment/webconnectivityqa/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func AllTestCases() []*TestCase {
idnaWithoutCensorshipLowercase(),
idnaWithoutCensorshipWithFirstLetterUppercase(),

largeFileWithHTTP(),
largeFileWithHTTPS(),

localhostWithHTTP(),
localhostWithHTTPS(),

Expand Down
Loading

0 comments on commit 9b59892

Please sign in to comment.