egeberkaygulcan / dstest

2 stars 1 forks source link

DSTest: Generalized Concurrency Testing Tool for Distributed Systems

DSTest is a Controlled Concurrency Testing Framework tool to test distributed systems without modifying the source code of the system under test and is programming language independent.

dstest

Prerequisites

[!NOTE] Code was tested on macOS on arm64 architecture. Other platforms may require additional setup.

Running via Docker (recommended)

You'll need to install Docker.

Generating the image

We are not publishing these at the moment, so you'll need to build the image yourself.

docker build -t egeberkaygulcan/dstest .

This can take a few minutes, as it will download and install all the dependencies for the software and examples.

Running the image

This will run the image with the default configuration for Apache Ratis.

docker run --rm egeberkaygulcan/dstest

Running from source

You'll need to install the Go runtime.

Configuration

A sample configuration file is provided in config.yml. You can copy this file and modify it to suit your needs. Below is a brief explanation of the configuration options:

TestConfig

This section contains the general configuration for the test.

SchedulerConfig

This section contains the configuration for the scheduler: which scheduler to use, and the parameters to pass to the scheduler.

FaultConfig

This section contains the configuration for the fault injector.

NetworkConfig

This section contains the configuration for the network, namely the ports to use for the replicas and their interceptors.

ProcessConfig

This section contains the configuration on how to spawn the processes of the system under test.

Usage

See the configs directory for examples of how to run DSTest with different distributed systems and sample configurations.

Extensibility

For any user who extends a new scheduler to the system, the following Scheduler interface needs to be implemented.

type Scheduler interface {
    Init(config *config.Config)
    Reset()
    Shutdown()
    NextIteration()
    GetClientRequest() int
    Next([]*network.Message, []*faults.Fault, faults.FaultContext) SchedulerDecision
    ApplyFault(*faults.Fault) error
}

The interface requires two main functions for decision-making. When called, Next decides on the next node to be scheduled and the fault to be injected, if any. GetClientRequest chooses when and which client request is sent.

License

See LICENSE.