Stack-In-A-Box-based OpenStack Services for use with Testing Framesworks
Stack-In-A-Box provides the ability to use mocked RESTful APIs naturally inside unit tests by using modules such as HTTPretty or Requests-Mock. OpenStack-In-A-Box provides a series of mocked OpenStack Services inside the Stack-In-A-Box framework, thus providing a reliable mock-up of the OpenStack Services that can be utilized by applications written against them.
Installation is simple:
pip install openstackinaboxEnable Python modules to be unit tested against OpenStack services in an environment controlled by the unit tests.
Provide reliable, accurate mock-ups of the services
Enable unit testing to not have to mock the various tools, e.g KeystoneClient API, to perform their tests.
Support both Positive and Negative testing
Testing should be easy to do:
- you should not necessarily need to know the ins and outs of each service
- you should be able to register what you need (f.e authenticaiton, storage) and have it just work
should be usable on systems like Travis (https://travis-ci.org/)
should be light on requirements
- we do not want to bloat your testing to fit our needs
- if we have many requirements they could interfere with your requirements
The code being unit-tested should not be able to tell the difference of whether it is working with
OpenStack-In-A-Boxor the real thing- there should be nothing special about setting up the test
- if you don't turn on OpenStack-In-A-Box (and
Stack-In-A-Boxupon which it is built) then the code should be able to call the real thing - caveat: the utility tools (f.e httpretty, requests-mock) will determine the URL for the services being provided; see
Stack-In-A-Boxfor details.
This is a natural extension of Stack-In-A-Box to provide OpenStack services to the unit testing being done. If you are using Stack-In-A-Box then it makes sense to also use OpenStack-In-A-Box as it is simply providing a compatible set of OpenStack services that simply need to be registered with Stack-In-A-Box.
Current work is on supporting the OpenStack Keystone v2 services. See the Issues and Milestone for more details.
OpenStack-In-A-Box builds on Stack-In-A-Box. Simply instantiate the desired service and register it with Stack-In-A-Box.
Stack-In-A-Box- https://github.com/TestInABox/stackInABox/OpenStack- https://www.openstack.org/OpenStack Keystone- http://docs.openstack.org/developer/keystone/