From 5cf5af20bfe7175afbb574bf483386d001f544ce Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 27 Aug 2025 15:28:53 +0200 Subject: [PATCH 1/2] Install python3 package Signed-off-by: Petr "Stone" Hracek --- roles/common_tools/tasks/main.yml | 11 +++++++---- tasks/check_pip_package_present.yml | 7 +++++++ tmt-sclorg-testing-plan.yml | 17 ++++++++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 tasks/check_pip_package_present.yml diff --git a/roles/common_tools/tasks/main.yml b/roles/common_tools/tasks/main.yml index c0cdca9..3a2ebec 100644 --- a/roles/common_tools/tasks/main.yml +++ b/roles/common_tools/tasks/main.yml @@ -10,7 +10,8 @@ - postfix - acl - fpaste - + - gcc-c++ + - python3 - name: Install Fedora packages package: name: "{{ item }}" @@ -18,7 +19,6 @@ with_items: - golang-github-cpuguy83-md2man - openssl - - python3.12 - python3-pytest - python3-pip - s-nail @@ -38,7 +38,6 @@ - s-nail - podman - podman-docker - - python3.12 - python3-pytest - python3-pip when: releasever == 9 @@ -54,7 +53,6 @@ - s-nail - podman - podman-docker - - python3.12 - python3-pytest - python3-pip when: releasever == 10 @@ -73,3 +71,8 @@ state: touch mode: 0644 when: releasever > 7 + +- name: Install container-ci-suite for tests + pip: + name: git+https://github.com/sclorg/container-ci-suite + executable: pip3 \ No newline at end of file diff --git a/tasks/check_pip_package_present.yml b/tasks/check_pip_package_present.yml new file mode 100644 index 0000000..c90cadd --- /dev/null +++ b/tasks/check_pip_package_present.yml @@ -0,0 +1,7 @@ +- name: Check if pip package is present {{ item }} exists + command: pip3 list | grep "{{ item }}" + register: pip_result +- debug: var=pip_result +- name: Fail if pip is not present + fail: msg="This host {{ os_test }} does not contain pip package {{ item }}" + when: pip_result.rc != 0 diff --git a/tmt-sclorg-testing-plan.yml b/tmt-sclorg-testing-plan.yml index b9f00d5..e6bf300 100644 --- a/tmt-sclorg-testing-plan.yml +++ b/tmt-sclorg-testing-plan.yml @@ -13,18 +13,17 @@ - podman-docker - podman - fpaste + - python3 package_names_c9s: - golang-github-cpuguy83-md2man - s-nail - ansible - - python3.12 - python3-pytest - python3-pip package_names_c10s: - golang-github-cpuguy83-md2man - s-nail - ansible-core - - python3.12 - python3-pytest - python3-pip package_names_fedora: @@ -34,7 +33,6 @@ - golang-github-cpuguy83-md2man - s-nail - ansible - - python3.12 - python3-pytest - python3-pip package_names_image_mode_c9s: @@ -51,6 +49,8 @@ - /etc/containers/nodocker output_check_gpu_fedora_nvidia: - { command: 'lspci -mm', device_name: '{{ gpu }}', vendor_name: 'NVIDIA' } + pip_check_install: + - container-ci-suite tasks: - debug: msg="{{ os_test }}" @@ -61,6 +61,9 @@ - name: Check if files are present on CentOS Stream 9 include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_c9s }}" + - name: Check if pip package is present on C9S + include_tasks: ./tasks/check_pip_package_present.yml + loop: "{{ pip_check_install }}" when: (os_test is defined) and (os_test == "c9s") - block: @@ -79,6 +82,10 @@ - name: Check if files are present on CentOS Stream 10 include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_c10s }}" + - name: Check if pip package is present on C10S + include_tasks: ./tasks/check_pip_package_present.yml + loop: "{{ pip_check_install }}" + when: (os_test is defined) and (os_test == "c10s") - block: @@ -89,6 +96,10 @@ - name: Check if file {{ item }} exists include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_fedora }}" + - name: Check if pip package is present on Fedora + include_tasks: ./tasks/check_pip_package_present.yml + loop: "{{ pip_check_install }}" + when: (os_test is defined) and (os_test == "fedora") - block: From de3445d0a13f1d61d0bf9182642b8617a091ce8a Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 27 Aug 2025 16:03:38 +0200 Subject: [PATCH 2/2] Separate python version from Fedora and CentOS Streams Signed-off-by: Petr "Stone" Hracek --- roles/common_tools/tasks/main.yml | 30 +++++++++++++++++++++-------- tasks/check_pip_package_present.yml | 26 ++++++++++++++++++------- tmt-sclorg-testing-plan.yml | 17 +++++++--------- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/roles/common_tools/tasks/main.yml b/roles/common_tools/tasks/main.yml index 3a2ebec..5a41453 100644 --- a/roles/common_tools/tasks/main.yml +++ b/roles/common_tools/tasks/main.yml @@ -1,4 +1,8 @@ --- +- name: Enable CentOS-Stream-CRB + action: shell dnf config-manager --set-enabled crb + when: releasever == 9 or releasever == 10 + - name: Install basic tools package: name: "{{ item }}" @@ -11,7 +15,7 @@ - acl - fpaste - gcc-c++ - - python3 + - name: Install Fedora packages package: name: "{{ item }}" @@ -19,12 +23,13 @@ with_items: - golang-github-cpuguy83-md2man - openssl - - python3-pytest - - python3-pip - s-nail - podman - podman-docker - pciutils + - python3 + - python3-pytest + - python3-pip when: releasever > 30 - name: Install CentOS Stream 9 packages @@ -38,8 +43,9 @@ - s-nail - podman - podman-docker - - python3-pytest - - python3-pip + - python3.12 + - python3.12-pytest + - python3.12-pip when: releasever == 9 - name: Install CentOS Stream 10 packages @@ -53,8 +59,9 @@ - s-nail - podman - podman-docker - - python3-pytest - - python3-pip + - python3.12 + - python3.12-pytest + - python3.12-pip when: releasever == 10 - name: Create dir /etc/containers @@ -75,4 +82,11 @@ - name: Install container-ci-suite for tests pip: name: git+https://github.com/sclorg/container-ci-suite - executable: pip3 \ No newline at end of file + executable: pip3.12 + when: releasever == 9 or releasever == 10 + +- name: Install container-ci-suite for tests + pip: + name: git+https://github.com/sclorg/container-ci-suite + executable: pip3 + when: releasever > 30 \ No newline at end of file diff --git a/tasks/check_pip_package_present.yml b/tasks/check_pip_package_present.yml index c90cadd..a98c957 100644 --- a/tasks/check_pip_package_present.yml +++ b/tasks/check_pip_package_present.yml @@ -1,7 +1,19 @@ -- name: Check if pip package is present {{ item }} exists - command: pip3 list | grep "{{ item }}" - register: pip_result -- debug: var=pip_result -- name: Fail if pip is not present - fail: msg="This host {{ os_test }} does not contain pip package {{ item }}" - when: pip_result.rc != 0 +- block: + - name: Check if pip package is present {{ item }} exists + command: pip3.12 list | grep "{{ item }}" + register: pip_result + - debug: var=pip_result + - name: Fail if pip is not present + fail: msg="This host {{ os_test }} does not contain pip package {{ item }}" + when: pip_result.rc != 0 + when: (os_test is defined) and (os_test == "centos-stream-9-plan") + +- block: + - name: Check if pip package is present {{ item }} exists + command: pip3 list | grep "{{ item }}" + register: pip_result + - debug: var=pip_result + - name: Fail if pip is not present + fail: msg="This host {{ os_test }} does not contain pip package {{ item }}" + when: pip_result.rc != 0 + when: (os_test is defined) and (os_test != "centos-stream-9-plan") diff --git a/tmt-sclorg-testing-plan.yml b/tmt-sclorg-testing-plan.yml index e6bf300..59e0bf7 100644 --- a/tmt-sclorg-testing-plan.yml +++ b/tmt-sclorg-testing-plan.yml @@ -13,17 +13,18 @@ - podman-docker - podman - fpaste - - python3 package_names_c9s: - golang-github-cpuguy83-md2man - s-nail - ansible - - python3-pytest - - python3-pip + - python3.12 + - python3.12-pytest + - python3.12-pip package_names_c10s: - golang-github-cpuguy83-md2man - s-nail - ansible-core + - python3 - python3-pytest - python3-pip package_names_fedora: @@ -33,6 +34,7 @@ - golang-github-cpuguy83-md2man - s-nail - ansible + - python3 - python3-pytest - python3-pip package_names_image_mode_c9s: @@ -64,7 +66,7 @@ - name: Check if pip package is present on C9S include_tasks: ./tasks/check_pip_package_present.yml loop: "{{ pip_check_install }}" - when: (os_test is defined) and (os_test == "c9s") + when: (os_test is defined) and (os_test == "centos-stream-9-plan") - block: - name: Check if listed package is installed on Image mode CentOS Stream 9 @@ -85,32 +87,27 @@ - name: Check if pip package is present on C10S include_tasks: ./tasks/check_pip_package_present.yml loop: "{{ pip_check_install }}" - - when: (os_test is defined) and (os_test == "c10s") + when: (os_test is defined) and (os_test == "centos-stream-10-plan") - block: - name: Check if listed package is installed on Fedora include_tasks: ./tasks/check_rpm_presents.yml loop: "{{ package_names_all + package_names_fedora }}" - - name: Check if file {{ item }} exists include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_fedora }}" - name: Check if pip package is present on Fedora include_tasks: ./tasks/check_pip_package_present.yml loop: "{{ pip_check_install }}" - when: (os_test is defined) and (os_test == "fedora") - block: - name: Check if listed package is installed on Fedora include_tasks: ./tasks/check_rpm_presents.yml loop: "{{ package_names_all + package_names_fedora + package_names_gpu_fedora }}" - - name: Check if file {{ item }} exists include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_fedora }}" - - name: Check if output {{ item }} exists include_tasks: ./tasks/check_output_command.yml loop: "{{ output_check_gpu_fedora_nvidia }}"