6.2. コンテナー内でコンテナー化された Tempest の実行
コンテナー内で実行できる tempest スクリプトを作成して
tempest.confファイルを生成し、tempest テストを実行します。スクリプトは以下のアクションを実行します。-
コマンド
set -eの終了ステータスを設定します。 -
オーバークラウドに対して tempest を実行する場合は、source コマンドで
overcloudrcファイルを読み込みます。アンダークラウドに対して tempest を実行する場合はstackrcファイルを読み込みます。 -
tempest initを実行して、tempest ワークスペースを作成します。共有ディレクトリーを使用して、ホストからもファイルにアクセスできるようにします。 -
ディレクトリーを
tempest_workspaceに変更します。 - 後で簡単に使用できるように、TEMPESTCONF 環境変数をエクスポートします。
-
discover-tempest-configを実行してtempest.confファイルを生成します。discover-tempest-configコマンドで追加するオプションの詳細は、discover-tempest-config --helpを実行します。 -
--outをhome/stack/tempest_workspace/tempest.confに設定して、tempest.confファイルがホストマシンからアクセスできるようにします。 -
--deployer-inputを、共有ディレクトリーのtempest-deployer-input.confファイルをポイントするように設定します。 tempest テストを実行します。このサンプルスクリプトは、smoke テスト
tempest run --smokeを実行します。$ 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
tempest.confファイルがすでにあり、tempest テストのみを実行する場合は、スクリプトからTEMPESTCONFを省略し、これをcontainer_tempestディレクトリーからtempest_workspace/etcディレクトリーにコピーするコマンドに置き換えます。
$ cp /home/stack/container_tempest/tempest.conf /home/stack/tempest_workspace/etc/tempest.conf
-
コマンド
tempest_script.shスクリプトに実行可能権限を設定します。$ chmod +x container_tempest/tempest_script.sh
前のステップで作成したエイリアスを使用して、コンテナーから tempest スクリプトを実行します。
$ podman-tempest -c 'set -e; /home/stack/container_tempest/tempest_script.sh'
-
.stestrディレクトリーでテスト結果に関する情報を検査します。 tempest テストを再実行する場合は、最初に tempest ワークスペースを削除し、再作成する必要があります。
$ sudo rm -rf /home/stack/tempest_workspace $ mkdir /home/stack/tempest_workspace