From 8d3b77ca5e0329a7b01663d9b43991dedd5a34f8 Mon Sep 17 00:00:00 2001 From: David Rosenfeld Date: Wed, 3 Dec 2025 09:15:03 -0500 Subject: [PATCH] [validations] Add new download cache validation This validation verifies that a user may specify rpms for download and caching on a compute node. After a deployment is executed it is verified that the proper rpms are present in the compute node cache. Signed-off-by: David Rosenfeld --- roles/validations/defaults/main.yml | 3 + .../tasks/edpm/download-cache-service.yml | 100 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 roles/validations/tasks/edpm/download-cache-service.yml 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