<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.openstack.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ridave</id>
		<title>OpenStack - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.openstack.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ridave"/>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/wiki/Special:Contributions/Ridave"/>
		<updated>2026-07-03T11:35:35Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.2</generator>

	<entry>
		<id>https://wiki.openstack.org/w/index.php?title=Manila/docs/HOWTO_use_tempest_with_manila&amp;diff=159158</id>
		<title>Manila/docs/HOWTO use tempest with manila</title>
		<link rel="alternate" type="text/html" href="https://wiki.openstack.org/w/index.php?title=Manila/docs/HOWTO_use_tempest_with_manila&amp;diff=159158"/>
				<updated>2018-01-24T09:50:29Z</updated>
		
		<summary type="html">&lt;p&gt;Ridave: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''WARNING: Information on this page may be obsolete due to changes in tempest and manila_tempest_tests. Refer to the developer documentation here instead: https://docs.openstack.org/manila/ocata/devref/tempest_tests.html'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Foreword=&lt;br /&gt;
This page describes how Tempest project for Manila project testing can be used.&lt;br /&gt;
&lt;br /&gt;
It is assumed that user who reads this is acquainted with, at least, common information about Tempest:&lt;br /&gt;
 http://docs.openstack.org/developer/tempest/&lt;br /&gt;
 https://github.com/openstack/tempest&lt;br /&gt;
&lt;br /&gt;
Since Liberty release Manila is using tempest plugins which are documented here:&lt;br /&gt;
&lt;br /&gt;
 http://docs.openstack.org/developer/tempest/plugin.html&lt;br /&gt;
&lt;br /&gt;
Also, it is assumed, that the following projects has been installed in test environmentː&lt;br /&gt;
 - cinder&lt;br /&gt;
 - glance&lt;br /&gt;
 - keystone&lt;br /&gt;
 - manila&lt;br /&gt;
 - neutron&lt;br /&gt;
 - nova&lt;br /&gt;
&lt;br /&gt;
=Where do Tempest tests for Manila live?=&lt;br /&gt;
Manila stores its tests for Tempest in its repo here:&lt;br /&gt;
 https://github.com/openstack/manila/tree/master/manila_tempest_tests&lt;br /&gt;
&lt;br /&gt;
Since Manila is using the Tempest plugin mechanism all test are automatically registered by running setup.py.&lt;br /&gt;
In case devstack is used it is fully sufficient to just enable the Manila devstack plugin.&lt;br /&gt;
&lt;br /&gt;
You can list all Manila tests by browsing to the Tempest source directory and execute the following command:&lt;br /&gt;
&lt;br /&gt;
  testr list-tests | grep manila_tempest_tests&lt;br /&gt;
&lt;br /&gt;
To see if the plugin is registered correclty you can run:&lt;br /&gt;
&lt;br /&gt;
  echo 'import pkg_resources; print list(pkg_resources.iter_entry_points(&amp;quot;tempest.test_plugins&amp;quot;))' | python&lt;br /&gt;
&lt;br /&gt;
=Configuring Tempest before running tests=&lt;br /&gt;
Any test running with Tempest requires update of Tempest's config file located in&lt;br /&gt;
 etc/tempest.conf&lt;br /&gt;
&lt;br /&gt;
If the tempest plugin is installed you can use the following command to generate all config options:&lt;br /&gt;
 oslo-config-generator --config-file tools/config/config-generator.tempest.conf&lt;br /&gt;
&lt;br /&gt;
Just copy template &amp;quot;tempest.conf.sample&amp;quot; and configure the needed options:&lt;br /&gt;
 cp tempest.conf.sample tempest.conf&lt;br /&gt;
&lt;br /&gt;
Subsections below describe sections and options that can be updated with Tempest's config file.&lt;br /&gt;
&lt;br /&gt;
==Cluster related options in general==&lt;br /&gt;
Required options for Manila tests are described below.&lt;br /&gt;
&lt;br /&gt;
===Section &amp;quot;cli&amp;quot;===&lt;br /&gt;
====Option &amp;quot;enabled&amp;quot;====&lt;br /&gt;
Set it to &lt;br /&gt;
 True&lt;br /&gt;
value, to be able to run Manila cli tests.&lt;br /&gt;
&lt;br /&gt;
===Section &amp;quot;identity&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;uri&amp;quot;====&lt;br /&gt;
If using localhost it should look likeː&lt;br /&gt;
 http://127.0.0.1:5000/v2.0/&lt;br /&gt;
Used for all tests, if v2 auth enabled.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;uri_v3&amp;quot;====&lt;br /&gt;
If using localhost it should look likeː&lt;br /&gt;
 http://127.0.0.1:5000/v3/&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;username&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 demo&lt;br /&gt;
====Option &amp;quot;password&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 secrete&lt;br /&gt;
Password can be redefined, just put here password from 'demo' user.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;tenant_name&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 demo&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;alt_username&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 alt_demo&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;alt_password&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 secrete&lt;br /&gt;
Password can be redefined, just put here password from 'alt_demo' user.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;alt_tenant_name&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 alt_demo&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;admin_username&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 admin&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;admin_password&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 secrete&lt;br /&gt;
Password can be redefined, just put here password from 'admin' user.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;admin_tenant_name&amp;quot;====&lt;br /&gt;
If using devstack installation it should have the following valueː&lt;br /&gt;
 admin&lt;br /&gt;
&lt;br /&gt;
===Section &amp;quot;network&amp;quot;===&lt;br /&gt;
====Option &amp;quot;public_network_id&amp;quot;====&lt;br /&gt;
This option is used for creation of isolated tenants. Its value can be retrieved from:&lt;br /&gt;
 $ neutron net-list&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;public_router_id&amp;quot;====&lt;br /&gt;
This option is used for creation of isolated tenants. Its value can be retrieved from:&lt;br /&gt;
 $ neutron router-list&lt;br /&gt;
&lt;br /&gt;
==Manila related options==&lt;br /&gt;
&lt;br /&gt;
===Section &amp;quot;service_available&amp;quot;===&lt;br /&gt;
This section is defined within vanila Tempest. But &amp;quot;manila&amp;quot; option is defined within Manila's extension.&lt;br /&gt;
====Option &amp;quot;manila&amp;quot;====&lt;br /&gt;
 typeː boolean&lt;br /&gt;
 default valueː True&lt;br /&gt;
 descriptionː Whether or not manila is expected to be available&lt;br /&gt;
&lt;br /&gt;
===Section &amp;quot;share&amp;quot;===&lt;br /&gt;
This section is defined with Manila's extension.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;catalog_type&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː share&lt;br /&gt;
 descriptionː Catalog type of the Share service. Should be changed only if it is changed in Manila itself.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;endpoint_type&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː publicURL&lt;br /&gt;
 descriptionː The endpoint type to use for the share service. Expected values are 'public', 'admin', 'internal', 'publicURL', 'adminURL' and 'internalURL'.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;multitenancy_enabled&amp;quot;====&lt;br /&gt;
 typeː boolean&lt;br /&gt;
 default valueː True&lt;br /&gt;
 descriptionː This option is used to determine backend driver type, multitenant driver uses share-networks, but single-tenant doesn't.&lt;br /&gt;
&lt;br /&gt;
 Current singletenant drivers: LVM, GlusterFS, NetApp 7-mode&lt;br /&gt;
 Current multitenant drivers: Generic, NetApp Cluster-mode (cmode)&lt;br /&gt;
 Default driver in manila is Generic driver, so &amp;quot;multitenancy_enabled&amp;quot; option is enabled by default.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;enable_protocols&amp;quot;====&lt;br /&gt;
 typeː list&lt;br /&gt;
 default valueː nfs,cifs&lt;br /&gt;
 descriptionː The first value of the list is protocol by default, items of the list show enabled protocols.&lt;br /&gt;
&lt;br /&gt;
 Expected values are:&lt;br /&gt;
 nfs - will be tested only NFS type of shares and common actions&lt;br /&gt;
 cifs - will be tested only CIFS type of shares and common actions&lt;br /&gt;
 nfs,cifs - will be tested both share types and common actions, for common actions will be used nfs protocol&lt;br /&gt;
 cifs,nfs - will be tested both share types and common actions, for common actions will be used cifs protocol&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;enable_ip_rules_for_protocols&amp;quot;====&lt;br /&gt;
 typeː list&lt;br /&gt;
 default valueː nfs,cifs&lt;br /&gt;
 descriptionː Whether allow running of ip rules tests or not, and which share protocols should be used.&lt;br /&gt;
&lt;br /&gt;
 Expected values are:&lt;br /&gt;
 nfs - sid rules will be tested only for nfs protocol&lt;br /&gt;
 cifs - sid rules will be tested only for cifs protocol&lt;br /&gt;
 nfs,cifs - sid rules will be tested with both share protocols&lt;br /&gt;
 cifs,nfs - sid rules will be tested with both share protocols&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;enable_sid_rules_for_protocols&amp;quot;====&lt;br /&gt;
 typeː list&lt;br /&gt;
 default valueː (empty)&lt;br /&gt;
 descriptionː Whether allow running of sid (username/usergroup) rules tests or not, and which share protocols should be used.&lt;br /&gt;
&lt;br /&gt;
 Expected values are:&lt;br /&gt;
 nfs - sid rules will be tested only for nfs protocol&lt;br /&gt;
 cifs - sid rules will be tested only for cifs protocol&lt;br /&gt;
 nfs,cifs - sid rules will be tested with both share protocols&lt;br /&gt;
 cifs,nfs - sid rules will be tested with both share protocols&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;username_for_user_rules&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː Administrator&lt;br /&gt;
 descriptionː What name should be used with user rule tests? Specify it if 'user rule' tests are enabled.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;storage_protocol&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː &amp;quot;&amp;quot; (empty)&lt;br /&gt;
 descriptionː If you want Tempest to use some specific share-network instead of autocreated, specify it. This value is used for member creds.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;share_network_id&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː &amp;quot;&amp;quot; (empty)&lt;br /&gt;
 descriptionː If you want Tempest to use some specific share-network instead of autocreated, specify it. This value is used for member creds.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;alt_share_network_id&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː &amp;quot;&amp;quot; (empty)&lt;br /&gt;
 descriptionː If you want Tempest to use some specific share-network instead of autocreated, specify it. This value is used for alternative member creds. At the moment there are no tests, that use share_network with creds for alternative user.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;admin_share_network_id&amp;quot;====&lt;br /&gt;
 typeː str&lt;br /&gt;
 default valueː &lt;br /&gt;
 descriptionː If you want Tempest to use some specific share-network instead of autocreated, specify it. This value is used for admin creds.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;multi_backend&amp;quot;====&lt;br /&gt;
 typeː boolean&lt;br /&gt;
 default valueː False&lt;br /&gt;
 descriptionː Does your environment has more than 1 backend or not? If yes, than you can set it to True to enable multibackend tests in tempest.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;backend_names&amp;quot;====&lt;br /&gt;
 typeː list&lt;br /&gt;
 default valueː (empty)&lt;br /&gt;
 descriptionː names of backends in Manila, that Tempest should use. Tempest will use first two values from list and will use it only if option &amp;quot;multi_backend&amp;quot; is Enabled.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;build_interval&amp;quot;====&lt;br /&gt;
 typeː int&lt;br /&gt;
 default valueː 3&lt;br /&gt;
 descriptionː time to wait between resend of requests.&lt;br /&gt;
&lt;br /&gt;
====Option &amp;quot;build_timeout&amp;quot;====&lt;br /&gt;
 typeː int&lt;br /&gt;
 default valueː 500&lt;br /&gt;
 descriptionː time to wait until raise of Exception with timeout.&lt;br /&gt;
&lt;br /&gt;
=How to run tests=&lt;br /&gt;
==Run only cli tests==&lt;br /&gt;
 tox -evenv bash tools/pretty_tox.sh \&amp;quot;tempest.cli.*manila*\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Run only api tests==&lt;br /&gt;
 tox -evenv bash tools/pretty_tox.sh \&amp;quot;tempest.api.share*\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Run only api and cli tests==&lt;br /&gt;
 tox -evenv bash tools/pretty_tox.sh \&amp;quot;tempest.api.share* tempest.cli.*manila*\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Run only api and cli tests with specified amount of threads==&lt;br /&gt;
 export TEMPEST_CONCURRENCY=4&lt;br /&gt;
 tox -evenv bash tools/pretty_tox.sh \&amp;quot;tempest.api.share* tempest.cli.*manila* -- --concurrency=$TEMPEST_CONCURRENCY\&amp;quot;&lt;br /&gt;
Above action will try to run Tempest in 4 threads, if your host does have at least 4 cores. By default it uses amount of threads equal to amount of available cores.&lt;br /&gt;
&lt;br /&gt;
Manila tests are OK using concurrent threads.&lt;br /&gt;
&lt;br /&gt;
==If something went wrong with test launch==&lt;br /&gt;
Exception may be raised on step where tests are gathered and parsed and as a result we would see something similar to the followingː&lt;br /&gt;
 running testr&lt;br /&gt;
 Non-zero exit code (2) from test listing. stdout='\xb3)\x01@d@Ytempest.api.share.admin.test_admin_actions.AdminActionsTest.test_force_delete_share[gate]&amp;lt;Z\x90&amp;quot;\xb3)\x01@g@\\&lt;br /&gt;
 ...&lt;br /&gt;
 tempest.scenario.test_volume_boot_pattern6B\x1e\xcc', stderr=None&lt;br /&gt;
 error: testr failed (3)&lt;br /&gt;
 running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \&lt;br /&gt;
 OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \&lt;br /&gt;
 OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \&lt;br /&gt;
 OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \&lt;br /&gt;
 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./tempest/test_discover} --list &lt;br /&gt;
 &lt;br /&gt;
 ======&lt;br /&gt;
 Totals&lt;br /&gt;
 ======&lt;br /&gt;
 Run: 0 in 0.0 sec.&lt;br /&gt;
  - Passed: 0&lt;br /&gt;
  - Skipped: 0&lt;br /&gt;
  - Failed: 0&lt;br /&gt;
 ERROR: InvocationError: '/bin/bash tools/pretty_tox.sh tempest/api/share/test_extensions.py'&lt;br /&gt;
 __________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________&lt;br /&gt;
 ERROR:   venv: commands failed&lt;br /&gt;
&lt;br /&gt;
There could be different causes for that, in most cases - dependency issues, when some dependency is not installed and can not be imported. Or python syntax error, if something were changed in code, etc...&lt;br /&gt;
&lt;br /&gt;
As we can see, it does not show us real problem and we need dig root cause up. It can be done by a lot of means, for example, try nextː&lt;br /&gt;
 nosetests -sv path/to/tests&lt;br /&gt;
or&lt;br /&gt;
 .tox/venv/bin/python -m testtools.run discover -t ./ path/to/tests&lt;br /&gt;
or&lt;br /&gt;
 testr run path/to/tests&lt;br /&gt;
&lt;br /&gt;
=How to write own tests=&lt;br /&gt;
&lt;br /&gt;
==Where to put new tests==&lt;br /&gt;
All tests, that cover admin API are stored in &lt;br /&gt;
 tempest/api/share/admin/*&lt;br /&gt;
All tests, that cover non-admin API are stored in&lt;br /&gt;
 tempest/api/share/*&lt;br /&gt;
&lt;br /&gt;
==Add method as API caller==&lt;br /&gt;
All such methods are stored in &lt;br /&gt;
 tempest/services/share/json/shares_client.py&lt;br /&gt;
XML is considered as deprecated and tests for it were removed, so, only json &amp;quot;client&amp;quot; is expected.&lt;br /&gt;
&lt;br /&gt;
==Positive/Negative==&lt;br /&gt;
Positive and negative tests are separated into different modules, module with &amp;quot;negative&amp;quot; tests should have &amp;quot;_negative&amp;quot; suffix.&lt;br /&gt;
Example of module with positive testsː&lt;br /&gt;
 tempest/api/share/test_shares.py&lt;br /&gt;
Example of module with negative testsː&lt;br /&gt;
 tempest/api/share/test_shares_negative.py&lt;br /&gt;
&lt;br /&gt;
==Resolving concurrency issue==&lt;br /&gt;
If some test is sensible to changes that can be done by other tests, this test should use isolated tenant, example of it can be found in quota tests, located in&lt;br /&gt;
 tempest/api/share/admin/test_quotas.py&lt;br /&gt;
&lt;br /&gt;
==Reusing resources==&lt;br /&gt;
If several tests have same dependencies, they should use same resources if possible, it can be created in &amp;quot;setUpClass&amp;quot; method. Example can be found hereː&lt;br /&gt;
 tempest/api/share/test_shares_actions.py&lt;br /&gt;
&lt;br /&gt;
==Utilization of resources==&lt;br /&gt;
Utilization stuff is defined in the following moduleː&lt;br /&gt;
 tempest/api/share/base.py&lt;br /&gt;
&lt;br /&gt;
Basic actionsː&lt;br /&gt;
 1) All setUpClass methods should be decorated with &amp;quot;@test.safe_setup&amp;quot; decorator.&lt;br /&gt;
 Reasonː if we get Exception on some step in setUpClass, tearDownClass won't start. So, this decorator runs 'tearDownClass' in any case.&lt;br /&gt;
&lt;br /&gt;
 2) Create resources that should be deleted with methods from base class.&lt;br /&gt;
 correctː self.create_share() - will add resources to deletion queue&lt;br /&gt;
 incorrectː self.shares_client.create_share() - won't add resource to deletion queue&lt;br /&gt;
&lt;br /&gt;
Common infoː&lt;br /&gt;
 All resources in deletion queue will be deleted in LIFO sequence - &amp;quot;last in first out&amp;quot; or &amp;quot;last created first deleted&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 There are two deletion queuesː&lt;br /&gt;
 - runs after each test&lt;br /&gt;
 - runs after each test-suite (class with tests)&lt;br /&gt;
 Be attentive setting up it.&lt;/div&gt;</summary>
		<author><name>Ridave</name></author>	</entry>

	</feed>