Skip to content

Implement a directory munger to simulate pathological cases in arti-testing

Nick Mathewson requested to merge nickm/arti:dir-munger into main

In arti-testing we want to simulate all kinds of failures. This branch lets us simulate cases where the directory fails to describe the network, where the servers giving us the directory give us something bogus, or where we the network described by the directory doesn't support opertations that we need.

I already did the first step of this work in !431 (merged), which introduced an feature-gated DirFilter mechanism to replace directory documents before they get used.

The next two phases are in this branch. First, I had to add a bunch of accessor and constructor functions to tor-netdoc and tor-checkable to expose previously inaccessable information, and to construct objects that previously could only be built from inside the netdoc crate.

(This part above will be the part that gets the most scrutiny, since it affects our main code. Most of the new functions are behind unstable feature flags (experimental-api, build_docs), but there are a few that I left as new public functions (mostly because they seemed like desirable general-purpose APIs).)

Finally, I added a set of filters to arti-testing that can be added along with the other error conditions that we can induce and operations we can try to do.

Closes #397 (closed).

Edited by Nick Mathewson

Merge request reports