From ddbc4a6a099da83701aad67386e8f1e1646ee80d Mon Sep 17 00:00:00 2001
From: Iury Gregory Melo Ferreira <imelofer@redhat.com>
Date: Mon, 23 Mar 2020 15:08:40 +0100
Subject: [PATCH] add tempest boot_mode config

This patches update the devstack to automatically
set the new tempest configuration `boot_mode`,
it will use the value from IRONIC_BOOT_MODE variable.

Increase the number of VM's in ironic-tempest-ipa-partition-pxe_ipmitool
and ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa
to 2 since it runs cleanning and now we run two tempest tests.

Depends-On: https://review.opendev.org/735960
Change-Id: Ic6faf73430e56e2b1ff19a72b1b03f8ef34eff5f
---
 devstack/lib/ironic     | 3 +++
 zuul.d/ironic-jobs.yaml | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/devstack/lib/ironic b/devstack/lib/ironic
index a4d5fc07cc..fd5a151821 100644
--- a/devstack/lib/ironic
+++ b/devstack/lib/ironic
@@ -2958,6 +2958,9 @@ function ironic_configure_tempest {
     if [[ -n "$IRONIC_IP_VERSION" ]]; then
         iniset $TEMPEST_CONFIG validation ip_version_for_ssh $IRONIC_IP_VERSION
     fi
+    if [[ -n "$IRONIC_BOOT_MODE" ]]; then
+        iniset $TEMPEST_CONFIG baremetal boot_mode $IRONIC_BOOT_MODE
+    fi
     if [[ "$IRONIC_IP_VERSION" == "6" ]]; then
         # No FIPs in V6 and we dynamically create networks...
         # network_for_ssh is defaulted to public
diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml
index 3cdbd9f84a..d503954c26 100644
--- a/zuul.d/ironic-jobs.yaml
+++ b/zuul.d/ironic-jobs.yaml
@@ -327,12 +327,15 @@
 
 - job:
     name: ironic-tempest-ipa-partition-pxe_ipmitool
-    description: ironic-tempest-ipa-partition-pxe_ipmitool
+    description: ironic-tempest-ipa-partition-pxe_ipmitool that also tests cleaning.
     parent: ironic-base
     timeout: 5400
     vars:
       devstack_localrc:
         IRONIC_DEFAULT_BOOT_OPTION: netboot
+        IRONIC_VM_COUNT: 2
+        IRONIC_AUTOMATED_CLEAN_ENABLED: True
+
 
 - job:
     name: ironic-tempest-bfv
@@ -763,7 +766,7 @@
 # Used by devstack/ironic/nova/neutron
 - job:
     name: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa
-    description: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa
+    description: ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa that also tests cleaning.
     parent: ironic-base
     timeout: 5400
     vars:
@@ -773,6 +776,7 @@
         IRONIC_ENABLED_RESCUE_INTERFACES: "fake,agent,no-rescue"
         IRONIC_RAMDISK_TYPE: tinyipa
         IRONIC_VM_SPECS_RAM: 384
+        IRONIC_VM_COUNT: 2
         IRONIC_TEMPEST_WHOLE_DISK_IMAGE: True
         IRONIC_VM_EPHEMERAL_DISK: 0
         SWIFT_ENABLE_TEMPURLS: True