## Run tempest ## ----------- ## :: {% if tempest_format == "venv" %} export TEMPESTCLI='{{ working_dir }}/tempest_git/tools/with_venv.sh tempest' export OSTESTR='{{ working_dir }}/tempest_git/tools/with_venv.sh ostestr' {% else %} export OSTESTR='ostestr' export TEMPESTCLI='/usr/bin/tempest' {% endif %} export TEMPESTDATA={{ tempest_data }} ## List tempest plugins ## :: $TEMPESTCLI list-plugins ## Save the resources before running tempest tests ## It will create saved_state.json in tempest workspace. ## :: {% if tempest_track_resources|bool %} $TEMPESTCLI cleanup --init-saved-state {% endif %} {% if release in ["newton", "ocata", "pike"] %} $OSTESTR {% else %} $TEMPESTCLI run {% endif %}{% if test_white_regex != '' %} --regex '({{ test_white_regex }})' {% endif %} {% if tempest_whitelist|length > 0 %} --whitelist_file=$TEMPESTDATA/{{ tempest_whitelist_file }} {% endif %} {% if release not in ["newton", "ocata", "pike"] %} {% if test_black_regex|length > 0 %} --black-regex='{{ test_black_regex|join('|') }}'{% endif %} {% endif %} {% if skip_file_src != '' %} --blacklist_file=$TEMPESTDATA/{{ skip_file }} {% endif %} {% if tempest_workers is defined %} --concurrency {{ tempest_workers }} {% endif %} {% if tempest_until_failure|bool %} --until-failure {% endif %} ## Check which all tenants would be modified in the tempest run ## It will create dry_run.json in tempest workspace. ## :: {% if tempest_track_resources|bool %} $TEMPESTCLI cleanup --dry-run {% endif %} {% if tempest_format == "container" %} EOF chmod +x {{ working_dir }}/tempest_container.sh # Copy all the required files in a temprory directory export TEMPEST_HOST_DATA='/var/lib/tempestdata' if [ ! -d $TEMPEST_HOST_DATA ] then mkdir -p $TEMPEST_HOST_DATA fi sudo cp $RCFILE \ {% if skip_file_src != '' %} {{ working_dir }}/{{ skip_file }} \ {% endif %} {% if tempest_whitelist|length > 0 %} {{ working_dir }}/{{ tempest_whitelist_file }} \ {% endif %} {% if tempest_overcloud|bool %} {{ working_dir }}/{{ tempest_deployer_input_file }} \ {% endif %} {{ working_dir }}/tempest_container.sh \ $TEMPEST_HOST_DATA {% if undercloud_container_cli is defined %} export CONTAINER_BINARY={{ undercloud_container_cli }} {% else %} export CONTAINER_BINARY='docker' {% endif %} sudo $CONTAINER_BINARY pull {{ tempest_container_registry }}/{{ tempest_container_namespace }}:{{ tempest_container_tag }} # Run tempest container using docker mouting required files sudo $CONTAINER_BINARY run --net=host -i -v $TEMPEST_HOST_DATA:{{ tempest_data }} \ -e PYTHONWARNINGS="${PYTHONWARNINGS:-}" \ -e CURL_CA_BUNDLE="" \ --user=root \ -v /var/log/containers/tempest:{{ tempest_log_dir }} \ {% if not 'http' in tempest_test_image_path %} -v {{ tempest_test_image_path }}:{{ tempest_test_image_path }} \ {% endif %} {{ tempest_container_registry }}/{{ tempest_container_namespace }}:{{ tempest_container_tag }} \ /usr/bin/bash -c 'set -e; {{ tempest_data }}/tempest_container.sh' # Change permission of tempest workspace directory sudo chmod -R 777 $TEMPEST_HOST_DATA # Copy tempest related data to tempest folder so that stackviz can use it cp -R $TEMPEST_HOST_DATA/tempest {{ working_dir }} {% endif %} ### --stop_docs