Skip to content

Commit

Permalink
feat(minipipeline): add ControlFinalResponseExpectations (2/2) (#1452)
Browse files Browse the repository at this point in the history
This diff completes the work started by #1451 by adding support for
ControlFinalResponseExpectations to the analysis data structures, which
will enable us to use this information for Web Connectivity LTE.

Part of ooni/probe#2640.
  • Loading branch information
bassosimone committed Jan 19, 2024
1 parent 0e44897 commit 64255d5
Show file tree
Hide file tree
Showing 69 changed files with 204 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/cmd/minipipeline/testdata/analysis.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/minipipeline/testdata/analysis_classic.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
9 changes: 8 additions & 1 deletion internal/minipipeline/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func NewLinearWebAnalysis(input *WebObservationsContainer) (output []*WebObserva
// AnalyzeWebObservationsWithoutLinearAnalysis generates a [*WebAnalysis] from a [*WebObservationsContainer]
// but avoids calling [NewLinearyAnalysis] to generate a linear analysis.
func AnalyzeWebObservationsWithoutLinearAnalysis(container *WebObservationsContainer) *WebAnalysis {
analysis := &WebAnalysis{}
analysis := &WebAnalysis{
ControlFinalResponseExpectations: container.ControlFinalResponseExpectations,
}

analysis.dnsComputeSuccessMetrics(container)
analysis.dnsComputeSuccessMetricsClassic(container)
Expand All @@ -121,6 +123,11 @@ func AnalyzeWebObservationsWithLinearAnalysis(container *WebObservationsContaine
//
// The zero value of this struct is ready to use.
type WebAnalysis struct {
// ControlFinalResponseExpectations summarizes the expectations we have
// for the control based on the final response. You should use this field
// to determine whether unexplained failures are expected or unexpected.
ControlFinalResponseExpectations optional.Value[*WebObservationsControlFinalResponseExpectation]

// DNSLookupSuccessWithInvalidAddresses contains DNS transactions with invalid IP addresses by
// taking into account control info, bogons, and TLS handshakes.
DNSLookupSuccessWithInvalidAddresses Set[int64]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": "unknown_error"
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": "unknown_error"
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": "unknown_error"
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": "unknown_error"
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
1,
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
2
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": "unknown_error"
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": "unknown_error"
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"ControlFinalResponseExpectations": null,
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"ControlFinalResponseExpectations": null,
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"ControlFinalResponseExpectations": null,
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"ControlFinalResponseExpectations": null,
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [],
"DNSLookupSuccessWithBogonAddresses": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [],
"DNSLookupSuccessWithBogonAddresses": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
1
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
1
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [],
"DNSLookupSuccessWithBogonAddresses": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
1
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
1
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
2
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
1
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [
2
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ControlFinalResponseExpectations": {
"Failure": ""
},
"DNSLookupSuccessWithInvalidAddresses": [],
"DNSLookupSuccessWithValidAddress": [
1
Expand Down
Loading

0 comments on commit 64255d5

Please sign in to comment.