Skip to content
Jonas Libbrecht edited this page Mar 4, 2016 · 14 revisions

Introduction

This repository contains all there is to know about the automated tests The tests rely on the python nose framework and thus all testsuites, testfiles, testmodules, testclasses and testcases must be compliant to the definition nose relies on.


The integration tests can be installed like this:

  • Ubuntu: apt-get install openvstorage-test
  • CentOS:

Structure

The topdirectories within this repo are CI, CINDERCI, PACKAGING and SCRIPTS

  • Ci The ci directory contains all logic regarding the autotests itself, it consists out of 4 subdirectories: config, lib, scripts, tests
    • Config: Configuration files used by the integrationtests
    • Setup Lib: (Generic) libraries for setup, which on their turn consist out of 3 subdirectories: backend (Ceph, Swift, ALBa, ...), framework (vDisk, vMachine, vPool,...), store (Arakoon, Memcache, Pyrakoon, ...)
    • Validation Lib: (Generic) libraries for validation of setup, which on their turn consist out of 3 subdirectories: backend (Ceph, Swift, ALBa, ...), framework (vDisk, vMachine, vPool,...), store (Arakoon, Memcache, Pyrakoon, ...)
    • Scripts: Scripts used mainly to commit testresults to TestRail
    • Tests: The testsuites itself
  • Cinderci The cinderci directory contais logic regarding devstack tests and deployment (Deprecated)
  • Packaging The packaging directory contains logic to create the openvstorage-test package
  • Scripts The scripts directory contains logic to deploy environments using Jenkins

Usage

To be able to use the integrationtests, the pythonpath must first be updated. This can be done like so:
source /etc/profile.d/ovs.sh
Then an ipython shell must be opened and the integrationtests must be imported
ipython from ci import autotests

Listing tests

autotests.list_tests()
Example output of above command:

In [2]: autotests.list_tests() nose.config: INFO: Ignoring files matching ['^\.', '^_', '^setup\.py$'] ci.tests.api.extended_test.TestExtended.post_reboot_checks_test ... ok ci.tests.arakoon.extend_promote_demote_test.TestArakoon.ar_0001_validate_create_extend_shrink_delete_cluster_test ... ok ci.tests.arakoon.extend_promote_demote_test.TestArakoon.ar_0002_arakoon_cluster_validation_test ... ok ci.tests.arakoon.extend_promote_demote_test.TestArakoon.ovs_3554_4_node_cluster_config_validation_test ... ok ci.tests.backend.test_alba.TestALBA.be_0001_add_and_verify_backend_is_running_test ... ok ci.tests.backend.test_alba.TestALBA.be_0002_add_remove_preset_no_compression_no_encryption_test ... ok ci.tests.backend.test_alba.TestALBA.be_0003_add_remove_preset_compression_no_encryption_test ... ok ci.tests.backend.test_alba.TestALBA.be_0004_validate_preset_with_replication_copies_test ... ok ci.tests.backend.test_alba.TestALBA.be_0005_add_remove_preset_no_compression_encryption_test ... ok ci.tests.backend.test_alba.TestALBA.be_0006_add_remove_preset_compression_encryption_test ... ok ci.tests.backend.test_alba.TestALBA.be_0007_add_update_remove_preset_test ... ok ci.tests.backend.test_alba.TestALBA.ovs_3490_add_remove_preset_test ... ok ci.tests.backend.test_alba.TestALBA.ovs_3769_validation_test ... ok

Run tests

To run a test, simply copy/paste a testcase from above output and run it
autotests.run('ci.tests.backend.test_alba.TestALBA.ovs_3490_add_remove_preset_test')
Its also possible to run entire testclasses, testmodules or testsuites by just copy/pasting up until the desired depth
autotests.run('ci.tests.backend.test_alba.TestALBA')
autotests.run('ci.tests.backend.test_alba')
autotests.run('ci.tests.backend')

Clone this wiki locally