Git Product home page Git Product logo

cukinia's Introduction

Cukinia firmware validation framework

Cukinia is designed to help Linux-based embedded firmware developers run simple validation tests on their firmware.

Cukinia integrates well with embedded firmware generation frameworks such as Buildroot and Yocto, and can be run manually or by your favourite continuous integration framework.

Project objectives

Cukinia works if it offers the following value:

  • It is very simple to use
  • It requires no dependencies other than busybox
  • It helps developers creating better software

Usage

cukinia [config file]

Screenshot

Screenshot

Basic config

To run Cukinia, create a configuration describing your tests, and invoke it. By default, cukinia reads /etc/cukinia/cukinia.conf. Alternatively, a config file can be passed to cukinia as its argument.

A cukinia config file supports the following statements:

Test statements

  • cukinia_user <username>: Validates that user exists
  • cukinia_process <pname> [user]: Validates that process runs (optional user)
  • cukinia_python_pkg <pkg>: Validates that Python package is installed
  • cukinia_test <expr>: Validates that test(1) expression is true
  • cukinia_http_request <url>: Validates that url returns a 200 code
  • cukinia_cmd <command>: Validates that arbitrary command returns true
  • cukinia_mount <source> <mount point> [options]: Validate the presence of a mount on the system
  • cukinia_symlink <link> <target>: Validate the target of a symlink
  • not: Can prefix any test to invert the issue it will produce
  • verbose: Can prefix any test to preserve stdout/stderr
  • as <string>: Can prefix any test to change its textual description

Utility statements

  • cukinia_conf_include <files>: Includes files as additional config files
  • cukinia_run_dir <directory>: Runs all executables in directory as individual tests
  • cukinia_log <message>: Logs message to stdout

Logging customization

  • logging prefix "string": prefix logs with "string"

Useful variables

  • $cukinia_tests: number of tests attempted
  • $cukinia_failures: number of tests that failed

Example cukinia.conf

# Ensure our basic users are present
cukinia_user appuser1
cukinia_user appuser2

# This should always be the case
cukinia_test -f /etc/passwd

# If this user exists, then something went wrong
not cukinia_user baduser

# Those config snippets are deployed by our packages
cukinia_conf_include /etc/cukinia/conf.d/*.conf

# Is our embedded webservice up?
as "Checking webapp" cukinia_http_request http://localhost:8080/sanitycheck

# Run executable tests for myapp1
cukinia_run_dir /etc/cukinia/myapp1.d/

# Check for root mounting point on / in read write mode
cukinia_mount sysfs /sys rw

# Check the link interfaces point to /tmp/interfaces
cukinia_symlink /etc/network/interfaces /tmp/interfaces

# End
cukinia_log "ran $cukinia_tests tests, $cukinia_failures failures"

More advanced config

A config file is actually a POSIX shell script that is sourced by cukinia, so any logic can be used in a test file scenario. This is useful for example to make certain groups of tests depend on preliminary checks:

if cukinia_test -x /usr/bin/myapp; then
	cukinia_user myuser
	cukinia_process myapp myuser
	cukinia_http_request http://localhost:8080/testme
else
	cukinia_log "$(_colorize red "myapp not found :(")"
fi

License

Cukinia is released under the Apache 2 license. In addition, it is available under the GNU General Public License, version 3.

cukinia's People

Contributors

joufellasfl avatar

Watchers

James Cloos avatar Patrick Keroulas avatar  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.