Fix containerized tempest logic

We weren't testing containerized tempest in standalone job due the
missing logic on tempest-setup.sh script. This patch adds the logic for
when containerized tempest runs in standalone, copying the clouds.yaml
file instead of the stackrc/undercloudrc and also maintain the logic
when you execute tempest in the ovb, copying the rc file.
This also ensures that /var/lib/tempestdata and /var/log/tempest
directories exists in order to not fail the execution of containerized
tempest.

https://tree.taiga.io/project/tripleo-ci-board/issue/836

Depends-On: https://review.openstack.org/#/c/643212/
Change-Id: I90204150085a1c9b943f9e054c0420a8a5e66538
Related-Bug: 1819440
This commit is contained in:
Arx Cruz 2019-03-11 12:15:10 +01:00
parent 9a90158e55
commit a4b1340a1c
5 changed files with 37 additions and 11 deletions

View File

@ -21,7 +21,10 @@ tempest_config: true
tempest_overcloud: true
run_tempest: false
post_tempest: true
tempest_format: packages # venv or packages or container
# venv or packages or container
tempest_format: packages
tempest_container_registry: >-
{% if (undercloud_enable_tempest is defined) and undercloud_enable_tempest|bool -%}
{{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }}

View File

@ -1,8 +1,20 @@
---
- name: Set tempest init command
set_fact:
tempest_init: "tempest init {{ tempest_dir }}"
tempest_init: "tempest init {{ tempest_dir }}"
- name: Set tempestconf call
set_fact:
tempestconf: "/usr/bin/discover-tempest-config"
tempestconf: "/usr/bin/discover-tempest-config"
- name: Create /var/log/containers/tempest
file:
path: /var/log/containers/tempest
state: directory
become: true
- name: Create /var/lib/tempestdata
file:
path: /var/lib/tempestdata
state: directory
become: true

View File

@ -69,11 +69,20 @@ virtualenv --system-site-packages {{ working_dir }}/tempest_git/.venv
{% if tempest_format == "container" %}
echo "========= Note: Executing tempest via a container =========="
export RCFILE="{{ rc_file }}"
cat <<'EOF' > {{ working_dir }}/tempest_container.sh
# Set the exit status for the command
set -e
# Load rc file or os_cloud file
{% if tempest_os_cloud == '' %}
source {{ rc_file_container }}
{% else %}
export OS_CLOUD="standalone"
cp -Rf /var/lib/tempest/.config ~/
{% endif %}
# Get the list of tempest/-plugins rpms installed within a tempest container
# It will be useful for debugging and making sure at what commit
# tempest/tempest plugins rpms are installed in the same.
@ -105,12 +114,6 @@ popd
## ::
export TEMPESTCONF="{{ tempestconf }}"
{% if tempest_format == 'container' %}
source {{ rc_file_container }}
{% elif tempest_os_cloud == '' %}
source {{ rc_file }}
{% endif %}
{% if tempest_overcloud|bool or tempest_os_cloud != '' %}
# Get public net id

View File

@ -52,7 +52,10 @@ then
sudo mkdir -p $TEMPEST_HOST_DATA
fi
sudo cp $RCFILE \
sudo cp \
{% if tempest_os_cloud == '' %}
{{ rc_file }} \
{% endif %}
{% if skip_file_src != '' %}
{{ working_dir }}/{{ skip_file }} \
{% endif %}
@ -65,6 +68,10 @@ sudo cp $RCFILE \
{{ working_dir }}/tempest_container.sh \
$TEMPEST_HOST_DATA
{% if tempest_os_cloud != '' %}
sudo cp -Rf {{ working_dir }}/.config $TEMPEST_HOST_DATA
{% endif %}
{% if release not in ['newton', 'ocata', 'pike', 'queens', 'rocky'] %}
export CONTAINER_BINARY='podman'
{% else %}

View File

@ -9,6 +9,7 @@
- tripleo-standalone-scenarios-full
check:
jobs:
- tripleo-ci-centos-7-standalone
- openstack-tox-linters
gate:
queue: tripleo