diff --git a/roles/common_tools/tasks/main.yml b/roles/common_tools/tasks/main.yml index c0cdca9..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 }}" @@ -10,6 +14,7 @@ - postfix - acl - fpaste + - gcc-c++ - name: Install Fedora packages package: @@ -18,13 +23,13 @@ with_items: - golang-github-cpuguy83-md2man - openssl - - python3.12 - - python3-pytest - - python3-pip - s-nail - podman - podman-docker - pciutils + - python3 + - python3-pytest + - python3-pip when: releasever > 30 - name: Install CentOS Stream 9 packages @@ -39,8 +44,8 @@ - podman - podman-docker - python3.12 - - python3-pytest - - python3-pip + - python3.12-pytest + - python3.12-pip when: releasever == 9 - name: Install CentOS Stream 10 packages @@ -55,8 +60,8 @@ - podman - podman-docker - python3.12 - - python3-pytest - - python3-pip + - python3.12-pytest + - python3.12-pip when: releasever == 10 - name: Create dir /etc/containers @@ -73,3 +78,15 @@ 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.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 new file mode 100644 index 0000000..a98c957 --- /dev/null +++ b/tasks/check_pip_package_present.yml @@ -0,0 +1,19 @@ +- 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 b9f00d5..59e0bf7 100644 --- a/tmt-sclorg-testing-plan.yml +++ b/tmt-sclorg-testing-plan.yml @@ -18,13 +18,13 @@ - s-nail - ansible - python3.12 - - python3-pytest - - python3-pip + - python3.12-pytest + - python3.12-pip package_names_c10s: - golang-github-cpuguy83-md2man - s-nail - ansible-core - - python3.12 + - python3 - python3-pytest - python3-pip package_names_fedora: @@ -34,7 +34,7 @@ - golang-github-cpuguy83-md2man - s-nail - ansible - - python3.12 + - python3 - python3-pytest - python3-pip package_names_image_mode_c9s: @@ -51,6 +51,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,7 +63,10 @@ - name: Check if files are present on CentOS Stream 9 include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_c9s }}" - when: (os_test is defined) and (os_test == "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 == "centos-stream-9-plan") - block: - name: Check if listed package is installed on Image mode CentOS Stream 9 @@ -79,27 +84,30 @@ - name: Check if files are present on CentOS Stream 10 include_tasks: ./tasks/check_file_presents.yml loop: "{{ files_to_check_c10s }}" - when: (os_test is defined) and (os_test == "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 == "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 }}"