aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-testing/src/rt
Commit message (Collapse)AuthorAgeFilesLines
* tor-rtcompat+misc: add `NetStreamProvider::ConnectOptions`Steven Engler2026-06-082-4/+14
| | | | | | | | | This adds the trait type `ConnectOptions` to `NetStreamProvider` and adds this `ConnectOptions` as an argument to `NetStreamProvider::connect()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* tor-rtcompat+misc: add `NetStreamProvider::ListenOptions`Steven Engler2026-05-072-4/+15
| | | | | | | | | This adds the trait type `ListenOptions` to `NetStreamProvider` and adds this `ListenOptions` as an argument to `NetStreamProvider::listen()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* Always use full path to rand::thread_rng().Nick Mathewson2025-03-181-2/+1
| | | | | This is partly for consistency, and partly to facilitate a global search-and-replace.
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle (fmt).Gabriela Moldovan2025-01-151-1/+1
|
* tor-rtcompat: Rename UnsupportedStreamOps to NoOpStreamOpsHandle.Gabriela Moldovan2025-01-151-2/+2
| | | | | This renames UnsupportedStreamOpsHandle to NoOpStreamOpsHandle for clarity (the old name kind of sounded like the name of an error type).
* tor-rtcompat: Implement new_handle() using TcpSockFd (fmt).Gabriela Moldovan2025-01-151-1/+3
|
* tor-rtcompat: Implement new_handle() using TcpSockFd.Gabriela Moldovan2025-01-151-1/+8
|
* tor-rtcompat: Add the ability to get a StreamOps handle.Gabriela Moldovan2025-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Needed for cases where we wrap an object that implements `StreamOps` in an external type, thereby losing access to the `StreamOps` functionality. For example, during the channel handshake, we `.split()` the stream that implements `StreamOps`, which leaves us with a `SplitSink` and a `SplitStream`, neither of which implement `StreamOps`. Getting a handle to the underlying object that implements `StreamOps` (for example, a file handle) *before* the stream is `.split()` enables us to use `StreamOps` to manipulate the underlying split stream. This commit also introduces a special `UnsupportedStreamOpsHandle`, which is a type that implements `StreamOps`, but always returns an error. This type is meant to simplify error handling and usage, and is meant to be used in cases where `StreamOps` is not supported. TODO: the name of this type is pretty confusing (it's very similar to `UnsupportedStreamOp`, which is an error type), and should probably be renamed to something else (`NoOpStreamOpsHandle`, `BrokenStreamOpsHandle`, `DummyStreamOpsHandle` come to mind...). Note: this changes the `StreamOps` trait to be slightly different from what I originally envisioned in !2660 and #1769
* tor-rtcompat: Implement StreamOps for all the stream types.Gabriela Moldovan2024-12-102-2/+17
| | | | Part of #1769
* rtcompat: remove async_trait from NetStreamListener.Nick Mathewson2024-09-242-2/+0
| | | | (The trait no longer has any async methods.)
* Make Runtime require NetStreamProvider<unix::SocketAddr>Nick Mathewson2024-09-241-2/+2
|
* Documentation updates for "NetStreamProvider" renameNick Mathewson2024-09-242-4/+4
| | | | | | Stop referring to TCP streams in its documentation; update other documentation to refer to NetStreamProvider rather than TcpProvider.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-242-17/+17
| | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* rtcompat: Remove accept() from TcpListenerNick Mathewson2024-09-242-19/+0
| | | | | | | | | | It's redundant with the incoming() method (which turns the TcpListener into a Stream of connections), and nothing actually used it outside of tests. Removing this method allows us to simplify our TcpListener code a good deal, as can be seen by some of the implementations we removed from our example and testing code.
* rng ranges: Use gen_range_infallible() for Duration::ZERO..=TIan Jackson2023-07-101-2/+3
|
* rng ranges: Use inclusive Duration ranges in several placesIan Jackson2023-07-071-1/+1
| | | | | | | | | | | | | | Many of these call sites would panic if, somehow, the upper bound was zero. In most cases it is very complicated to see if whether this could happen. However, there is a better answer: Durations are (conceptually) dense, so picking the closed set (which includes its boundary) rather than the open one (which doesn't) will make little practical difference. So change four call sites to use `..=` instead of just `..`.
* arti-testing: Make Action implement CopyNick Mathewson2022-03-101-2/+2
|
* arti-testing: reverse two more attrs in attempt to fix min-versionsNick Mathewson2022-03-071-1/+1
|
* arti-testing: reverse two attrs in attempt to fix min-versionsNick Mathewson2022-03-071-1/+1
|
* arti-testing: support for conditional TCP failure.Nick Mathewson2022-03-071-5/+70
|
* arti-testing: add support for black-holing TCP connections.Nick Mathewson2022-03-071-5/+110
|
* arti-testing: CLI for making TCP connections break.Nick Mathewson2022-03-071-5/+28
|
* arti-testing: Initial support for broken TCP.Nick Mathewson2022-03-071-0/+66
| | | | | | This commit adds support for a BrokenTcp provider that can make connection attempts fail or time out. It doesn't yet have a way to turn on the failure.
* arti-testing: Initial implementationNick Mathewson2022-03-031-0/+199
This commit adds a new program to try to implement the ideas behind experimentation in arti#329. In particular, it tries to implement basic client "can I bootstrap and connect" functionality testing, with a lot of instrumentation, and support for breaking things. So far, the instrumentation is limited to counting TCP bytes and connections, and counting events. Still, this is enough to measure behavior on some of the incorrect-clock tests. NOTE: For now, you are _required_ to pass in an explicit configuration, in hopes that this will lead you to override your storage directories for doing specific experiments.