6.2. 컨테이너 내부에서 컨테이너화된 Tempest 실행
컨테이너 내에서 실행할 수 있는 tempest 스크립트를 생성하여
tempest.conf
파일을 생성하고 tempest 테스트를 실행합니다. 이 스크립트는 다음 작업을 수행합니다.-
set -e
명령의 종료 상태를 설정합니다. -
오버클라우드에 대해 tempest를 실행하려면
overcloudrc
파일을 소싱합니다. 언더클라우드에 대해 tempest를 실행하려면stackrc
파일을 소싱합니다. -
tempest init
을 실행하여 tempest Workspace를 생성합니다. 호스트에서 파일도 액세스할 수 있도록 공유 디렉터리를 사용합니다. -
디렉토리를
tempest_workspace
로 변경 - 이후 단계에서 쉽게 사용할 수 있도록 TEMPESTCONF 환경 변수를 내보냅니다.
-
discover-tempest-config
를 실행하여tempest.conf
파일을 생성합니다.discover-tempest-config
명령에 포함할 수 있는 옵션에 대한 자세한 내용은discover-tempest-config --help
를 실행합니다. -
호스트 시스템에서
tempest.conf
파일에 액세스할 수 있도록--out
을home/stack/tempest_workspace/tempest.conf
로 설정합니다. -
공유 디렉터리에서
tempest-deployer-input.conf
파일을 가리키도록--deployer-input
.conf를 설정합니다. Tempest 테스트를 실행합니다. 이 예제 스크립트는 스모크 테스트
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.conf
파일을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 스크립트를 실행합니다.
$ docker-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