Skip to content

Commit

Permalink
Enable broader image support
Browse files Browse the repository at this point in the history
Currently, many values are hard-coded for
cirros images during tempest testing.  In
order to provide support for a wider variety
of system images, some variables have been
renamed to a more generic ``tempest_`` form
instead of the ``cirros_`` form.  Other
variables have been added to make the role
more configurable.

Additionally, many unsupported and deprecated
options still existed in this role.  These
deprecated options centered largely around
tempest.conf.j2.  Of particular note, ari/ami/aki
images have been deprecated by tempest, and
those options have been removed.

The '[boto]' testing section is no longer implemented
in tempest testing, and has been removed.

Change-Id: Ibbe2cc09416963d2326dd760c36c8a985f636734
  • Loading branch information
Michael Gugino committed Aug 4, 2016
1 parent 294edef commit ebe3295
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 73 deletions.
19 changes: 5 additions & 14 deletions defaults/main.yml
Expand Up @@ -76,9 +76,6 @@ tempest_public_subnet_allocation_pools: ""

tempest_compute_ssh_user: cirros
tempest_compute_image_ssh_user: cirros
tempest_compute_image_alt_ssh_user: cirros
tempest_compute_image_ssh_password: cubswin:)
tempest_compute_image_alt_ssh_password: cubswin:)
tempest_compute_run_ssh: True
tempest_compute_console_output_enabled: True
tempest_compute_resize_enabled: True
Expand All @@ -105,9 +102,6 @@ tempest_service_available_zaqar: False
tempest_image_api_v1_enabled: true
tempest_image_api_v2_enabled: True

tempest_boto_s3_url: "http://{{ external_lb_vip_address }}:3333"
tempest_boto_ec2_url: "http://{{ external_lb_vip_address }}:8773/services/Cloud"

tempest_swift_enabled: true
tempest_swift_container_sync: True
tempest_swift_object_versioning: True
Expand Down Expand Up @@ -153,17 +147,14 @@ tempest_pip_packages:

# Please update SHA in tempest_images below when changing the cirros version.
cirros_version: 0.3.4
cirros_tgz_url: "http://download.cirros-cloud.net/{{ cirros_version }}/cirros-{{ cirros_version }}-x86_64-uec.tar.gz"
cirros_img_url: "{{ cirros_tgz_url|replace('uec.tar.gz','disk.img') }}"
cirros_img_disk_format: qcow2

tempest_img_url: "http://download.cirros-cloud.net/{{ cirros_version }}/cirros-{{ cirros_version }}-x86_64-disk.img"
tempest_image_dir: "/opt/images"
tempest_images:
- url: "{{ cirros_tgz_url }}"
sha256: "95e77c7deaf0f515f959ffe329918d5dd23e417503d1d45e926a888853c90710"
- url: "{{ cirros_img_url }}"
- url: "{{ tempest_img_url }}"
sha256: "34987d0d5702f8813f3ff9efe90e9e39e6926ec78658763580a79face67f3394"

tempest_image_file: "cirros-{{ cirros_version }}-x86_64-disk.img"
tempest_img_disk_format: qcow2
tempest_img_name: 'cirros'
tempest_enable_instance_password: True

## Tunable overrides
Expand Down
30 changes: 30 additions & 0 deletions releasenotes/notes/broader-image-support-69241983e5a36018.yaml
@@ -0,0 +1,30 @@
---
features:
- Added new variable ``tempest_img_name``.
- Added new variable ``tempest_img_url``.
This variable replaces ``cirros_tgz_url`` and ``cirros_img_url``.
- Added new variable ``tempest_image_file``.
This variable replaces the hard-coded value
for the ``img_file`` setting in tempest.conf.j2. This will
allow users to specify images other than cirros.
- Added new variable ``tempest_img_disk_format``.
This variable replaces ``cirros_img_disk_format``.
deprecations:
- Removed ``cirros_tgz_url`` and in most places replaced
with ``tempest_img_url``.
- Removed ``cirros_img_url`` and in most places replaced
with ``tempest_img_url``.
- Removed deprecated variable ``tempest_compute_image_alt_ssh_user``
- Removed deprecated variable ``tempest_compute_image_ssh_password``
- Removed deprecated variable
``tempest_compute_image_alt_ssh_password``
- Renamed ``cirros_img_disk_format`` to ``tempest_img_disk_format``
- Downloading and unarchiving a .tar.gz has been removed. The
related tempest options ``ami_img_file``, ``aki_img_file``, and
``ari_img_file`` have been removed from tempest.conf.j2.
- The ``[boto]`` section of tempest.conf.j2 has been removed. These
tests have been completely removed from tempest for some time.
fixes:
- Removed various deprecated / no longer supported
features from tempest.conf.j2. Some variables have been moved
to their new sections in the config.
22 changes: 0 additions & 22 deletions tasks/tempest_post_install.yml
Expand Up @@ -62,28 +62,6 @@
- tempest-config
- tempest-image

- name: Locate archives
shell: |
ls -1 {{ tempest_image_dir }} | grep '.gz'
register: tempest_archives
when: tempest_service_available_glance | bool
tags:
- tempest-config
- tempest-image
- tempest-image-unarchive

- name: Image(s) unarchive
unarchive:
src: "{{ tempest_image_dir }}/{{ item }}"
dest: "{{ tempest_image_dir }}"
copy: "no"
with_items: "{{ tempest_archives.stdout | default([]) }}"
when: tempest_service_available_glance | bool
tags:
- tempest-config
- tempest-image
- tempest-image-unarchive

- name: Copy tempest config
config_template:
src: "tempest.conf.j2"
Expand Down
28 changes: 14 additions & 14 deletions tasks/tempest_resources.yml
Expand Up @@ -13,28 +13,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Ensure cirros image
- name: Ensure tempest image
glance:
command: 'image-create'
openrc_path: /root/openrc
image_name: cirros
image_url: "{{ cirros_img_url }}"
image_name: "{{ tempest_img_name }}"
image_url: "{{ tempest_img_url }}"
image_container_format: bare
image_disk_format: "{{ cirros_img_disk_format }}"
image_disk_format: "{{ tempest_img_disk_format }}"
image_is_public: True
insecure: "{{ keystone_service_internaluri_insecure }}"
register: cirros_image_create
until: cirros_image_create | success
register: tempest_image_create
until: tempest_image_create | success
retries: 5
delay: 15
when: tempest_service_available_glance | bool
tags:
- tempest-setup
- tempest-config

- name: Store cirros image id
- name: Store tempest image id
set_fact:
tempest_glance_image_id: "{{ glance_images.cirros.id }}"
tempest_glance_image_id: "{{ glance_images[tempest_img_name].id }}"
when: tempest_service_available_glance | bool
tags:
- tempest-setup
Expand All @@ -50,24 +50,24 @@
- tempest-setup
- tempest-config

- name: Ensure alt cirros image
- name: Ensure alt tempest image
glance:
command: 'image-create'
openrc_path: /root/openrc
image_name: cirros_alt
image_url: "{{ cirros_img_url }}"
image_name: "{{ tempest_img_name }}_alt"
image_url: "{{ tempest_img_url }}"
image_container_format: bare
image_disk_format: "{{ cirros_img_disk_format }}"
image_disk_format: "{{ tempest_img_disk_format }}"
image_is_public: True
insecure: "{{ keystone_service_internaluri_insecure }}"
when: tempest_service_available_glance | bool
tags:
- tempest-setup
- tempest-config

- name: Store alt cirros image id
- name: Store alt tempest image id
set_fact:
tempest_glance_image_alt_id: "{{ glance_images.cirros_alt.id }}"
tempest_glance_image_alt_id: "{{ glance_images[tempest_img_name + '_alt'].id }}"
when: tempest_service_available_glance | bool
tags:
- tempest-setup
Expand Down
30 changes: 7 additions & 23 deletions templates/tempest.conf.j2
Expand Up @@ -9,23 +9,13 @@ use_stderr = false

[auth]
tempest_roles = remote_image
allow_tenant_isolation = True
use_dynamic_credentials = True


[baremetal]
endpoint_type = internalURL


[boto]
aki_manifest = cirros-{{ cirros_version }}-x86_64-vmlinuz.manifest.xml
ami_manifest = cirros-{{ cirros_version }}-x86_64-blank.img.manifest.xml
ari_manifest = cirros-{{ cirros_version }}-x86_64-initrd.manifest.xml
ec2_url = {{ tempest_boto_ec2_url }}
s3_url = {{ tempest_boto_s3_url }}
instance_type = tempest1
s3_materials_path = /opt/images/s3-materials/cirros-{{ cirros_version }}


[cli]
enabled = true
cli_dir = /usr/local/bin
Expand All @@ -38,11 +28,6 @@ image_ref = {{ tempest_glance_image_id }}
image_ref_alt = {{ tempest_glance_image_alt_id }}
flavor_ref = 201
flavor_ref_alt = 202
image_ssh_user = {{ tempest_compute_image_ssh_user }}
image_ssh_password = {{ tempest_compute_image_ssh_password }}
image_alt_ssh_user = {{ tempest_compute_image_alt_ssh_user }}
ssh_user = {{ tempest_compute_ssh_user }}
auth_method = keypair
fixed_network_name = private
endpoint_type = internalURL
floating_ip_range = 10.0.0.0/29
Expand Down Expand Up @@ -110,7 +95,7 @@ trust = false

[image]
endpoint_type = internalURL
http_image = {{ cirros_tgz_url }}
http_image = {{ tempest_img_url }}


[image-feature-enabled]
Expand Down Expand Up @@ -163,12 +148,10 @@ lock_path = {{ tempest_venv_bin | dirname }}/locks


[scenario]
aki_img_file = cirros-{{ cirros_version }}-x86_64-vmlinuz
ari_img_file = cirros-{{ cirros_version }}-x86_64-initrd
ami_img_file = cirros-{{ cirros_version }}-x86_64-blank.img
img_dir = {{ tempest_image_dir }}
img_file = cirros-{{ cirros_version }}-x86_64-disk.img
ssh_user = {{ tempest_compute_image_ssh_user }}
img_file = {{ tempest_image_file }}
img_container_format = bare
img_disk_format = {{ tempest_img_disk_format }}


[service_available]
Expand Down Expand Up @@ -197,7 +180,8 @@ endpoint_type = internalURL

[validation]
run_validation = {{ tempest_compute_run_ssh }}

auth_method = keypair
image_ssh_user = {{ tempest_compute_image_ssh_user }}

[volume]
endpoint_type = internalURL
Expand Down

0 comments on commit ebe3295

Please sign in to comment.