이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 6. Running containerized Tempest


This section contains information about running tempest from a container on the undercloud. You can run tempest against the overcloud or the undercloud. Containerized tempest requires the same resources as non-containerized tempest.

6.1. Preparing the Tempest container

Complete the following steps to download and configure your tempest container:

  1. Change to the /home/stack directory:

    Copy to Clipboard Toggle word wrap
    $ cd /home/stack
  2. Download the tempest container:

    Copy to Clipboard Toggle word wrap
    $ podman pull registry.redhat.io/rhosp15-rhel8/openstack-tempest

    This container includes all tempest plugins. Running tempest tests globally with this container includes tests for plugins. For example, if you run the tempest run --regex '(*.)' command, tempest runs all plugin tests. These tempest tests fail if your deployment does not contain configuration for all plugins. Run the tempest list-plugins command to view all installed plugins. To exclude tests, you must include the tests that you want to exclude in a blacklist file. For more information, see Chapter 5, Using Tempest.

  3. Create directories to use for exchanging data between the host machine and the container:

    Copy to Clipboard Toggle word wrap
    $ mkdir container_tempest tempest_workspace
  4. Copy the necessary files to the container_tempest directory. This directory is the file source for the container:

    Copy to Clipboard Toggle word wrap
    $ cp stackrc overcloudrc tempest-deployer-input.conf container_tempest
  5. List the available container images:

    Copy to Clipboard Toggle word wrap
    $ podman images
    REPOSITORY                                                  TAG        IMAGE ID            CREATED             SIZE
    registry.redhat.io/rhosp15-rhel8/openstack-tempest   latest     881f7ac24d8f        10 days ago         641 MB
  6. Create an alias to facilitate easier command entry. Ensure that you use absolute paths when mounting the directories:

    Copy to Clipboard Toggle word wrap
    $ alias podman-tempest="podman run -i \
        -v "$(pwd)"/container_tempest:/home/stack/container_tempest \
        -v "$(pwd)"/tempest_workspace:/home/stack/tempest_workspace \
        registry.redhat.io/rhosp15-rhel8/openstack-tempest \
        /bin/bash"
  7. To get a list of available tempest plugins in the container, run the following command:

    Copy to Clipboard Toggle word wrap
    $ podman-tempest -c "rpm -qa | grep tempest"

6.2. Running containerized Tempest inside the container

  1. Create a tempest script that you can execute within the container to generate the tempest.conf file and run the tempest tests. The script performs the following actions:

    • Set the exit status for the command set -e.
    • Source the overcloudrc file if you want to run tempest against the overcloud. Source the stackrc file if you want to run tempest against the undercloud.
    • Run tempest init to create a tempest workspace. Use the shared directory so that the files are also accessible from the host.
    • Change directory to tempest_workspace
    • Export the TEMPESTCONF environment variable for ease of use at a later stage.
    • Execute discover-tempest-config to generate the tempest.conf file. For more information about the options that you can include in the discover-tempest-config command, run discover-tempest-config --help.
    • Set --out to home/stack/tempest_workspace/tempest.conf so that the tempest.conf file is accessible from the host machine.
    • Set --deployer-input to point to the tempest-deployer-input.conf file in the shared directory.
    • Run tempest tests. This example script runs the smoke test tempest run --smoke.

      Copy to Clipboard Toggle word wrap
      $ cat <<'EOF'>> /home/stack/container_tempest/tempest_script.sh
      set -e
      source /home/stack/container_tempest/overcloudrc
      tempest init /home/stack/tempest_workspace
      pushd /home/stack/tempest_workspace
      
      export TEMPESTCONF="/usr/bin/discover-tempest-config"
      
      $TEMPESTCONF \
        --out /home/stack/tempest_workspace/etc/tempest.conf \
        --deployer-input /home/stack/container_tempest/tempest-deployer-input.conf \
        --debug \
        --create \
        object-storage.reseller_admin ResellerAdmin
      
      tempest run --smoke
      
      EOF

      If you already have a tempest.conf file and you want only to run the tempest tests, omit TEMPESTCONF from the script and replace it with a command to copy your tempest.conf file from the container_tempest directory to the tempest_workspace/etc directory:

    Copy to Clipboard Toggle word wrap
    $ cp /home/stack/container_tempest/tempest.conf /home/stack/tempest_workspace/etc/tempest.conf
  2. Set executable privileges on the tempest_script.sh script:

    Copy to Clipboard Toggle word wrap
    $ chmod +x container_tempest/tempest_script.sh
  3. Run the tempest script from the container using the alias that you created in a previous step:

    Copy to Clipboard Toggle word wrap
    $ podman-tempest -c 'set -e; /home/stack/container_tempest/tempest_script.sh'
  4. Inspect the .stestr directory for information about the test results.
  5. If you want to rerun the tempest tests, you must first remove and recreate the tempest workspace:

    Copy to Clipboard Toggle word wrap
    $ sudo rm -rf /home/stack/tempest_workspace
    $ mkdir /home/stack/tempest_workspace

6.3. Running Containerized Tempest outside the container

The container generates or retrieves the tempest.conf file and runs tests. You can perform these operations from outside the container:

  1. Source the overcloudrc file if you want to run tempest against the overcloud. Source the stackrc file if you want to run tempest against the undercloud:

    Copy to Clipboard Toggle word wrap
    # source /home/stack/container_tempest/overcloudrc
  2. Run tempest init to create a tempest workspace. Use the shared directory so that the files are also accessible from the host:

    Copy to Clipboard Toggle word wrap
    # tempest init /home/stack/tempest_workspace
  3. Generate the tempest.conf file:

    Copy to Clipboard Toggle word wrap
    # discover-tempest-config \
    --out /home/stack/tempest_workspace/tempest.conf \
    --deployer-input /home/stack/container_tempest/tempest-deployer-input-conf \
    --debug \
    --create \
    object-storage.reseller_admin ResellerAdmin

    For more information about the options that you can include in the discover-tempest-config command, run discover-tempest-config --help.

  4. Execute tempest tests. For example, run the following command to execute the tempest smoke test using the alias you created in a previous step:

    Copy to Clipboard Toggle word wrap
    # podman-tempest -c "tempest run --smoke"
  5. Inspect the .stestr directory for information about the test results.
  6. If you want to rerun the tempest tests, you must first remove and recreate the tempest workspace:

    Copy to Clipboard Toggle word wrap
    $ sudo rm -rf /home/stack/tempest_workspace
    $ mkdir /home/stack/tempest_workspace
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat, Inc.