diff --git a/roles/validations/defaults/main.yml b/roles/validations/defaults/main.yml index fbc9d2cfdd..2beab98642 100644 --- a/roles/validations/defaults/main.yml +++ b/roles/validations/defaults/main.yml @@ -59,3 +59,6 @@ cifmw_validations_bmh_replace_leaf_label: leaf0-1 cifmw_validations_bmh_spare_leaf_label: leaf0-0 cifmw_validations_bmh_spare_nodename: edpm-compute-0-0 cifmw_validations_bmh_spare_hostname: edpm-compute-0-0.ctlplane.openstack.lab + +# variables needed for download cache +cifmw_validations_cached_packages: ["tuned"] diff --git a/roles/validations/tasks/edpm/download-cache-service.yml b/roles/validations/tasks/edpm/download-cache-service.yml new file mode 100644 index 0000000000..63185f7f88 --- /dev/null +++ b/roles/validations/tasks/edpm/download-cache-service.yml @@ -0,0 +1,100 @@ +- name: Determine name of deployed NodeSet + environment: + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" + PATH: "{{ cifmw_path }}" + cifmw.general.ci_script: + output_dir: "{{ cifmw_validations_basedir }}/artifacts" + script: >- + oc get -n {{ cifmw_validations_namespace }} osdpns --no-headers -o custom-columns=":metadata.name" + register: deployed_nodeset_name + +- name: Clean cache on a compute node + become: true + ansible.builtin.command: + cmd: dnf clean all + delegate_to: "{{ cifmw_validations_edpm_check_node }}" + +- name: Uninstall requested packages on a compute node + become: true + ansible.builtin.dnf: + name: "{{ item_cached_package }}" + state: absent + loop: "{{ cifmw_validations_cached_packages }}" + loop_control: + loop_var: item_cached_package + delegate_to: "{{ cifmw_validations_edpm_check_node }}" + +# Packages are removed from cache when they are installed. Create a custom service +# that checks for cached packages. This service can be used to verify that packages +# have been properly cached by executing before a service that loads packages. +- name: Create custom service to verify cache on a compute node + environment: + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" + PATH: "{{ cifmw_path }}" + cifmw.general.ci_script: + output_dir: "{{ cifmw_validations_basedir }}/artifacts" + script: | + oc apply -f - <- + oc wait openstackdataplanedeployment download-cache-service + --namespace={{ cifmw_validations_namespace }} + --for=condition=ready + --timeout={{ 4 * cifmw_validations_timeout }}s