此内容没有您所选择的语言版本。
17.2. Configure the OpenStack Integration Test Suite
Within the
tempest virtual machine, run the following steps to configure your environment:
- Create a working directory to run the OpenStack Integration Test Suite tools, for example,
mytempest:mkdir -p /path/to/mytempest
# mkdir -p /path/to/mytempestCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Within the
mytempestdirectory, run theconfigure-tempest-directorycommand to setup the OpenStack Integration Test Suite within themytempestdirectory.cd /path/to/mytempest /usr/share/openstack-tempest-*/tools/configure-tempest-directory
# cd /path/to/mytempest # /usr/share/openstack-tempest-*/tools/configure-tempest-directoryCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Export the Red Hat OpenStack Platform environment variable with the proper credentials. The credentials for this environment are as follows:
export OS_USERNAME=admin export OS_PROJECT_NAME=admin export OS_PASSWORD=password export OS_AUTH_URL=http://IP:35357/v2
# export OS_USERNAME=admin # export OS_PROJECT_NAME=admin # export OS_PASSWORD=password # export OS_AUTH_URL=http://IP:35357/v2Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
It is not necessary to have admin credetials to run the OpenStack Intergration Test Suite. Withadmincredentials, you can perform the following actions:- Run tests for admin APIs
- Generate test credentials on the go.
- With a saved resource state, run the
config_tempest.pyscript with the following credentials to properly create thetempest.confconfiguration file that resides within the/etcdirectory.tools/config_tempest.py --debug --create identity.uri $OS_AUTH_URL identity.admin_username $OS_USERNAME identity.admin_password $OS_PASSWORD identity.admin_tenant_name $OS_PROJECT_NAME object-storage.operator_role swiftoperator
# tools/config_tempest.py --debug --create identity.uri $OS_AUTH_URL identity.admin_username $OS_USERNAME identity.admin_password $OS_PASSWORD identity.admin_tenant_name $OS_PROJECT_NAME object-storage.operator_role swiftoperatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Before you run any tests, it is critical to preserve a clean resouce state of the existing OpenStack cloud:
tempest cleanup --init-saved-state
# tempest cleanup --init-saved-stateCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Cleanup with the OpenStack Integration Test Suire does not cleanup the entire environment. It is possible that manual intervention is required to clean up the existing OpenStack cloud. - Review the
etc/tempest.conffile located within themytempestdirectory to ensure it meets all your Red Hat OpenStack Platform environment needs. - Verify the
run-test.shscript properly runs, by using one of thetempesttests labeledtempest.api.compute.flavors.tools/run-tests.sh --concurrency 4 tempest.api.compute.flavors
# tools/run-tests.sh --concurrency 4 tempest.api.compute.flavorsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
The optionconcurrency 4prevents the OpenStack Integration Test Suite from creating race conditions and/or unexpected errors. - After successful verification, run the
run-tests.shscripts as follows:tools/run-tests.sh --concurrency 4 --skip-file tools/ra-skip-file | tee ra-out.txt
# tools/run-tests.sh --concurrency 4 --skip-file tools/ra-skip-file | tee ra-out.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Thera-skip-filecontains specific tempest tests excluded when running therun-tests.shscript. The reason specific tests are excluded is due to your environment not running certain scenarios, for example, floating IP tests and third party tests. A samplera-skip filecan be as follows:-tempest\.api\.compute\.floating_ips.* -tempest\.thirdparty\.boto.* -tempest\.api\.compute\.floating_ips.* -tempest\.api\.network\.test_floating_ips.* -tempest\.api\.network\.admin\.test_floating_ips_admin_action
-tempest\.api\.compute\.floating_ips.* -tempest\.thirdparty\.boto.* -tempest\.api\.compute\.floating_ips.* -tempest\.api\.network\.test_floating_ips.* -tempest\.api\.network\.admin\.test_floating_ips_admin_actionCopy to Clipboard Copied! Toggle word wrap Toggle overflow Every Red Hat OpenStack Environment is different and therefore the test scenario cases to skip may vary for each environment. - Once the OpenStack Integration Test Suite tests that verify your OpenStack deployment are complete, cleanup the environment to return it to its original resource state.
python -m tempest.cmd.cleanup
# python -m tempest.cmd.cleanupCopy to Clipboard Copied! Toggle word wrap Toggle overflow