120 likes | 340 Views
Internal Use Only. Marvin - Automation for CloudStack Umesh Kute – SunGard Availability Services. Agenda. What is Marvin? Business use of Marvin Setup Marvin Components Libraries Demo Anatomy of test It can be still be better… Q & A. What is Marvin?. Test framework for CloudStack
E N D
Internal Use Only Marvin - Automation for CloudStackUmesh Kute – SunGard Availability Services
Agenda • What is Marvin? • Business use of Marvin • Setup Marvin • Components • Libraries • Demo • Anatomy of test • It can be still be better… • Q & A
What is Marvin? • Test framework for CloudStack • Python unittest module • 2 Types of test suites (at present): • Smoke test (approximately 35 test suites) • Component test (approximately 80 test suites) • Also used for performance test • Infrastructure in place? • Infrastructure not in place? (simulator, hypervisor plugin) • How it is organized? • Whenever a new feature comes in, we need to ensure that basic sanity tests are in place.
Business Use of Marvin (Why/Where to use Marvin) • Smoke test and regression test • Build verification testing (integrated with jenkins) • SunGard Public Cloud (lab certification)
Setup Marvin • Build • mvn -P developer -pl :cloud-marvin • Install • pip install tools/marvin/dist/Marvin-0.1.0.tar.gz • Port 8096 is open in cloudstack • Dependencies: • python 2.7 (unittest) • python-paramiko (ssh) • mysql-connector-python (DB) • Nose (test framework to run tests) • should-dsl (asserts) https://cwiki.apache.org/confluence/display/CLOUDSTACK/Marvin+-+Testing+with+Python#Marvin-TestingwithPython-Installation
Directory Structure • /cloudstack/test/integration/smoke • Smoke test suites • /cloudstack/test/integration/component • Integration test suites • /cloudstack/tools/marvin/marvin/cloudstackAPI • Cloudstack API’s which marvin uses • /usr/local/lib/python2.7/site-packages/marvin/integration/lib/common.py • Commonly used functions • CloudStack APIs • /usr/local/lib/python2.7/site-packages/marvin/cloudstackAPI
Components • Deploy • deployDataCenter.py • Test Scripts • test*.py • Test Runner • nose • Logging • python logger (logging)
Libraries • cloudstackTestCase • Provides the tests with apiclient and dbclient using which calls can be made to the API server • integration.lib.base.py • Contains all the resources one can manipulate in cloudstack. E.g. virtualmachine, zones, accounts, VPC, etc. • Modules which has all the cloudstack api defined. E.g. network CRUD • Utils • Common utility/housekeeping/verification function. E.g. random string generator, ssh, cleanup • Common.py • Simple methods that are commonly required for most of the tests. E.g. template – get_template, zone – get_zone
Demo • Test_deploy_vm.py
It can still be better… • Data and test are closely tied up. Duplicated in each test, can go as separate file • On exception, cleanup of resources is not done • Good if you deploy datacenter using Marvin… (Discussion is going on with community)