Chapter 5. Using ostestr to Run Tempest


Ostestr is an OpenStack wrapper for the testr test runner.

  1. You can view a list of the available tests:

    $ ostestr -l
    Copy to Clipboard Toggle word wrap
    Note

    Before running tests, you can use tempest cleanup --init-saved-state to capture the current state. This will make cleanup easier. For more information see Chapter 6, Cleaning Tempest Resources.

  2. You can run specific tests using ostestr.

    • To run just one test, use:

      ostestr --regex '(test_regex)'
      Copy to Clipboard Toggle word wrap
    • To run multiple tests:

      ostestr --regex '(test1|test2|test3)'
      Copy to Clipboard Toggle word wrap

5.1. Running Smoke Tests

Smoke testing is a type of preliminary testing which only covers the most important functionality. While they are not comprehensive, running smoke tests can save time if they do identify a problem.

To run the smoke tests:

$ ostestr --regex '(.*smoke)'
Copy to Clipboard Toggle word wrap

5.2. Running Specific Tests Using Whitelist Files

A whitelist file contains specific tests to include.

  1. Create a whitelist.txt file in your tempest workspace:

    $ touch whitelist.txt
    Copy to Clipboard Toggle word wrap
  2. Append all the tests you want to run to the whitelist.txt file:

    $ cat whitelist.txt
    keystone_tempest_plugin.*
    networking_bgpvpn_tempest.tests*
    Copy to Clipboard Toggle word wrap
  3. Run those tests using ostestr:

    $ ostestr -w <path to whitelist tests file>
    Copy to Clipboard Toggle word wrap

5.3. Skipping Tests Using Blacklist Files

A blacklist file contains a list of tests to exclude.

  1. Create a skip_test.txt file in your tempest workspace:

    $ touch skip_test.txt
    Copy to Clipboard Toggle word wrap
  2. Append all the tests to skip to the skip_test.txt file.

    $ cat skip_test.txt
    keystone_tempest_plugin.*
    networking_bgpvpn_tempest.tests*
    Copy to Clipboard Toggle word wrap
  3. Run tests using ostestr:

    $ ostestr -b <path to skip test file>
    Copy to Clipboard Toggle word wrap
  4. You can run specific tests by skipping the listed tests:

    ostestr --regex '(tempest.api.object_storage) -b <path to skip test file>
    Copy to Clipboard Toggle word wrap

5.4. Running Tests in Parallel Concurrently, or Serially

  • Run the tests in series:

    $ ostestr --serial
    Copy to Clipboard Toggle word wrap
  • Run the tests in parallel (this is the default):

    $ ostestr --parallel
    Copy to Clipboard Toggle word wrap

    Specify the number of workers to use when running tests in parallel:

    $ ostestr --concurrency _<workers>_
    Copy to Clipboard Toggle word wrap

    Alternatively:

    $ ostestr -c _<workers>_
    Copy to Clipboard Toggle word wrap

    By default, this is set to the number of CPUs.

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る