From 3ff160437dd99485653c490df29a39bfd81e9e74 Mon Sep 17 00:00:00 2001 From: Dougal Seeley Date: Sat, 31 Dec 2022 04:28:51 +0000 Subject: [PATCH] Add retries to libvirt pool refresh (in case of concurrent background operations) Jenkinsfile_testsuite: Set sandbox true for active choice parameter --- create/tasks/create_libvirt.yml | 3 +++ jenkinsfiles/Jenkinsfile_testsuite | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/create/tasks/create_libvirt.yml b/create/tasks/create_libvirt.yml index ac81725..7c67762 100644 --- a/create/tasks/create_libvirt.yml +++ b/create/tasks/create_libvirt.yml @@ -57,6 +57,9 @@ uri: 'qemu+ssh://{{ cluster_vars.libvirt.username }}@{{ cluster_vars.libvirt.hypervisor }}/system?keyfile=id_rsa__libvirt_svc&no_verify=1' name: default command: refresh + register: r__virt_pool + until: r__virt_pool is success + retries: 10 when: "redeploy_scheme is defined and redeploy_scheme == '_scheme_rmvm_keepdisk_rollback'" diff --git a/jenkinsfiles/Jenkinsfile_testsuite b/jenkinsfiles/Jenkinsfile_testsuite index b8cb9c6..d0e144c 100644 --- a/jenkinsfiles/Jenkinsfile_testsuite +++ b/jenkinsfiles/Jenkinsfile_testsuite @@ -102,7 +102,7 @@ properties([ extendedChoice(name: 'SCALEUPDOWN', type: 'PT_MULTI_SELECT', value: 'noscale,scaleup,scaledown', defaultValue: 'noscale', description: 'Specify whether to test scaling up and/or down.', visibleItemCount: 3), extendedChoice(name: 'IMAGE_TESTED', type: 'PT_MULTI_SELECT', value: '_ubuntu2204image,_ubuntu2004image,_ubuntu1804image,_centos7image,_alma8image', defaultValue: '_ubuntu2204image', descriptionPropertyValue: 'Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04, CentOS 7, AlmaLinux 8', description: 'Specify which image(s) to test', visibleItemCount: 4), // extendedChoice(name: 'ANSIBLE_VERSION_X', type: 'PT_MULTI_SELECT', bindings: '', description: 'Version of Ansible to use for testing', groovyClasspath: '', groovyScript: '''import groovy.json.JsonSlurper; def ansibleReleases= ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text; def list = new JsonSlurper().parseText(ansibleReleases); return list.releases.keySet().collect{(it=~/^(?![1-4]\\.|5\\.[0,2-5]|5\\.[1]\\.).*?\\.(?:\\d+)$/).findAll().join()}.findAll().collectEntries{[(it=~/\\d+|\\D+/).findAll().collect{it.padLeft(3,\'0\')}.join(), it]}.sort().values().collect().reverse();''', multiSelectDelimiter: ',', quoteValue: false, saveJSONParameterToFile: false, visibleItemCount: 5), - [name: 'ANSIBLE_VERSION', $class: 'ChoiceParameter', choiceType: 'PT_MULTI_SELECT', description: 'Version of Ansible to use for testing.', randomName: 'choice-parameter-264936764694694', script: [$class: 'GroovyScript', fallbackScript: [classpath: [], oldScript: '', sandbox: false, script: 'return([])'], script: [classpath: [], oldScript: '', sandbox: false, script: 'import groovy.json.JsonSlurper; def ansibleReleases= ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text; def list = new JsonSlurper().parseText(ansibleReleases); return list.releases.keySet().collect{(it=~/^(?![1-4]\\.|5\\.[0,2-5]|5\\.[1]\\.).*?\\.(?:\\d+)$/).findAll().join()}.findAll().collectEntries{[(it=~/\\d+|\\D+/).findAll().collect{it.padLeft(3,\'0\')}.join(), it]}.sort().values().collect().reverse().withIndex().collect {elem, idx -> idx==0 ? elem + ":selected" : elem};']]], + [name: 'ANSIBLE_VERSION', $class: 'ChoiceParameter', choiceType: 'PT_MULTI_SELECT', description: 'Version of Ansible to use for testing.', randomName: 'choice-parameter-264936764694694', script: [$class: 'GroovyScript', fallbackScript: [classpath: [], oldScript: '', sandbox: true, script: 'return([])'], script: [classpath: [], oldScript: '', sandbox: true, script: 'import groovy.json.JsonSlurper; def ansibleReleases= ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text; def list = new JsonSlurper().parseText(ansibleReleases); return list.releases.keySet().collect{(it=~/^(?![1-4]\\.|5\\.[0,2-5]|5\\.[1]\\.).*?\\.(?:\\d+)$/).findAll().join()}.findAll().collectEntries{[(it=~/\\d+|\\D+/).findAll().collect{it.padLeft(3,\'0\')}.join(), it]}.sort().values().collect().reverse().withIndex().collect {elem, idx -> idx==0 ? elem + ":selected" : elem};']]], ]) ])