refactor: introduce and use InputOrStaticDefault (#632)

This commit introduces a new `InputLoader` policy by which, if no
input is provided, we use a static default input list.

We also modify the code to use this policy for dnscheck and
stunreachability, with proper input.

We also modify `miniooni` to pass the new `ExperimentName` field to
the `InputLoader` to indicate which default input list to use.

This diff is part of a set of diffs aiming at fixing
https://github.com/ooni/probe/issues/1814 and has been
extracted from https://github.com/ooni/probe-cli/pull/539.

What remains to be done, after this diff has landed is to ensure
things also work for ooniprobe and oonimkall.
This commit is contained in:
Simone Basso 2021-12-03 15:30:56 +01:00 committed by GitHub
commit 2044b78a5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 296 additions and 6 deletions

View file

@ -49,7 +49,7 @@ var experimentsByName = map[string]func(*Session) *ExperimentBuilder{
))
},
config: &dnscheck.Config{},
inputPolicy: InputStrictlyRequired,
inputPolicy: InputOrStaticDefault,
}
},
@ -198,7 +198,7 @@ var experimentsByName = map[string]func(*Session) *ExperimentBuilder{
))
},
config: &stunreachability.Config{},
inputPolicy: InputStrictlyRequired,
inputPolicy: InputOrStaticDefault,
}
},