Skip to content
Snippets Groups Projects
Commit b66c2749 authored by Denis Pynkin's avatar Denis Pynkin
Browse files

lava: add macros 'image_url()'

Macros for path calculation to the testing image for deploy.
It accepts only one string parameter -- file extension to be added
to the base image URL.

In case if global variable 'image_base_url' is set -- it is returned
with requested extension instead of on-the-fly calculation.

As a side effect -- it is possible to define the image for the test
via CLI without changing other variables, for instance:
  lqa -g lava/profiles.yaml -t image_base_url:'https://URL/name.img

'

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent b2c8ca23
No related branches found
No related tags found
No related merge requests found
......@@ -5,3 +5,11 @@
zimage
{%- endif %}
{%- endmacro %}
{% macro image_url(ext) -%}
{% if image_base_url is defined -%}
{{image_base_url}}.{{ext}}
{%- else -%}
{{baseurl}}/{{imgpath}}/{{image_date}}/{{arch}}/{{image_type}}/{{image_name}}.img.{{ext}}
{%- endif %}
{%- endmacro %}
......@@ -89,9 +89,9 @@ actions:
prompts: ['copying time: [0-9ms\.\ ]+, copying speed [0-9\.]+ MiB\/sec']
images:
image:
url: {{baseurl}}/{{imgpath}}/{{image_date}}/{{arch}}/{{image_type}}/{{image_name}}.img.gz
url: {{boot.image_url('gz')}}
bmap:
url: {{baseurl}}/{{imgpath}}/{{image_date}}/{{arch}}/{{image_type}}/{{image_name}}.img.bmap
url: {{boot.image_url('bmap')}}
uniquify: false
os: ubuntu
writer:
......
{% import 'common-boot-macros.yaml' as boot with context -%}
device_type: {{device_type}}
priority: medium
......@@ -48,7 +50,7 @@ actions:
images:
rootfs:
image_arg: -m 1024 -enable-kvm -cpu host -vga qxl -device virtio-rng-pci -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/OVMF.fd -drive if=virtio,format=raw,file={rootfs}
url: {{baseurl}}/{{imgpath}}/{{image_date}}/{{arch}}/{{image_type}}/{{image_name}}.img.gz
url: {{boot.image_url('gz')}}
compression: gz
os: ubuntu
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment