Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Feb 5, 2024
1 parent 433d58d commit 0114f0e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/miekg/dns v1.1.57
github.com/mitchellh/go-wordwrap v1.0.1
github.com/montanaflynn/stats v0.7.1
github.com/ooni/netem v0.0.0-20231213064826-3cc1ea5e942c
github.com/ooni/netem v0.0.0-20240205182847-14e4ce92d41e
github.com/ooni/oocrypto v0.5.7
github.com/ooni/oohttp v0.6.7
github.com/ooni/probe-assets v0.21.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/ooni/netem v0.0.0-20231213064826-3cc1ea5e942c h1:T6Li/1zerzLDRaST/B2TQlmKE1XIdqeewQtd9c59t9U=
github.com/ooni/netem v0.0.0-20231213064826-3cc1ea5e942c/go.mod h1:b/wAvTR5n92Vk2b0SBmuMU0xO4ZGVrsXtU7zjTby7vw=
github.com/ooni/netem v0.0.0-20240205182847-14e4ce92d41e h1:OwDVOPs8NBLb1yEZXnn7rbfbBQJVOpIgEZsqq6QpqG8=
github.com/ooni/netem v0.0.0-20240205182847-14e4ce92d41e/go.mod h1:b/wAvTR5n92Vk2b0SBmuMU0xO4ZGVrsXtU7zjTby7vw=
github.com/ooni/oocrypto v0.5.7 h1:QEb1KTh5gZ9s1IQjk7rNF076YVwit+2sDKNbo39IEa8=
github.com/ooni/oocrypto v0.5.7/go.mod h1:HjEQ5pQBl6btcWgAsKKq1tFo8CfBrZu63C/vPAUGIDk=
github.com/ooni/oohttp v0.6.7 h1:wmCjx9+gzx7p1xc/kMAmgXSgXKu7G8CAmil4Zii3g10=
Expand Down
1 change: 1 addition & 0 deletions internal/experiment/webconnectivityqa/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func AllTestCases() []*TestCase {
tcpBlockingConnectTimeout(),
tcpBlockingConnectionRefusedWithInconsistentDNS(),

throttlingWithHTTP(),
throttlingWithHTTPS(),

tlsBlockingConnectionResetWithConsistentDNS(),
Expand Down
38 changes: 37 additions & 1 deletion internal/experiment/webconnectivityqa/throttling.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,43 @@ import (
"github.com/ooni/probe-cli/v3/internal/netemx"
)

// throttlingWithHTTPS is the case where the website has throttling configured for it.
// throttlingWithHTTP is the case where an HTTP website has throttling configured for it.
func throttlingWithHTTP() *TestCase {
return &TestCase{
Name: "throttlingWithHTTP",
Flags: TestCaseFlagNoV04,
Input: "http://largefile.com/",
Configure: func(env *netemx.QAEnv) {

env.DPIEngine().AddRule(&netem.DPIThrottleTrafficForTCPEndpoint{
Delay: 300 * time.Millisecond,
Logger: log.Log,
PLR: 0.2,
ServerIPAddress: netemx.AddressLargeFileCom1,
ServerPort: 80,
})

env.DPIEngine().AddRule(&netem.DPIThrottleTrafficForTCPEndpoint{
Delay: 300 * time.Millisecond,
Logger: log.Log,
PLR: 0.2,
ServerIPAddress: netemx.AddressLargeFileCom2,
ServerPort: 80,
})

},
ExpectErr: false,
ExpectTestKeys: &testKeys{
DNSConsistency: "consistent",
HTTPExperimentFailure: "generic_timeout_error",
XBlockingFlags: 8, // AnalysisBlockingFlagHTTPBlocking
Accessible: false,
Blocking: "http-failure",
},
}
}

// throttlingWithHTTPS is the case where an HTTPS website has throttling configured for it.
func throttlingWithHTTPS() *TestCase {
return &TestCase{
Name: "throttlingWithHTTPS",
Expand Down

0 comments on commit 0114f0e

Please sign in to comment.