Skip to content

Commit

Permalink
[ci][common] Use separate play for tests requiring elevated priviledges
Browse files Browse the repository at this point in the history
The container tests need elevated permissions to run on the compute nodes.
This is not always going to be the case, so become is added to a separate play to only elevate priviliges for some tests.
  • Loading branch information
elfiesmelfie committed Feb 17, 2025
1 parent 78074c8 commit 56e5a08
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
24 changes: 19 additions & 5 deletions ci/logging_tests_computes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
journal_list:
- ceilometer_agent_compute
- nova_compute
common_container_test_id: "RHOSO-12753"
common_container_list:
- ceilometer_agent_compute
- ceilometer_agent_ipmi
- node_exporter
common_file_test_id: "RHOSO-12754"
common_file_list:
- /etc/rsyslog.d/10-telemetry.conf
Expand All @@ -27,3 +22,22 @@
- name: "Run the tests from the common role"
ansible.builtin.import_role:
name: common

- name: "Run container tests which require root on compute nodes"
hosts: computes
gather_facts: true
become: true
ignore_errors: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_container_test_id: "RHOSO-12753"
common_container_list:
- ceilometer_agent_compute
- ceilometer_agent_ipmi
- node_exporter
tasks:
- name: "Run the tests from the common role"
ansible.builtin.import_role:
name: common
1 change: 0 additions & 1 deletion roles/common/tasks/container_test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# The containers are run by root, so need to become true
- name: Get container status
become: true
ansible.builtin.shell:
cmd: |
podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}" | grep {{ container_name }}
Expand Down

0 comments on commit 56e5a08

Please sign in to comment.