Skip to content

Commit

Permalink
Integration test using dummy VDAF with agg param (#2769)
Browse files Browse the repository at this point in the history
Enable Janus to run the dummy VDAF from crate `prio` with arbitrary
rounds (by extending the representation of `VdafInstance::Fake`) and
with multiple aggregation parameters chosen by the test.

To that end, this resurrects some functionality previously deleted in
PR #1508, though it remains gated on `#[cfg(test)]`.

This wires up some tests for both time interval and fixed size tasks,
running multiple collections against a single batch with varying
aggregation parameters. However, a few tests are disabled because of
stuff that doesn't work yet:

- creating fixed size aggregation jobs w/ agg param
- using `Vdaf.is_valid` to check whether subsequent collections against a
  single batch are valid

Part of #225
  • Loading branch information
tgeoghegan authored Mar 19, 2024
1 parent 4f70c6d commit 416b303
Show file tree
Hide file tree
Showing 20 changed files with 1,363 additions and 251 deletions.
17 changes: 13 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ k8s-openapi = { version = "0.20.0", features = ["v1_26"] } # keep this version
kube = { version = "0.87.2", default-features = false, features = ["client", "rustls-tls"] }
opentelemetry = { version = "0.22", features = ["metrics"] }
opentelemetry_sdk = { version = "0.22", features = ["metrics"] }
prio = { version = "0.16.1", features = ["multithreaded", "experimental"] }
prio = { version = "0.16.2", features = ["multithreaded", "experimental"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
serde_test = "1.0.175"
Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ impl<C: Clock> TaskAggregator<C> {
}

#[cfg(feature = "test-util")]
VdafInstance::Fake => VdafOps::Fake(Arc::new(dummy::Vdaf::new(1))),
VdafInstance::Fake { rounds } => VdafOps::Fake(Arc::new(dummy::Vdaf::new(*rounds))),

#[cfg(feature = "test-util")]
VdafInstance::FakeFailsPrepInit => VdafOps::Fake(Arc::new(
Expand Down
10 changes: 5 additions & 5 deletions aggregator/src/aggregator/aggregate_init_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub(super) struct AggregationJobInitTestCase<
pub(super) async fn setup_aggregate_init_test() -> AggregationJobInitTestCase<0, dummy::Vdaf> {
setup_aggregate_init_test_for_vdaf(
dummy::Vdaf::new(1),
VdafInstance::Fake,
VdafInstance::Fake { rounds: 1 },
dummy::AggregationParam(0),
0,
)
Expand Down Expand Up @@ -324,7 +324,7 @@ pub(crate) async fn put_aggregation_job(
async fn aggregation_job_init_authorization_dap_auth_token() {
let test_case = setup_aggregate_init_test_without_sending_request(
dummy::Vdaf::new(1),
VdafInstance::Fake,
VdafInstance::Fake { rounds: 1 },
dummy::AggregationParam(0),
0,
AuthenticationToken::DapAuth(random()),
Expand Down Expand Up @@ -360,7 +360,7 @@ async fn aggregation_job_init_authorization_dap_auth_token() {
async fn aggregation_job_init_malformed_authorization_header(#[case] header_value: &'static str) {
let test_case = setup_aggregate_init_test_without_sending_request(
dummy::Vdaf::new(1),
VdafInstance::Fake,
VdafInstance::Fake { rounds: 1 },
dummy::AggregationParam(0),
0,
AuthenticationToken::Bearer(random()),
Expand Down Expand Up @@ -395,7 +395,7 @@ async fn aggregation_job_init_malformed_authorization_header(#[case] header_valu
async fn aggregation_job_init_unexpected_taskprov_extension() {
let test_case = setup_aggregate_init_test_without_sending_request(
dummy::Vdaf::new(1),
VdafInstance::Fake,
VdafInstance::Fake { rounds: 1 },
dummy::AggregationParam(0),
0,
random(),
Expand Down Expand Up @@ -541,7 +541,7 @@ async fn aggregation_job_mutation_report_aggregations() {
async fn aggregation_job_intolerable_clock_skew() {
let mut test_case = setup_aggregate_init_test_without_sending_request(
dummy::Vdaf::new(1),
VdafInstance::Fake,
VdafInstance::Fake { rounds: 1 },
dummy::AggregationParam(0),
0,
AuthenticationToken::Bearer(random()),
Expand Down
Loading

0 comments on commit 416b303

Please sign in to comment.