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(netemx): create "internet" netem-based emulation (ooni#1205)
This diff introduces code to emulate a large-scale scenario with several servers. This scenario is suitable for writing Web Connectivity integration tests because it includes a test helper, the OONI API, a GeoIP service, etc. This work derives from ooni#1185 and is part of ooni/probe#2461. --------- Co-authored-by: kelmenhorst <k.elmenhorst@mailbox.org>
- Loading branch information
1 parent
6b99d2a
commit 94a55df
Showing
19 changed files
with
448 additions
and
44 deletions.
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
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
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
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
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
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
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
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
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
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,20 @@ | ||
package netemx | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/ooni/netem" | ||
"github.com/ooni/probe-cli/v3/internal/testingx" | ||
) | ||
|
||
// DNSOverHTTPSHandlerFactory is a [QAEnvHTTPHandlerFactory] for [testingx.GeoIPHandlerUbuntu]. | ||
type DNSOverHTTPSHandlerFactory struct { | ||
Config *netem.DNSConfig | ||
} | ||
|
||
var _ QAEnvHTTPHandlerFactory = &DNSOverHTTPSHandlerFactory{} | ||
|
||
// NewHandler implements QAEnvHTTPHandlerFactory. | ||
func (f *DNSOverHTTPSHandlerFactory) NewHandler(unet netem.UnderlyingNetwork) http.Handler { | ||
return &testingx.DNSOverHTTPSHandler{Config: f.Config} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
// Package netemx contains ooni/netem adapters. This code could have been part | ||
// of the [netxlite] package, but we keep it separate such that you do not link | ||
// with [netem] unless you need to use [netem] (presumably for testing). | ||
// Package netemx contains code to run integration tests using netem. | ||
package netemx |
Oops, something went wrong.