-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(webconnectivitylte): handle measurements with loopback addrs #1462
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
310b135
feat(webconnectivityqa): better 127.0.0.1 testing
bassosimone e282418
chore: changes to minipipeline test suite
bassosimone 6c7d0c5
Merge branch 'master' into issue/1517
bassosimone eb330a8
Merge branch 'master' into issue/1517
bassosimone 38f1953
Merge branch 'master' into issue/1517
bassosimone ccd117d
Merge branch 'master' into issue/1517
bassosimone d909ffd
Apply suggestions from code review
bassosimone 0699a0b
x
bassosimone 625098e
report correct result when there is loopback
bassosimone d092375
correct result with loopback specific censorship
bassosimone 39858dd
x
bassosimone d403790
x
bassosimone 2120f47
Apply suggestions from code review
bassosimone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package webconnectivityqa | ||
|
||
import "github.com/ooni/probe-cli/v3/internal/netemx" | ||
|
||
// localhostWithHTTP is the case where the website DNS is misconfigured and returns a loopback address. | ||
func localhostWithHTTP() *TestCase { | ||
return &TestCase{ | ||
Name: "localhostWithHTTP", | ||
Flags: TestCaseFlagNoV04, | ||
Input: "http://www.example.com/", | ||
Configure: func(env *netemx.QAEnv) { | ||
|
||
// make sure all resolvers think the correct answer is localhost | ||
env.ISPResolverConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
env.OtherResolversConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
|
||
}, | ||
ExpectErr: false, | ||
ExpectTestKeys: &testKeys{ | ||
DNSConsistency: "consistent", | ||
XDNSFlags: 1, // AnalysisFlagDNSBogon | ||
Accessible: false, | ||
Blocking: false, | ||
}, | ||
} | ||
} | ||
|
||
// localhostWithHTTPS is the case where the website DNS is misconfigured and returns a loopback address. | ||
func localhostWithHTTPS() *TestCase { | ||
return &TestCase{ | ||
Name: "localhostWithHTTPS", | ||
Flags: TestCaseFlagNoV04, | ||
Input: "https://www.example.com/", | ||
Configure: func(env *netemx.QAEnv) { | ||
|
||
// make sure all resolvers think the correct answer is localhost | ||
env.ISPResolverConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
env.OtherResolversConfig().AddRecord("www.example.com", "", "127.0.0.1") | ||
|
||
}, | ||
ExpectErr: false, | ||
ExpectTestKeys: &testKeys{ | ||
DNSConsistency: "consistent", | ||
XDNSFlags: 1, // AnalysisFlagDNSBogon | ||
Accessible: false, | ||
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
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 |
---|---|---|
|
@@ -74,12 +74,12 @@ func (sx *Set[T]) UnmarshalJSON(data []byte) error { | |
} | ||
|
||
// Contains returns whether the set contains a key. | ||
func (sx *Set[T]) Contains(key T) bool { | ||
func (sx Set[T]) Contains(key T) bool { | ||
_, found := sx.state[key] | ||
return found | ||
} | ||
|
||
// String implements fmt.Stringer | ||
func (sx *Set[T]) String() string { | ||
func (sx Set[T]) String() string { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to use pointer receiver here |
||
return fmt.Sprintf("%v", sx.Keys()) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use pointer receiver here