Skip to main content

A tool to aid in testing the stability of programs

Project description

crashbang

A tool to aid in testing the stability of programs

Crashbang is a tool that allows you to easily run a program through several iterations, speeding up the process of testing a program's stability. It also gathers data about the iterations and can provide statistics about successful exits versus crashes. Data is presented upon test run completion and program output can be saved to a file for later analysis. There are also facilities for limited automated testing.

Crashbang is essentially a beefed up loop. It runs a program through the specified number of iterations and detects what status the program exited with. Non-zero exit status constitutes an error, so those are flagged as failures, while zero is counted as a success. If a timeout is specified and the program doesn't exit before the timeout is reached, crashbang will automatically close the program and the iteration is counted as a success. Crashbang can also detect crashed caused by a signal (e.g. SIGIOT, Segmentation faults, etc.) and will display the recieved signal in the output file.

Usage

Basic usage is to prepend crashbang to the program you want to run. This will run through 10 iterations of the program, waiting for the program to naturally terminate before proceeding to the next one.

crashbang program-name

Adding Arguments

Arguments to pass to the tested program are specified using the -a flag, and must be wrapped in quotation marks.

crashbang program-name -a "--first-argument --second-argument=true"

Options

Iterations

Crashbang supports any number of iterations. Iterations can be set using the -i flag. The default number of iterations is 10.

crashbang program-name -i 100

Timeout

A timeout can also be specified. This is helpful when creating large automated testing runs. With the timeout specified, Crashbang waits for natural program termination up to the specified timeout. If the timeout is reached, the program is stopped and the iteration is counted as a success, then a new iteration is started. If the program exits with 0 prior to the timeout, the iteration is also considered successful. Crashes before the timeout are still treated as failures, and if the program exits for any reason before the timeout is reached, the remainder of the timeout is skipped and the next iteration begins immediately.

Timeouts can be specified in seconds with the '-t' flag:

crashbang program-name -t 10

Output

Upon completion or termination of a test run, Crashbang will display the gathered statistics from the test run, including the program name, the total number of iterations, the number of successful iterations, the number of crashes detected, and the failure percentage.

Crashbang currently handles the KeyboardInterrupt exception to allow it to display statistics for completed iterations if the user uses Ctrl-C to exit the test run early. The output will reflect the total number of completed iterations in addition to the successes and crashes.

Output File

Crashbang also outputs a file with the console output (stdout and stderr) of any failed iterations. It also outputs the iteration number and the exit status ( or signal, if the termination was caused by a signal).

Planned Features

The following features are currently not implemented, but are planned for inclusion:

  • Performance/timing information
  • Status and ETA for completion of a test run
  • Expanded output control
  • Hooks for other automated testing tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Crashbang-0.0.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

Crashbang-0.0.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file Crashbang-0.0.2.tar.gz.

File metadata

  • Download URL: Crashbang-0.0.2.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for Crashbang-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2ac815ee01165acd61cde5a99ce09fc41725b6887e52999a3f14e251968e53ae
MD5 88666715c5c6c81d5dd9c2a732dfecd8
BLAKE2b-256 b96043e545e8a61e9c5c769dd7a1d687b822e57954ab2484d4a2d6c99867650f

See more details on using hashes here.

File details

Details for the file Crashbang-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: Crashbang-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for Crashbang-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f4e62ac8d99d8c84dc30f766b4f094c710b3d4971c7cdb780b43be4a16a82c7
MD5 e1d126db45815a34df6bd8ce082a9cb4
BLAKE2b-256 2b34a78a12df236a3789d7b866dc1e170df48355c170d5790d2a667dcaa42371

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page