Giter VIP home page Giter VIP logo

cloud-app-sanity's Introduction

CloudForms Applications Sanity Test Suite

Maintainer: Milan Falešník [email protected]

Documentation: http://mfalesni.github.io/cloud-app-sanity/

Introduction:

Test suite for validating deployed CloudForms applications. It can be also used for validating basically any kind of RHEL system. What can be validated? Current suite validates:

  • filesystem (world-writable files, symlinks, ...)
  • /etc/passwd (whether it contains only correct records for impotant accounts)
  • /etc/inittab validity
  • whether specified services are enabled in specified runlevels
  • SSL key is enough long and does not use weak hashes
  • sshd installed, activ and running
  • /bin/bash and /bin/nologin in /etc/shells
  • RPM packages signed, all files in packages are correct (hashes, symlinks, ...) and all binaries fortified
  • System runs the latest kernel which is installed
  • SElinux enabled and Enforcing
  • and other (.bash_history, GRUB's menu.lst, ...)

Suite is compatible with these systems:

  • RHEL6
  • partially RHEL5 (it's not the main focus to support it, but anything I add into the suite runs also on RHEL5)

If you need some case-specific tuning, folder parametrized is used to store parametrization details which can be loaded using py.test switch --parametrize-file=somefile, which will load paraemtrized/somefile.yaml. If no parameter specified, file default.yaml is loaded.

Contribute!

This suite is not finished yet. If you have any idea which could extend the suite, feel free to fork, extend and make a pull request. Before making any changes, look into the test_* files to catch the basic principles and look also in the folder testsuite/plugins which is used to store system-manipulating functions to raise the level of abstraction.

And I really don't like the ninja comments, so please avoid them. If you see any ninja comment in my code, be sure it will disappear soon.

Writing tests:

This suite is based on py.test testing framework. There are no changes concerning test discovery. There is no need to write import pytest in each test module. There is an object Test available as a builtin. Some things from pytest are imported into it:

pytest.mark -> Test.Mark
pytest.fail -> Test.Fail
pytest.skip -> Test.Skip
pytest.fixture -> Test.Fixture
unittestzero.Assert -> Test.Assert
conftest -> Test.Fixtures

Take the already written tests as a reference.

Writing plugins:

This suite is equipped with a very simple and easy to use plugin system. Plugins are lazily loaded when called as Test.PLUGIN. If you call eg. Test.RPM, the lookup looks for a module RPM_plugin.py in plugins/ folder. If found, it imports it and looks for a varible export, which signifies the object to take as a plugin. Then the plugin is loaded and ready for use. Look in the plugins/ folder as a reference.

To-Do:

  • extend, extend, ...

Prerequisities:

  • python (v2.4+)
  • python-setuptools
  • make - For creating documentation

First two prerequisities are handled with the ./starter.sh script as they are necessary

Usage:

  1. Checkout the git repository
git clone git://github.com/mfalesni/cloud-app-sanity.git

If you don't have git installed, use this command, which will download repository as a tarball and extract it

curl https://raw.github.com/mfalesni/cloud-app-sanity/master/tools/download_suite.sh | bash
  1. Change into the repository directory
cd cloud-app-sanity
  1. To run the suite using virtualenv and stuff, wrapper starter.sh is used. It wraps py.test call and passes all parameters to it.
  2. Drink coffee

With current tests scheme, for example, one can run rpm tests by specifying keywordexpr (-k KEYWORD) as "RPM". Look into tests folder.

cloud-app-sanity's People

Contributors

apagac avatar aweiteka avatar jlaska avatar mfalesni avatar

Watchers

 avatar

cloud-app-sanity's Issues

RHEL5 tests issue

When testing on RHEL5, many tests from internal libraries appear in resulting XML

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.