Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: tox-lsr 3.4.0 - fix py27 tests; move other checks to py310 #207

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
- name: Convert role to collection format
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-managed-var-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
- name: Run ansible-plugin-scan
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-plugin-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
- name: Run ansible-plugin-scan
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
- name: Convert role to collection format
run: |
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/python-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
set -euxo pipefail
python -m pip install --upgrade pip
pip install "git+https://github.com/linux-system-roles/tox-lsr@3.3.0"
pip install "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
# If you have additional OS dependency packages e.g. libcairo2-dev
# then put them in .github/config/ubuntu-requirements.txt, one
# package per line.
Expand Down Expand Up @@ -80,11 +80,8 @@ jobs:
toxenvs="py${toxpyver}"
# NOTE: The use of flake8, pylint, black with specific
# python envs is arbitrary and must be changed in tox-lsr
# We really should either do those checks using the latest
# version of python, or in every version of python
case "$toxpyver" in
27) toxenvs="${toxenvs},coveralls,flake8,pylint" ;;
36) toxenvs="${toxenvs},coveralls,black" ;;
310) toxenvs="${toxenvs},coveralls,flake8,pylint,black" ;;
*) toxenvs="${toxenvs},coveralls" ;;
esac
TOXENV="$toxenvs" lsr_ci_runtox
Expand Down
1 change: 0 additions & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: MIT
---
extends: default
ignore: |
/.tox/
2 changes: 1 addition & 1 deletion tasks/shell_pcs/cluster-setup-corosync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
dest: /etc/corosync/corosync.conf
owner: root
group: root
mode: 0644
mode: "0644"
register: __ha_cluster_distribute_corosync_conf
when: __ha_cluster_data_corosync_conf is defined

Expand Down
4 changes: 2 additions & 2 deletions tasks/shell_pcs/cluster-setup-keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
dest: /etc/corosync/authkey
owner: root
group: root
mode: 0400
mode: "0400"
register: __ha_cluster_distribute_corosync_authkey

- name: Get pacemaker authkey
Expand All @@ -31,7 +31,7 @@
dest: /etc/pacemaker/authkey
owner: hacluster
group: haclient
mode: 0400
mode: "0400"
register: __ha_cluster_distribute_pacemaker_authkey

- name: Remove qdevice certificates [CLI]
Expand Down
6 changes: 3 additions & 3 deletions tasks/shell_pcs/configure-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@
dest: /var/lib/pcsd/pcsd.key
owner: root
group: root
mode: 0600
mode: "0600"
- name: Distribute pcsd TLS certificate
copy:
src: "{{ ha_cluster_pcsd_public_key_src }}"
dest: /var/lib/pcsd/pcsd.crt
owner: root
group: root
mode: 0600
mode: "0600"

- name: Distribute pcs_settings.conf
template:
src: templates/pcs_settings.conf
dest: /var/lib/pcsd/pcs_settings.conf
owner: root
group: root
mode: 0644
mode: "0644"
trim_blocks: false

- name: Start pcsd with updated config files and configure it to start on boot
Expand Down
4 changes: 2 additions & 2 deletions tasks/shell_pcs/create-and-push-cib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
dest: "{{ item }}"
owner: root
group: root
mode: 0600
mode: "0600"
loop:
- "{{ __ha_cluster_tempfile_cib_xml.path }}"
- "{{ __ha_cluster_tempfile_original_cib_xml.path }}"
Expand Down Expand Up @@ -276,7 +276,7 @@
dest: "{{ __ha_cluster_tempfile_cib_diff.path }}"
owner: root
group: root
mode: 0600
mode: "0600"
check_mode: false
changed_when: not ansible_check_mode
when: __ha_cluster_cib_diff.rc == 1
Expand Down
12 changes: 6 additions & 6 deletions tasks/shell_pcs/sbd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
lineinfile:
path: "/etc/modprobe.d/{{ item }}.conf"
create: true
mode: 0644
mode: "0644"
# wokeignore:rule=blacklist
regexp: "^(options|blacklist) {{ item }}"
# wokeignore:rule=blacklist
Expand All @@ -35,7 +35,7 @@
lineinfile:
path: "/etc/modules-load.d/{{ item }}.conf"
create: true
mode: 0644
mode: "0644"
regexp: "^{{ item }}"
line: "{{ item }}"
state: present
Expand Down Expand Up @@ -95,7 +95,7 @@
dest: /etc/sysconfig/sbd
owner: root
group: root
mode: 0644
mode: "0644"
vars:
options: "{{ ha_cluster_sbd_options | d([]) }}"
node_name: "{{ __ha_cluster_node_name }}"
Expand All @@ -119,15 +119,15 @@
state: directory
owner: root
group: root
mode: 0755
mode: "0755"

- name: Override start timeout for SBD
template:
src: templates/override-timeout.conf
dest: /etc/systemd/system/sbd.service.d/override-timeout.conf
owner: root
group: root
mode: 0644
mode: "0644"
vars:
# Make sure the timeout is at least the default 90 seconds.
# The intent is to make the timeout longer if needed, not shorter.
Expand Down Expand Up @@ -169,7 +169,7 @@
state: file
owner: hacluster
group: haclient
mode: 0600
mode: "0600"
when:
- not pacemaker_running

Expand Down
6 changes: 3 additions & 3 deletions tests/tasks/fixture_psks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
copy:
content: "{{ lookup('pipe', 'openssl rand -base64 256') | b64decode }}"
dest: "{{ __test_corosync_key_path }}"
mode: 0400
mode: "0400"

- name: Generate pacemaker key
copy:
content: "{{ lookup('pipe', 'openssl rand -base64 256') | b64decode }}"
dest: "{{ __test_pacemaker_key_path }}"
mode: 0400
mode: "0400"

- name: Generate fence_xvm key
copy:
content: "{{ lookup('pipe', 'openssl rand -base64 512') | b64decode }}"
dest: "{{ __test_fence_xvm_key_path }}"
mode: 0400
mode: "0400"
2 changes: 1 addition & 1 deletion tests/tasks/qnetd_backup_restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
file:
path: /etc/corosync/qnetd_backup
state: directory
mode: 0700
mode: "0700"

# Ansible copy doesn't support 'mode: preserve' with 'remote_src: true'
- name: Back up qnetd settings
Expand Down
12 changes: 6 additions & 6 deletions tests/tests_cluster_basic_existing_psks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
state: directory
owner: root
group: root
mode: 0755
mode: "0755"
loop:
- /etc/corosync
- /etc/pacemaker
Expand All @@ -52,23 +52,23 @@
dest: /etc/corosync/authkey
owner: root
group: root
mode: 0400
mode: "0400"

- name: Ensure pacemaker key is present
copy:
src: "{{ __test_pacemaker_key_path }}"
dest: /etc/pacemaker/authkey
owner: root
group: root
mode: 0400
mode: "0400"

- name: Ensure fence-virt key is present
copy:
src: "{{ __test_fence_xvm_key_path }}"
dest: /etc/cluster/fence_xvm.key
owner: root
group: root
mode: 0400
mode: "0400"
when: __test_fence_virt_supported

- name: Distribute pcsd TLS private key
Expand All @@ -77,15 +77,15 @@
dest: /var/lib/pcsd/pcsd.key
owner: root
group: root
mode: 0600
mode: "0600"

- name: Distribute pcsd TLS certificate
copy:
src: "{{ __test_pcsd_public_key_path }}"
dest: /var/lib/pcsd/pcsd.crt
owner: root
group: root
mode: 0600
mode: "0600"

- name: Get corosync key hash
stat:
Expand Down
8 changes: 4 additions & 4 deletions tests/tests_cluster_basic_new_psks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
state: directory
owner: root
group: root
mode: 0755
mode: "0755"
loop:
- /etc/pacemaker
- /var/lib/pcsd
Expand All @@ -54,7 +54,7 @@
dest: /etc/pacemaker/authkey
owner: root
group: root
mode: 0400
mode: "0400"

- name: Ensure fence-virt key is not present
file:
Expand All @@ -68,15 +68,15 @@
dest: /var/lib/pcsd/pcsd.key
owner: root
group: root
mode: 0600
mode: "0600"

- name: Distribute pcsd TLS certificate
copy:
src: "{{ __test_pcsd_public_key_path }}"
dest: /var/lib/pcsd/pcsd.crt
owner: root
group: root
mode: 0600
mode: "0600"

- name: Get corosync key hash
stat:
Expand Down
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ lsr_enable = true
[lsr_ansible-lint]
configfile = {toxinidir}/.ansible-lint

[lsr_black]
configfile = {toxinidir}/pyproject.toml

# NOTE: In order to run python unit tests locally, you will need
# to comment sitepackages=True then build and install the correct
# version of pcs in the testenv. See .github/workflows/python-unit-test.yml
Expand All @@ -13,3 +16,6 @@ configfile = {toxinidir}/.ansible-lint
# ansible-lint-collection: failed with ansible-lint is not allowed, use allowlist_externals to allow it
[testenv]
sitepackages=True
setenv =
RUN_PYTEST_SETUP_MODULE_UTILS = true
RUN_PYLINT_SETUP_MODULE_UTILS = true
Loading