Skip to content
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
4 changes: 3 additions & 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.4.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"

- name: Convert role to collection format
id: collection
Expand Down Expand Up @@ -80,3 +80,5 @@ jobs:
with:
working_directory: ${{ github.workspace }}/.tox/ansible_collections/${{ env.LSR_ROLE2COLL_NAMESPACE }}/${{ env.LSR_ROLE2COLL_NAME }}
requirements_file: ${{ steps.collection.outputs.coll_req_file }}
env:
ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }}/.tox
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.4.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"
- 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.4.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"

- name: Convert role to collection format
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
pyver_os:
- ver: "2.7"
os: ubuntu-22.04
- ver: "3.8"
os: ubuntu-latest
- ver: "3.9"
os: ubuntu-latest
- ver: "3.10"
os: ubuntu-latest
- ver: "3.11"
os: ubuntu-latest
- ver: "3.12"
os: ubuntu-latest
runs-on: ${{ matrix.pyver_os.os }}
steps:
- name: Update git
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
tox=tox
virtualenv=virtualenv
fi
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.4.0"
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"
# 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
139 changes: 139 additions & 0 deletions .github/workflows/qemu-kvm-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
name: QEMU/KVM Integration tests
on: # yamllint disable-line rule:truthy
pull_request:
merge_group:
branches:
- main
types:
- checks_requested
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
# This is required for the ability to create/update the Pull request status
statuses: write
jobs:
qemu_kvm:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
scenario:
- { image: "centos-9", env: "qemu-ansible-core-2.16" }
- { image: "centos-10", env: "qemu-ansible-core-2.17" }
# ansible/libdnf5 bug: https://issues.redhat.com/browse/RHELMISC-10110
# - { image: "fedora-41", env: "qemu-ansible-core-2.17" }
- { image: "fedora-42", env: "qemu-ansible-core-2.17" }
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Check if platform is supported
id: check_platform
run: |
set -euxo pipefail
image="${{ matrix.scenario.image }}"

# convert image to tag formats
platform=
platform_version=
case "$image" in
centos-*) platform=el; platform_version=el"${image#centos-}" ;;
fedora-*) platform=fedora; platform_version="${image/-/}" ;;
esac
supported=
if yq -e '.galaxy_info.galaxy_tags[] | select(. == "'${platform_version}'" or . == "'${platform}'")' meta/main.yml; then
supported=true
fi

echo "supported=$supported" >> "$GITHUB_OUTPUT"

- name: Set up /dev/kvm
if: steps.check_platform.outputs.supported
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm --settle
ls -l /dev/kvm

- name: Disable man-db to speed up package install
if: steps.check_platform.outputs.supported
run: |
echo "set man-db/auto-update false" | sudo debconf-communicate
sudo dpkg-reconfigure man-db

- name: Install test dependencies
if: steps.check_platform.outputs.supported
run: |
set -euxo pipefail
python3 -m pip install --upgrade pip
sudo apt update
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.5.1"

- name: Configure tox-lsr
if: steps.check_platform.outputs.supported
run: >-
curl -o ~/.config/linux-system-roles.json
https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json

- name: Run qemu/kvm tox integration tests
if: steps.check_platform.outputs.supported
run: >-
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
--log-level=debug --skip-tags tests::infiniband,tests::nvme,tests::scsi --

- name: Test result summary
if: steps.check_platform.outputs.supported && always()
run: |
set -euo pipefail
# some platforms may have setup/cleanup playbooks - need to find the
# actual test playbook that starts with tests_
while read code start end test_files; do
for f in $test_files; do
f="$(basename $f)"
if [[ "$f" =~ ^tests_ ]]; then
break
fi
done
if [ "$code" = "0" ]; then
echo -n "PASS: "
else
echo -n "FAIL: "
fi
echo "$f"
done < batch.report

- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: "logs-${{ matrix.scenario.image }}-${{ matrix.scenario.env }}"
path: tests/*.log
retention-days: 30

- name: Show test log failures
if: steps.check_platform.outputs.supported && failure()
run: |
set -euo pipefail
for f in tests/*.log; do
if FAIL=$(grep -B100 -A30 "fatal:" "$f"); then
echo "::group::$(basename $f)"
echo "$FAIL"
echo "::endgroup::"
fi
done

- name: Set commit status as success with a description that platform is skipped
if: ${{ steps.check_platform.outputs.supported == '' }}
uses: myrotvorets/set-commit-status-action@master
with:
status: success
context: "${{ github.workflow }} / qemu_kvm (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
description: The role does not support this platform. Skipping.
targetUrl: ""
2 changes: 1 addition & 1 deletion .github/workflows/tft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: |
github.event.issue.pull_request
&& contains(github.event.comment.body, '[citest]')
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
|| contains('systemroller', github.event.comment.user.login))
runs-on: ubuntu-latest
outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tft_citest_bad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: |
github.event.issue.pull_request
&& contains(fromJson('["[citest_bad]", "[citest-bad]", "[citest bad]"]'), github.event.comment.body)
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
permissions:
actions: write # for re-running failed jobs: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Linux Storage Role

[![ansible-lint.yml](https://github.com/linux-system-roles/storage/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/storage/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/storage/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/storage/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/storage/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/storage/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/python-unit-test.yml) [![shellcheck.yml](https://github.com/linux-system-roles/storage/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/storage/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/storage/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/storage/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/woke.yml)
[![ansible-lint.yml](https://github.com/linux-system-roles/storage/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/ansible-lint.yml) [![ansible-test.yml](https://github.com/linux-system-roles/storage/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/ansible-test.yml) [![codeql.yml](https://github.com/linux-system-roles/storage/actions/workflows/codeql.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/codeql.yml) [![codespell.yml](https://github.com/linux-system-roles/storage/actions/workflows/codespell.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/codespell.yml) [![markdownlint.yml](https://github.com/linux-system-roles/storage/actions/workflows/markdownlint.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/markdownlint.yml) [![python-unit-test.yml](https://github.com/linux-system-roles/storage/actions/workflows/python-unit-test.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/python-unit-test.yml) [![qemu-kvm-integration-tests.yml](https://github.com/linux-system-roles/storage/actions/workflows/qemu-kvm-integration-tests.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/qemu-kvm-integration-tests.yml) [![shellcheck.yml](https://github.com/linux-system-roles/storage/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/shellcheck.yml) [![tft.yml](https://github.com/linux-system-roles/storage/actions/workflows/tft.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/tft.yml) [![tft_citest_bad.yml](https://github.com/linux-system-roles/storage/actions/workflows/tft_citest_bad.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/tft_citest_bad.yml) [![woke.yml](https://github.com/linux-system-roles/storage/actions/workflows/woke.yml/badge.svg)](https://github.com/linux-system-roles/storage/actions/workflows/woke.yml)

This role allows users to configure local storage with minimal input.

Expand Down
19 changes: 0 additions & 19 deletions plans/test_playbooks_parallel.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,36 @@ provision:
# Hence there is no need to define `how` explicitly.
- name: control-node1
role: control_node
# `connection: system` is required for `how: virtual` to assign VMs a real
# IP making SSH configuration easier.
# This setting is ignored in `artemis`, so we can leave it as is.
connection: system
- name: managed-node1
role: managed_node
connection: system
- name: managed-node2
role: managed_node
connection: system
- name: managed-node3
role: managed_node
connection: system
- name: managed-node4
role: managed_node
connection: system
- name: managed-node5
role: managed_node
connection: system
- name: managed-node6
role: managed_node
connection: system
- name: managed-node7
role: managed_node
connection: system
- name: managed-node8
role: managed_node
connection: system
- name: managed-node9
role: managed_node
connection: system
- name: managed-node10
role: managed_node
connection: system
- name: managed-node11
role: managed_node
connection: system
- name: managed-node12
role: managed_node
connection: system
- name: managed-node13
role: managed_node
connection: system
- name: managed-node14
role: managed_node
connection: system
- name: managed-node15
role: managed_node
connection: system
environment:
SR_ANSIBLE_VER: 2.17
SR_REPO_NAME: storage
Expand Down
Loading
Loading