Giter Site home page Giter Site logo

mt-fs-tests's Introduction

MT-FS-TESTS

MT-FS-TESTS, initially for Multi-Threaded FileSystem Tests, is a light framework for writing multi-threaded test suites.

It has been developed for internal use at Nuage Labs in order to check the reliability of one of our products against race conditions at the filesystem level, but the framework has been designed to be more flexible than that.

By default, all suites are executed for 1 run of 500 threads, using the current working directory to create test files:

Usage: mt-fs-tests [<nb threads> [<nb runs> [<selected suite>]]]

Existing test suites

  • file_create_suite: test for race in file creation using O_CREAT|O_EXCL
  • file_removal_suite: idem with file removal
  • file_rename_suite: idem with file renaming
  • directory_create_suite: directory creation
  • directory_removal_suite: directory removal
  • open_during_create_suite: test that threads either get ENOENT or 0 while trying to open a file during its creation
  • bonnie64_suite: replicate some tests done by the bonnie64 tool

Writing new suites

In order to write a new suite, you need to create a new .c file in the src/suites directory, exporting a test_suite struct named test_suite_ with the corresponding functions:

  • test_suite_init: called before running the suite, so before threads are started, and returns suite data in test_suite_data
  • test_suite_thread_run: this function is called by each thread, once for each run
  • test_suite_post_run: this function is called after the run has been completed
  • test_suite_deinit this function is called at the end, and is expected to free any resource allocated by test_suite_init

The new suite should then be added to src/suites/suites.itm, and the program rebuilt.

Compilation

MT-FS-TESTS build is based on cmake, and requires libpthread.

To build in debug mode, you can simply do:

mkdir build && cd build && cmake ../src && make

In order to do a release build:

mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ../src/ && make

This builds the mt-fs-tests binary into the bin/ folder.

mt-fs-tests's People

Contributors

rgacogne avatar

Watchers

 avatar  avatar  avatar

Forkers

murlock

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.