Giter Club home page Giter Club logo

kibosh's Introduction

Kibosh

Kibosh is a fault-injecting filesystem for Linux.

Kibosh acts as a pass-through layer on top of existing filesystems. Usually, it simply forwards each request on to the underlying filesystems, but it can be configured to inject arbitrary faults.

Environment

Kibosh runs on Linux. We do not currently support Mac or Windows.

If running in a container environment, the container needs to be run with additional options giving Kibosh access to FUSE.

--cap-add SYS_ADMIN     # this allows Kibosh to mount a FUSE filesystem
--device /dev/fuse      # this exposes Kibosh to the FUSE device

Alternatively, the container can be run with --privileged flag which grants Kibosh all the permissions it needs.

$ docker run --privileged -ti ubuntu /bin/bash

Build Requirements

In order to build Kibosh, you must have the CMake build system installed, and a C compiler. We also depend on the development libraries for FUSE. Pkg-config is used by configure script to gather paths of required libraries.

In Ubuntu, run apt-get install cmake libfuse-dev fuse pkg-config to install the dependencies.

Building

It is recommended to build in a separate directory from the source directory.

$ mkdir build
$ cd build
$ ../configure
$ make

To run the tests for Kibosh, type:

$ make test

Running

To run Kibosh, you supply a mirror directory as the mount point as the first argument, and a target directory which you would like to mirror as the second argument.

$ ./kibosh <mirror_dir> --target <target_dir>

Here is an example to run Kibosh with more options:

$ ./kibosh --target /mnt/kibosh/target --pidfile /mnt/kibosh/log/pidfile --log /mnt/kibosh/log/kibosh.log /mnt/kibosh/mirror

For more usage information, try:

$ ./kibosh -h

Injecting Faults

Faults are injected by writing JSON to the control file. The control file is a virtual file which does not appear in directory listings, but which is used to control the filesystem behavior.

Example:

# Mount the filesystem.
$ ./kibosh /kibosh_mnt --target /mnt

# Verify that there are no faults set, this shows current fault JSON.
$ cat /kibosh_mnt/kibosh_control
{"faults":[]}

# Inject new faults:
# add unreadable fault
$ echo '{"faults":[{"type":"unreadable", "prefix":"", "suffix":"", "code":5}]}' > /kibosh_mnt/kibosh_control

# add unwritable fault
$ echo '{"faults":[{"type":"unwritable", "prefix":"", "suffix":"", "code":5}]}' > /kibosh_mnt/kibosh_control

# add read_delay fault
$ echo '{"faults":[{"type":"read_delay", "prefix":"", "suffix":"", "delay_ms":1000, "fraction":1.0}]}' > /kibosh_mnt/kibosh_control

# add write_delay fault
$ echo '{"faults":[{"type":"write_delay", "prefix":"", "suffix":"", "delay_ms":1000, "fraction":1.0}]}' > /kibosh_mnt/kibosh_control

# add read_corrupt fault
$ echo '{"faults":[{"type":"read_corrupt", "prefix":"", "suffix":"", "mode":1000, "fraction":0.5, "count":-1}]}' > /kibosh_mnt/kibosh_control

# add write_corrupt fault
$ echo '{"faults":[{"type":"write_corrupt", "prefix":"", "suffix":"", "mode":1000, "fraction":0.5, "count":-1}]}' > /kibosh_mnt/kibosh_control

# Remove all faults.
$ echo '{"faults":[]}' > /kibosh_mnt/kibosh_control

Unmount Kibosh

# fuse needs to be installed, use sudo if necessary.
$ fusermount -u <mirror_dir>

License

Kibosh is licensed under the Apache 2.0 license. See LICENSE for details.

Contact

Colin McCabe [email protected]

kibosh's People

Contributors

cmccabe avatar yyu1993 avatar

Stargazers

 avatar hudeqi avatar DMessham avatar Adam Yi avatar Ilya Shishkov avatar Aaron Fabbri avatar Camilo Aguilar avatar Burak Sezer avatar Oktavianus Ginting avatar Matt Davis avatar Antony Stubbs avatar Ripta Pasay avatar

Watchers

Nicholas Valler avatar Cody A. Ray avatar Joe Moser avatar Daniel Green avatar Jay Kreps avatar Stefan Sprenger avatar Jun Rao avatar Alex Bleasdale avatar Rob Benson avatar Bill Bejeck avatar Neha Narkhede avatar Kowshik Prakasam avatar Rajesh RC avatar Nikko Bautista avatar Nate avatar David Moravek avatar Jon Vines avatar Derek Nelson avatar Elijah Meeks avatar Stefano Linguerri avatar Daniel PETISME avatar Rob Szkutak avatar Tobias Hintze avatar rafael oltra avatar Xavier Léauté avatar Stuart Holland avatar Sarguru Nathan avatar James Cloos avatar Rajat Agarwal avatar Sunil Kumar Behera avatar Juan Pablo Mansor avatar Roberto Molinari avatar  avatar Lukas Drbal avatar Harish Vishwanath avatar Ismail Mayat avatar  avatar Alex Stuart  avatar Mehmet Tatlicioglu avatar Moamen Hmad avatar James Hughes avatar Akhilesh Chaganti avatar Luke Knepper avatar Zama Khan Mohammed avatar Nitin Gupta avatar dan norwood avatar Emanuele Sabellico avatar Tomasz Nguyen avatar Yang Lei avatar Matt C. avatar Jeff Evans avatar Thomas Kim avatar Ratish Ravindran avatar Maria Berinde-Tampanariu avatar Adi Wabisabi avatar Luiz Roma avatar Mukul Kumar Singh avatar Alex Gonzalez avatar Nick Dearden avatar Michael Yu avatar Jack Vanlightly avatar Elena Cuevas avatar Yifeng Huang avatar Pradeep Reddy avatar Anna Povzner avatar  avatar Shaunak Shatmanyu avatar  avatar Lisa Mounteer avatar Kyle Moynihan avatar  avatar David Araujo avatar Michael Peacock avatar Mark Satterlee avatar Robert Stucke avatar Derek Li avatar Ron Dagostino avatar Abhinav Agarwal avatar Marc Selwan avatar Asier Fernández avatar Luca Filipponi avatar  avatar Jing Liu avatar Fabian Paul avatar Magesh Nandakumar avatar Frank Lu avatar Marcelo Colomer avatar Chaitanya Mukka avatar Robert Wittman avatar Andreas Berlinger avatar Olivia avatar Emily Yu avatar Drew Taylor avatar Harini Rajendran avatar Junhee Shin avatar Daniel Gospodinow avatar Vijay Girish avatar Patrick Brilino avatar Senad Jukic avatar Ayush Tomar avatar

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.