Merge "Add a CI job with Redfish and UEFI"

This commit is contained in:
Zuul 2020-10-30 12:52:41 +00:00 committed by Gerrit Code Review
commit d5611e55f5
9 changed files with 58 additions and 11 deletions

View File

@ -2,11 +2,12 @@
# defaults file for bifrost-create-vm-nodes
baremetal_json_file: '/tmp/baremetal.json'
baremetal_nodes_json: '/tmp/nodes.json'
default_boot_mode: ''
test_vm_memory_size: "3072"
test_vm_num_nodes: 1
test_vm_domain_type: "qemu"
test_vm_arch: "x86_64"
test_vm_nic: "e1000"
test_vm_nic: "{{ 'virtio' if default_boot_mode == 'uefi' else 'e1000' }}"
test_vm_groups: {}
test_vm_default_groups: "{{ lookup('env', 'DEFAULT_HOST_GROUPS').split() | default(['baremetal'], true) }}"
test_vm_disk_gib: "{{ lookup('env', 'VM_DISK') | default(10, true) }}"
@ -33,7 +34,7 @@ test_vm_storage_pool_path: "/var/lib/libvirt/images"
test_vm_logdir: "/var/log/libvirt/baremetal_logs"
# NOTE(pas-ha) next two are generic values for most OSes, overridden by distro-specifc vars
test_vm_emulator: "/usr/bin/qemu-system-x86_64"
test_vm_machine: "pc-1.0"
test_vm_machine: "pc"
# NOTE(pas-ha) not really tested with non-local qemu connections
test_vm_libvirt_uri: "{{ lookup('env', 'LIBVIRT_CONNECT_URI') | default('qemu:///system', true) }}"
# Settings related to installing bifrost in a virtual environment

View File

@ -24,4 +24,3 @@ required_packages:
- trousers
- edk2-ovmf
test_vm_emulator: "/usr/libexec/qemu-kvm"
test_vm_machine: "pc"

View File

@ -215,9 +215,30 @@
set_fact:
efi_loader_path: "{{ item }}"
with_first_found:
- /usr/share/OVMF/OVMF_CODE.secboot.fd
- /usr/share/edk2/ovmf/OVMF_CODE.fd
- /usr/share/OVMF/OVMF_CODE.fd
- /usr/share/qemu/ovmf-x86_64-code.bin
ignore_errors: true
when: efi_loader_path is undefined
- name: fail if UEFI is requested and no OVMF firmware is found
fail:
msg: >
UEFI is requested but no OVMF firmware can be found. Please set
efi_loader_path explicitly. Note that firmware with secure boot enabled
may not work yet.
when:
- efi_loader_path is undefined
- default_boot_mode == 'uefi'
- name: find OVMF NVRAM
set_fact:
efi_nvram_path: "{{ item }}"
with_first_found:
- /usr/share/edk2/ovmf/OVMF_VARS.fd
- /usr/share/OVMF/OVMF_VARS.fd
- /usr/share/qemu/ovmf-x86_64-vars.bin
when: default_boot_mode == 'uefi'
- name: write Redfish Emulator configuration file
template:

View File

@ -1,7 +1,9 @@
SUSHY_EMULATOR_BOOT_LOADER_MAP = {
{% if efi_loader_path is defined %}
'UEFI': {
'x86_64': '{{ efi_loader_path }}'
},
{% endif %}
'Legacy': {
'x86_64': None
}

View File

@ -4,7 +4,12 @@
<vcpu>{{ test_vm_cpu_count }}</vcpu>
<os>
<type arch='{{ test_vm_arch }}' machine='{{ test_vm_machine }}'>hvm</type>
<boot dev='network'/>
{% if default_boot_mode == 'uefi' %}
<loader readonly='yes' type='pflash'>{{ efi_loader_path }}</loader>
<nvram template='{{ efi_nvram_path }}'>/var/lib/libvirt/nvram-{{ vm_name }}.fd</nvram>
{% else %}
<boot dev='network'/>
{% endif %}
<bootmenu enable='no'/>
<bios useserial='yes' rebootTimeout='10000'/>
</os>
@ -29,13 +34,11 @@
<interface type='network'>
<source network='{{ test_vm_network }}'/>
<model type='{{ test_vm_nic }}'/>
{% if default_boot_mode == 'uefi' %}
<boot order='1'/>
{% endif %}
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<serial type='file'>
<source path='{{ vm_log_file }}'/>
<target port='0'/>

View File

@ -0,0 +1,11 @@
---
features:
- |
Adds support for emulating UEFI bare metal machines in the testing
environment. Pass ``default_boot_mode=uefi`` to enable.
issues:
- |
UEFI testing does not work on CentOS/RHEL 8 because of the limitations of
the provided OVMF firmware.
- |
UEFI testing does not work on Ubuntu Focal because of TFTP issues.

View File

@ -104,6 +104,7 @@ fi
if [[ -n "$BOOT_MODE" ]]; then
CLOUD_CONFIG+=" -e default_boot_mode=$BOOT_MODE"
VM_SETUP_EXTRA+=" -e default_boot_mode=$BOOT_MODE"
fi
logs_on_exit() {
@ -130,7 +131,7 @@ done
# Create the test VMs
../bifrost-cli --debug testenv \
--count ${TEST_VM_NUM_NODES} \
--memory ${VM_MEMORY_SIZE:-512} \
--memory ${VM_MEMORY_SIZE:-1024} \
--disk ${VM_DISK:-5} \
--inventory "${BAREMETAL_DATA_FILE}" \
--driver ${TEST_VM_NODE_DRIVER:-ipmi} \

View File

@ -148,6 +148,13 @@
parent: bifrost-integration-tinyipa
nodeset: fedora-latest
- job:
name: bifrost-integration-redfish-uefi-fedora-latest
parent: bifrost-integration-tinyipa-fedora-latest
vars:
boot_mode: uefi
test_driver: redfish
- job:
name: bifrost-tox-linters
parent: openstack-tox-linters

View File

@ -21,6 +21,8 @@
voting: false
- bifrost-integration-tinyipa-debian-buster:
voting: false
- bifrost-integration-redfish-uefi-fedora-latest:
voting: false
- bifrost-integration-dhcp-ubuntu-focal:
voting: false
- bifrost-integration-dhcp-centos-8: