OpenStack Tempest tests class hierarchy

5

Click here to load reader

Transcript of OpenStack Tempest tests class hierarchy

  • 1. Tempest tests inheritance hierarchy BaseDeps BaseTestCase tempest.test tempest.test OfficialClientTesttempest.scenario.manager NetworkScenarioTesttempest.scenario.manager TestNetworkBasicOpstempest.scenario.manager All Tempest tests inherit from these classes BaseNetworkTest NetworksTestJSON NetworksTestXML tempest.api.network. base tempest.api.network. test_networks tempest.api.network. test_networks

2. tempest.test.BaseDeps BaseDeps Responsibilities -- Inherit all the assert and matcher methods of testtools.TestCase Inherit the attributes functionality from testtools.testcase.WithAttributes -- Inherit the resources management functionality of testresources.ResourcedTestCase TestCase WithAttributes ResourcedTestCase tempest.test testtools testtools.testcasetesttools.testcase testresources 3. tempest.test.BaseTestCase BaseTestCase SetUpClassCalled : Boolean Responsibilities -- Insure test cases call their super's setUpClass and tearDownClass methods Set up test case time out Set up handling of stdout, stderr and log capture -- Provide get_client_manager method for api tests to get credentials and Tempest clients SetUpClass TearDownClass get_client_manager setUp 4. tempest.api.network.base BaseNetworkTest network_client networks subnets other lists to keep track of resources created Responsibilities - Get Tempest network client by calling get_client_manager in parent class - Keep track of resources created during setup - Delete resources during tear down - Provide utility methods to create resources SetUpClass tearDownClass create_network create_subnet other class methods to create test resources 1 1 IsolatedCreds NetworkClientJSON 1 1 tempest.common.isolated_creds tempest.services. network.json. network_client BaseTestCase isolated_creds tempest.test NetworkClientXML NetworkClientBase tempest.services.network tempest.services. network.xml. network_client 5. tempest.scenario.manager.OfficialClientTest OfficialClientTest isolated_creds manager compute_client other clients network_client resource_keys os_resources Responsibilities - Get a set of credentials - Get official service clients - Keep track of resources created and delete them in reverse order at end of execution - Provide utility methods for the creation of resources like servers, volumes, security groups, images, etc. SetUpClass credentials alt_credentials admin_credentials tearDownClass set_resource get_resource remove_resource 1 1 IsolatedCreds 1 1 OfficialClientManager Client Client 1 1 1 1 1 1 1 1 tempest.common.isolated_creds tempest.scenario. manager novaclient.client neutronclient.v2.0.client