Module test_framework

Module test_framework 

Source
Available on (32-bit or 64-bit) and (crate features test-utils) only.
Expand description

This crate provides a framework to set up clients and groups using the OpenMLS mls_group API. To use the framework, start by creating a new TestSetup with a number of clients. After that, create_clients has to be called before the the TestSetup can be used.

Note that due to lifetime issues, no new clients can be created after initialization.

After initialization, the TestSetup enables the creation of groups using create_group, which simply creates a one-member group, or create_random_group, which creates a group of the given size with random clients.

Existing groups are represented by the groups field of the TestSetup and initial members can be instructed to either propose or commit adds, removes or updates via the corresponding functions of TestSetup. Note, that these functions require a &Group reference, which can be obtained via the groups field. When using these functions, the TestSetup fills the role of the DS and automatically distributes the required KeyPackages and resulting mls messages to the individual clients. Alternatively, the clients can be manipulated manually via the Client struct, which contains their group states.

Modules§

client
This module provides the Client datastructure, which contains the state associated with a client in the context of MLS, along with functions to have that client perform certain MLS operations.
errors

Structs§

Group
The Group struct represents the “global” shared state of the group. Note, that this state is only consistent if operations are conducted as per spec and messages are distributed correctly to all clients via the distribute_to_members function of TestSetup, which also updates the public_tree field.
MlsGroupTestSetup
MlsGroupTestSetup is the main struct of the framework. It contains the state of all clients. The waiting_for_welcome field acts as a temporary store for KeyPackages that are used to add new members to groups. Note, that the MlsGroupTestSetup can only be initialized with a fixed number of clients and that create_clients has to be called before it can be otherwise used.

Enums§

ActionType
CodecUse

Functions§

noop_authentication_service