Repository: linux-system-roles/storage
Pull request #518: ci: several changes related to new qemu test, ansible-lint, python versions, ubuntu versions
Author: login: richm
Created: 2025-04-08T18:13:45Z | Merged: 2025-04-15T16:48:41Z

There is a new QEMU based test which uses the qemu/kvm capability of
github action runners.  This is the basis for new bootc/image mode tests
which we will be rolling out in the near future.

ansible-lint requires that the collection path is set so that the requirements
it installs are installed in the correct place.

There has been some general github action deprecation of python versions and
ubuntu versions that we have had to fix.

Remove `CONTRIBUTOR` from the list of users who can trigger citest.

For more information, see

* https://github.com/linux-system-roles/.github/pull/98
* https://github.com/linux-system-roles/.github/pull/94
* https://github.com/linux-system-roles/.github/pull/93
* https://github.com/linux-system-roles/.github/pull/92
* https://github.com/linux-system-roles/.github/pull/91



Diff:
diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml
index 666b2313..c6c18528 100644
--- a/.github/workflows/ansible-lint.yml
+++ b/.github/workflows/ansible-lint.yml
@@ -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
@@ -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
diff --git a/.github/workflows/ansible-managed-var-comment.yml b/.github/workflows/ansible-managed-var-comment.yml
index 0864269d..99bf5d52 100644
--- a/.github/workflows/ansible-managed-var-comment.yml
+++ b/.github/workflows/ansible-managed-var-comment.yml
@@ -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: |
diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml
index 4dbdaa2d..b98f69bf 100644
--- a/.github/workflows/ansible-test.yml
+++ b/.github/workflows/ansible-test.yml
@@ -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: |
diff --git a/.github/workflows/python-unit-test.yml b/.github/workflows/python-unit-test.yml
index 1e06aaee..8a140b24 100644
--- a/.github/workflows/python-unit-test.yml
+++ b/.github/workflows/python-unit-test.yml
@@ -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
@@ -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.
diff --git a/.github/workflows/qemu-kvm-integration-tests.yml b/.github/workflows/qemu-kvm-integration-tests.yml
new file mode 100644
index 00000000..f31cbd6b
--- /dev/null
+++ b/.github/workflows/qemu-kvm-integration-tests.yml
@@ -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: ""
diff --git a/.github/workflows/tft.yml b/.github/workflows/tft.yml
index 503a0dcd..4f81d1bd 100644
--- a/.github/workflows/tft.yml
+++ b/.github/workflows/tft.yml
@@ -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:
diff --git a/.github/workflows/tft_citest_bad.yml b/.github/workflows/tft_citest_bad.yml
index 9f48f353..b78c813e 100644
--- a/.github/workflows/tft_citest_bad.yml
+++ b/.github/workflows/tft_citest_bad.yml
@@ -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
diff --git a/README.md b/README.md
index 9ba8e3a0..078a4cce 100644
--- a/README.md
+++ b/README.md
@@ -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.
 
diff --git a/plans/test_playbooks_parallel.fmf b/plans/test_playbooks_parallel.fmf
index 1e2a6ca1..f1e2b2f6 100644
--- a/plans/test_playbooks_parallel.fmf
+++ b/plans/test_playbooks_parallel.fmf
@@ -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
diff --git a/tests/tests_resize.yml b/tests/tests_resize.yml
index 22d1b329..a2b63813 100644
--- a/tests/tests_resize.yml
+++ b/tests/tests_resize.yml
@@ -37,211 +37,217 @@
 
     # For ext4 FS
 
-    - name: >-
-        Create one LVM logical volume under one volume group with size
-        {{ volume_size_before }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            disks: "{{ unused_disks }}"
-            type: lvm
-            volumes:
-              - name: test1
-                # resizing is currently supported only for ext2/3/4
-                fs_type: ext4
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
-
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
-
-    - name: Change volume_size to {{ volume_size_after }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: 'ext4'
-                size: "{{ volume_size_after }}"
-                mount_point: "{{ mount_location }}"
+    - name: Test ext4
+      block:
+        - name: >-
+            Create one LVM logical volume under one volume group with size
+            {{ volume_size_before }}
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                disks: "{{ unused_disks }}"
+                type: lvm
+                volumes:
+                  - name: test1
+                    # resizing is currently supported only for ext2/3/4
+                    fs_type: ext4
+                    size: "{{ volume_size_before }}"
+                    mount_point: "{{ mount_location }}"
 
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
 
-    - name: Change volume size to {{ volume_size_before }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: ext4
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
+        - name: Change volume_size to {{ volume_size_after }}
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                type: lvm
+                disks: "{{ unused_disks }}"
+                volumes:
+                  - name: test1
+                    fs_type: 'ext4'
+                    size: "{{ volume_size_after }}"
+                    mount_point: "{{ mount_location }}"
 
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
 
-    - name: Test for correct handling of too-large volume size
-      include_tasks: verify-role-failed.yml
-      vars:
-        __storage_failed_regex: volume.+cannot be resized to.+
-        __storage_failed_msg: >-
-          Unexpected behavior w/ invalid volume size
-        __storage_failed_params:
-          storage_pools:
-            - name: foo
-              disks: "{{ unused_disks }}"
-              volumes:
-                - name: test1
-                  fs_type: ext4
-                  size: "{{ too_large_size }}"
-                  mount_point: "{{ mount_location }}"
-
-    - name: Test for correct handling of volume size equal disk's size
-      block:
-        - name: >-
-            Try to create LVM with volume size equal disk's size, resize to
-            {{ disk_size }}
+        - name: Change volume size to {{ volume_size_before }}
           include_role:
             name: linux-system-roles.storage
           vars:
             storage_pools:
               - name: foo
+                type: lvm
                 disks: "{{ unused_disks }}"
                 volumes:
                   - name: test1
                     fs_type: ext4
-                    size: "{{ disk_size }}"
+                    size: "{{ volume_size_before }}"
                     mount_point: "{{ mount_location }}"
 
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
 
-    - name: Test for correct handling of invalid size specification
-      include_tasks: verify-role-failed.yml
-      vars:
-        __storage_failed_regex: invalid.+size
-        __storage_failed_msg: >-
-          Unexpected behavior w/ invalid volume size
-        __storage_failed_params:
-          storage_pools:
-            - name: foo
-              disks: "{{ unused_disks }}"
-              volumes:
-                - name: test1
-                  fs_type: ext4
-                  size: "{{ invalid_size1 }}"
-                  mount_point: "{{ mount_location }}"
-
-    - name: Test for correct handling of invalid size specification
-      include_tasks: verify-role-failed.yml
-      vars:
-        __storage_failed_regex: invalid.+size
-        __storage_failed_msg: >-
-          Unexpected behavior w/ invalid volume size
-        __storage_failed_params:
-          storage_pools:
-            - name: foo
-              disks: "{{ unused_disks }}"
-              volumes:
-                - name: test1
-                  fs_type: ext4
-                  size: "{{ invalid_size2 }}"
-                  mount_point: "{{ mount_location }}"
+        - name: Test for correct handling of too-large volume size
+          include_tasks: verify-role-failed.yml
+          vars:
+            __storage_failed_regex: volume.+cannot be resized to.+
+            __storage_failed_msg: >-
+              Unexpected behavior w/ invalid volume size
+            __storage_failed_params:
+              storage_pools:
+                - name: foo
+                  disks: "{{ unused_disks }}"
+                  volumes:
+                    - name: test1
+                      fs_type: ext4
+                      size: "{{ too_large_size }}"
+                      mount_point: "{{ mount_location }}"
 
-    - name: Clean up
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            disks: "{{ unused_disks }}"
-            state: absent
-            volumes:
-              - name: test1
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
+        - name: Test for correct handling of volume size equal disk's size
+          block:
+            - name: >-
+                Try to create LVM with volume size equal disk's size, resize to
+                {{ disk_size }}
+              include_role:
+                name: linux-system-roles.storage
+              vars:
+                storage_pools:
+                  - name: foo
+                    disks: "{{ unused_disks }}"
+                    volumes:
+                      - name: test1
+                        fs_type: ext4
+                        size: "{{ disk_size }}"
+                        mount_point: "{{ mount_location }}"
+
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
+
+        - name: Test for correct handling of invalid size specification
+          include_tasks: verify-role-failed.yml
+          vars:
+            __storage_failed_regex: invalid.+size
+            __storage_failed_msg: >-
+              Unexpected behavior w/ invalid volume size
+            __storage_failed_params:
+              storage_pools:
+                - name: foo
+                  disks: "{{ unused_disks }}"
+                  volumes:
+                    - name: test1
+                      fs_type: ext4
+                      size: "{{ invalid_size1 }}"
+                      mount_point: "{{ mount_location }}"
+
+        - name: Test for correct handling of invalid size specification
+          include_tasks: verify-role-failed.yml
+          vars:
+            __storage_failed_regex: invalid.+size
+            __storage_failed_msg: >-
+              Unexpected behavior w/ invalid volume size
+            __storage_failed_params:
+              storage_pools:
+                - name: foo
+                  disks: "{{ unused_disks }}"
+                  volumes:
+                    - name: test1
+                      fs_type: ext4
+                      size: "{{ invalid_size2 }}"
+                      mount_point: "{{ mount_location }}"
+
+      always:
+        - name: Clean up
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                disks: "{{ unused_disks }}"
+                state: absent
+                volumes:
+                  - name: test1
+                    size: "{{ volume_size_before }}"
+                    mount_point: "{{ mount_location }}"
 
     - name: Verify role results
       include_tasks: verify-role-results.yml
 
     # For ext3 FS
 
-    - name: >-
-        Create a LVM logical volume with for ext3 FS size
-        {{ volume_size_before }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: ext3
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
+    - name: Test ext3
+      block:
+        - name: >-
+            Create a LVM logical volume with for ext3 FS size
+            {{ volume_size_before }}
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                type: lvm
+                disks: "{{ unused_disks }}"
+                volumes:
+                  - name: test1
+                    fs_type: ext3
+                    size: "{{ volume_size_before }}"
+                    mount_point: "{{ mount_location }}"
 
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
 
-    - name: Change volume size to {{ volume_size_after }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: ext3
-                size: "{{ volume_size_after }}"
-                mount_point: "{{ mount_location }}"
+        - name: Change volume size to {{ volume_size_after }}
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                type: lvm
+                disks: "{{ unused_disks }}"
+                volumes:
+                  - name: test1
+                    fs_type: ext3
+                    size: "{{ volume_size_after }}"
+                    mount_point: "{{ mount_location }}"
 
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
 
-    - name: Change volume size to {{ volume_size_before }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: ext3
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
+        - name: Change volume size to {{ volume_size_before }}
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                type: lvm
+                disks: "{{ unused_disks }}"
+                volumes:
+                  - name: test1
+                    fs_type: ext3
+                    size: "{{ volume_size_before }}"
+                    mount_point: "{{ mount_location }}"
 
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
 
-    - name: Clean up
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            disks: "{{ unused_disks }}"
-            state: absent
-            volumes:
-              - name: test1
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
+      always:
+        - name: Clean up
+          include_role:
+            name: linux-system-roles.storage
+          vars:
+            storage_pools:
+              - name: foo
+                disks: "{{ unused_disks }}"
+                state: absent
+                volumes:
+                  - name: test1
+                    size: "{{ volume_size_before }}"
+                    mount_point: "{{ mount_location }}"
 
     - name: Verify role results
       include_tasks: verify-role-results.yml
diff --git a/tests/tests_stratis.yml b/tests/tests_stratis.yml
index a1f20251..b0533e98 100644
--- a/tests/tests_stratis.yml
+++ b/tests/tests_stratis.yml
@@ -66,85 +66,9 @@
             name: stratisd
             state: started
 
-        - name: Create one Stratis pool with one volume
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Repeat the previous invocation to verify idempotence
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Add second filesystem to the pool
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-                  - name: test2
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location_2 }}"
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Clean up
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                state: absent
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-                    state: absent
-                  - name: test2
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location_2 }}"
-                    state: absent
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Run test only if blivet supports this functionality
-          when: ((is_fedora and blivet_pkg_version is version("3.10.0-1", ">=")) or
-                (is_rhel10 and blivet_pkg_version is version("3.10.0-1", ">=")) or
-                (is_rhel9 and blivet_pkg_version is version("3.6.0-15", ">=")))
+        - name: One pool/volume test
           block:
-            - name: Create encrypted Stratis pool
+            - name: Create one Stratis pool with one volume
               include_role:
                 name: linux-system-roles.storage
               vars:
@@ -152,8 +76,6 @@
                   - name: foo
                     disks: "{{ unused_disks }}"
                     type: stratis
-                    encryption: true
-                    encryption_password: yabbadabbadoo
                     volumes:
                       - name: test1
                         size: "{{ volume_size }}"
@@ -170,8 +92,6 @@
                   - name: foo
                     disks: "{{ unused_disks }}"
                     type: stratis
-                    encryption: true
-                    encryption_password: yabbadabbadoo
                     volumes:
                       - name: test1
                         size: "{{ volume_size }}"
@@ -180,7 +100,7 @@
             - name: Verify role results
               include_tasks: verify-role-results.yml
 
-            - name: Clean up
+            - name: Add second filesystem to the pool
               include_role:
                 name: linux-system-roles.storage
               vars:
@@ -188,40 +108,18 @@
                   - name: foo
                     disks: "{{ unused_disks }}"
                     type: stratis
-                    state: absent
                     volumes:
                       - name: test1
                         size: "{{ volume_size }}"
                         mount_point: "{{ mount_location }}"
-                        state: absent
-
-            - name: Verify role results
-              include_tasks: verify-role-results.yml
-
-            - name: Create one Stratis pool on one disk
-              include_role:
-                name: linux-system-roles.storage
-              vars:
-                storage_pools:
-                  - name: foo
-                    disks: "{{ unused_disks[0] }}"
-                    type: stratis
-
-            - name: Verify role results
-              include_tasks: verify-role-results.yml
-
-            - name: Add the second disk to the pool
-              include_role:
-                name: linux-system-roles.storage
-              vars:
-                storage_pools:
-                  - name: foo
-                    disks: "{{ [unused_disks[0], unused_disks[1]] }}"
-                    type: stratis
+                      - name: test2
+                        size: "{{ volume_size }}"
+                        mount_point: "{{ mount_location_2 }}"
 
             - name: Verify role results
               include_tasks: verify-role-results.yml
 
+          always:
             - name: Clean up
               include_role:
                 name: linux-system-roles.storage
@@ -236,6 +134,117 @@
                         size: "{{ volume_size }}"
                         mount_point: "{{ mount_location }}"
                         state: absent
+                      - name: test2
+                        size: "{{ volume_size }}"
+                        mount_point: "{{ mount_location_2 }}"
+                        state: absent
+
+        - name: Verify role results
+          include_tasks: verify-role-results.yml
+
+        - name: Run test only if blivet supports this functionality
+          when: ((is_fedora and blivet_pkg_version is version("3.10.0-1", ">=")) or
+                (is_rhel10 and blivet_pkg_version is version("3.10.0-1", ">=")) or
+                (is_rhel9 and blivet_pkg_version is version("3.6.0-15", ">=")))
+          block:
+            - name: Test encrypted pool
+              block:
+                - name: Create encrypted Stratis pool
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks }}"
+                        type: stratis
+                        encryption: true
+                        encryption_password: yabbadabbadoo
+                        volumes:
+                          - name: test1
+                            size: "{{ volume_size }}"
+                            mount_point: "{{ mount_location }}"
+
+                - name: Verify role results
+                  include_tasks: verify-role-results.yml
+
+                - name: Repeat the previous invocation to verify idempotence
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks }}"
+                        type: stratis
+                        encryption: true
+                        encryption_password: yabbadabbadoo
+                        volumes:
+                          - name: test1
+                            size: "{{ volume_size }}"
+                            mount_point: "{{ mount_location }}"
+
+                - name: Verify role results
+                  include_tasks: verify-role-results.yml
+
+              always:
+                - name: Clean up
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks }}"
+                        type: stratis
+                        state: absent
+                        volumes:
+                          - name: test1
+                            size: "{{ volume_size }}"
+                            mount_point: "{{ mount_location }}"
+                            state: absent
+
+            - name: Verify role results
+              include_tasks: verify-role-results.yml
+
+            - name: Test one disk pool
+              block:
+                - name: Create one Stratis pool on one disk
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks[0] }}"
+                        type: stratis
+
+                - name: Verify role results
+                  include_tasks: verify-role-results.yml
+
+                - name: Add the second disk to the pool
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ [unused_disks[0], unused_disks[1]] }}"
+                        type: stratis
+
+                - name: Verify role results
+                  include_tasks: verify-role-results.yml
+
+              always:
+                - name: Clean up
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks }}"
+                        type: stratis
+                        state: absent
+                        volumes:
+                          - name: test1
+                            size: "{{ volume_size }}"
+                            mount_point: "{{ mount_location }}"
+                            state: absent
 
             - name: Verify role results
               include_tasks: verify-role-results.yml
@@ -248,31 +257,34 @@
                 nbde_server_manage_selinux: true
                 nbde_server_port: 7500
 
-            - name: Create encrypted Stratis pool with Clevis/Tang
-              include_role:
-                name: linux-system-roles.storage
-              vars:
-                storage_pools:
-                  - name: foo
-                    disks: "{{ unused_disks[0] }}"
-                    type: stratis
-                    encryption: true
-                    encryption_password: yabbadabbadoo
-                    encryption_clevis_pin: tang
-                    encryption_tang_url: localhost:7500
-
-            - name: Verify role results
-              include_tasks: verify-role-results.yml
-
-            - name: Clean up
-              include_role:
-                name: linux-system-roles.storage
-              vars:
-                storage_pools:
-                  - name: foo
-                    disks: "{{ unused_disks[0] }}"
-                    type: stratis
-                    state: absent
+            - name: Clevis/Tang test
+              block:
+                - name: Create encrypted Stratis pool with Clevis/Tang
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks[0] }}"
+                        type: stratis
+                        encryption: true
+                        encryption_password: yabbadabbadoo
+                        encryption_clevis_pin: tang
+                        encryption_tang_url: localhost:7500
+
+                - name: Verify role results
+                  include_tasks: verify-role-results.yml
+
+              always:
+                - name: Clean up
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks[0] }}"
+                        type: stratis
+                        state: absent
 
             - name: Verify role results
               include_tasks: verify-role-results.yml


Reviews:
user: login: richm
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-14T20:20:23Z
user: login: martinpitt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T04:59:54Z
user: login: martinpitt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T07:04:45Z
user: login: richm
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T13:03:06Z
user: login: martinpitt
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-15T13:19:52Z
user: login: vojtechtrefny
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-15T13:47:22Z

Review comments:
diff_hunk: @@ -86,7 +86,7 @@ jobs:
         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 --
+          --log-level=debug --skip-tags tests::skip-infiniband,tests::nvme,tests::scsi --
path: .github/workflows/qemu-kvm-integration-tests.yml
user: login: richm
body: `tests::infiniband` not `tests::skip-infiniband`
created_at: 2025-04-14T20:20:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -86,7 +86,7 @@ jobs:
         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 --
+          --log-level=debug --skip-tags tests::skip-infiniband,tests::nvme,tests::scsi --
path: .github/workflows/qemu-kvm-integration-tests.yml
user: login: martinpitt
body: Argh, sorry, fixed.
created_at: 2025-04-15T04:59:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -66,94 +66,16 @@
             name: stratisd
             state: started
 
-        - name: Create one Stratis pool with one volume
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Repeat the previous invocation to verify idempotence
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Add second filesystem to the pool
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-                  - name: test2
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location_2 }}"
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Clean up
-          include_role:
-            name: linux-system-roles.storage
-          vars:
-            storage_pools:
-              - name: foo
-                disks: "{{ unused_disks }}"
-                type: stratis
-                state: absent
-                volumes:
-                  - name: test1
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location }}"
-                    state: absent
-                  - name: test2
-                    size: "{{ volume_size }}"
-                    mount_point: "{{ mount_location_2 }}"
-                    state: absent
-
-        - name: Verify role results
-          include_tasks: verify-role-results.yml
-
-        - name: Run test only if blivet supports this functionality
-          when: ((is_fedora and blivet_pkg_version is version("3.10.0-1", ">=")) or
-                (is_rhel10 and blivet_pkg_version is version("3.10.0-1", ">=")) or
-                (is_rhel9 and blivet_pkg_version is version("3.6.0-15", ">=")))
+        - name: One pool/volume test
           block:
-            - name: Create encrypted Stratis pool
+            - name: Create one Stratis pool with one volume
path: tests/tests_stratis.yml
user: login: martinpitt
body: For reviewers: git and github make an utter mess of the diff view of "tests: Fix stratis block device clean up". What this does is to wrap the steps of a test into `block: ... always: Cleanup`. This changes the indendation, and due to the repetitive nature of the test the diff view locks onto" the wrong context. I didn't change any logic.
created_at: 2025-04-15T07:04:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -37,211 +37,217 @@
 
     # For ext4 FS
 
-    - name: >-
-        Create one LVM logical volume under one volume group with size
-        {{ volume_size_before }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            disks: "{{ unused_disks }}"
-            type: lvm
-            volumes:
-              - name: test1
-                # resizing is currently supported only for ext2/3/4
-                fs_type: ext4
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
-
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
-
-    - name: Change volume_size to {{ volume_size_after }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: 'ext4'
-                size: "{{ volume_size_after }}"
-                mount_point: "{{ mount_location }}"
+    - name: ext4 FS
path: tests/tests_resize.yml
user: login: richm
body: ```suggestion
    - name: Test ext4 FS
```
ansible-lint requires names to start with an upper case letter
created_at: 2025-04-15T13:03:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -37,211 +37,217 @@
 
     # For ext4 FS
 
-    - name: >-
-        Create one LVM logical volume under one volume group with size
-        {{ volume_size_before }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            disks: "{{ unused_disks }}"
-            type: lvm
-            volumes:
-              - name: test1
-                # resizing is currently supported only for ext2/3/4
-                fs_type: ext4
-                size: "{{ volume_size_before }}"
-                mount_point: "{{ mount_location }}"
-
-    - name: Verify role results
-      include_tasks: verify-role-results.yml
-
-    - name: Change volume_size to {{ volume_size_after }}
-      include_role:
-        name: linux-system-roles.storage
-      vars:
-        storage_pools:
-          - name: foo
-            type: lvm
-            disks: "{{ unused_disks }}"
-            volumes:
-              - name: test1
-                fs_type: 'ext4'
-                size: "{{ volume_size_after }}"
-                mount_point: "{{ mount_location }}"
+    - name: ext4 FS
path: tests/tests_resize.yml
user: login: martinpitt
body: Yup, already fixed locally. I just don't want to push more often than necessary, as the tests are so expensive (running on my fork ATM to avoid some noise)
created_at: 2025-04-15T13:19:52Z
author_association: CONTRIBUTOR
diff_hunk: @@ -248,31 +257,34 @@
                 nbde_server_manage_selinux: true
                 nbde_server_port: 7500
 
-            - name: Create encrypted Stratis pool with Clevis/Tang
-              include_role:
-                name: linux-system-roles.storage
-              vars:
-                storage_pools:
-                  - name: foo
-                    disks: "{{ unused_disks[0] }}"
-                    type: stratis
-                    encryption: true
-                    encryption_password: yabbadabbadoo
-                    encryption_clevis_pin: tang
-                    encryption_tang_url: localhost:7500
-
-            - name: Verify role results
-              include_tasks: verify-role-results.yml
-
-            - name: Clean up
-              include_role:
-                name: linux-system-roles.storage
-              vars:
-                storage_pools:
-                  - name: foo
-                    disks: "{{ unused_disks[0] }}"
-                    type: stratis
-                    state: absent
+            - name: Clevis/Tang test
+              block:
+                - name: Create encrypted Stratis pool with Clevis/Tang
+                  include_role:
+                    name: linux-system-roles.storage
+                  vars:
+                    storage_pools:
+                      - name: foo
+                        disks: "{{ unused_disks[0] }}"
+                        type: stratis
+                        encryption: true
+                        encryption_password: yabbadabbadoo
+                        encryption_clevis_pin: tang
+                        encryption_tang_url: localhost:7500
+
+                - name: Verify role results
+                  include_tasks: verify-role-results.yml
+
+              always:
path: tests/tests_stratis.yml
user: login: vojtechtrefny
body: I guess we should add this style of cleanup to all tests, but that's definitely out of scope for this PR.
created_at: 2025-04-15T13:47:22Z
author_association: COLLABORATOR

PR comments:
user: login: martinpitt
created_at: 2025-04-09T10:31:36Z
body: Uh, qemu tests run into ENOSPC on the host. I suppose we can tone down the space requirements in the test and make smaller images etc., but I haven't looked yet. I can if you want me to.
author_association: CONTRIBUTOR
user: login: martinpitt
created_at: 2025-04-11T08:17:00Z
body: On F42, the runner did *not* ENOSPC, it just failed the tests. The first failed test on CI is tests/tests_luks.yml. `tox -e qemu-ansible-core-2.17 -- --image-name fedora-42 --log-level=debug --debug tests/tests_luks.yml` by itself passes, so this is some complication in batch mode.

In F42, I see a large "/dev/dm-1       4.0G  110M  3.9G   3% /opt/test1" which is being created during the test in the VM (PV on /dev/sda), but it does get cleaned up again. I'm running `watch -n1 du -hsc /tmp/tmp*` on the host to check the usage of the sparse backend files, but curiously they always stay at 0 bytes, i.e. aren't even being used; they are also cleaned up properly after the test ends. 

I cannot reproduce the "Unable to find enough unused disks. Exiting playbook." either. 

For the ENOSPC on C9, I ran `tox -e qemu-ansible-core-2.16 -- --image-name centos-9 --log-level=debug --debug tests/tests_filesystem_one_disk.yml` locally, and that also passed and didn't leave cruft behind.

Moving this to draft, most likely we'll just drop these tests on GH for storage, they are just too big. But I want to [experiment with this a bit on my fork](https://github.com/martinpitt/lsr-storage/actions), with getting an interactive shell on a gh runner. I'll see if running a subset of tests works, or what is actually ENOSPCing.

My current idea is to generalize `--skip-tags tests::infiniband` to `--skip-tags tests::no-github`, and mark tests accordingly. An [initial run](https://github.com/martinpitt/lsr-storage/actions/runs/14445903106) with most tests skipped looks quite promising (the c10s failure is a VM download glitch, unrelated).

Next attempt, [run](https://github.com/martinpitt/lsr-storage/actions/runs/14447427862) with skipping `tests::nvme,tests::scsi`
author_association: CONTRIBUTOR
user: login: martinpitt
created_at: 2025-04-14T17:20:25Z
body: @richm the [run on my fork](https://github.com/martinpitt/lsr-storage/actions/runs/14447427862) is pretty okay -- some "honest" failures on f42 which I haven't yet looked into. But C9/C10 pass now, and it's a sane set of tests now. This includes the change from https://github.com/linux-system-roles/.github/pull/99 but if you prefer I'm happy to remove that here. Or feel free to remove it yourself if you'd like to land this soon otherwise.
author_association: CONTRIBUTOR
user: login: martinpitt
created_at: 2025-04-15T05:21:57Z
body: [f42 failures](https://github.com/linux-system-roles/storage/actions/runs/14451659646/job/40525583591):

## ✅ Unused disk

Many many tests fail with

> Unable to find enough unused disks. Exiting playbook

This must be some leakage in batch mode. Running these individually works fine. I already [investigated this a bit above](https://github.com/linux-system-roles/storage/pull/518#issuecomment-2796182183), but no result yet. This will be my task today.

Fixed in "tests: Fix stratis block device clean up" commit.

## tests_stratis

This has an "honest" failure:

> The conditional check 'storage_test_pool.name in _stratis_pool_info.pools[0]['blockdevs']['datadevs'][0]['key_description']' failed. The error was: error while evaluating conditional (storage_test_pool.name in _stratis_pool_info.pools[0]['blockdevs']['datadevs'][0]['key_description']): 'dict object' has no attribute 'key_description'

This could be related to https://github.com/stratis-storage/stratisd/issues/3805 and be due to an API change. This reproduces locally.

## tests_resize

[failure](https://github.com/linux-system-roles/storage/actions/runs/14463270008/job/40559799742?pr=518#step:11:7851):

> TASK [linux-system-roles.storage : Manage the pools and volumes to match the specified state] ***
> volume 'foo-test1' cannot be resized from 9 GiB to 5 GiB: new size same as old size

This does not reproduce in isolation with `tox -e qemu-ansible-core-2.17 -- --image-name fedora-42 --log-level=debug tests/tests_resize.yml`

## tests_lvm_pool_pv_grow.yml

[failure](https://github.com/linux-system-roles/storage/actions/runs/14463270008/job/40559799742?pr=518#step:11:6960)

> /dev/foo: already exists in filesystem

This smells like another cleanup failure. Now, just about every test uses "foo" as name, but I figure it's one of the other failures. I'll go through the "Clean up" actions once again with a fine comb and see which ones need fixing.

When I run it locally in isolation, it fails differently:

```
TASK [Verify each PV size] ***************************************************************************************************************************
task path: /var/home/martin/upstream/lsr/storage/tests/verify-pool-member-pvsize.yml:18
Tuesday 15 April 2025  10:45:41 +0200 (0:00:00.413)       0:00:36.427 ********* 
fatal: [/var/home/martin/.cache/linux-system-roles/fedora-42.qcow2]: FAILED! => {
    "assertion": "(dev_size.bytes - actual_pv_size.stdout | int) <= (4194304 + pv_pe_start.stdout | int)",
    "changed": false,
    "evaluated_to": false
}

MSG:

Unexpected difference between PV size and block device size: (device size: 1099511627776) (actual PV size:   8585740288)
```

#519 should fix CI run to fail "correctly".

## ✅ tests_remove_mount.yml

[failure](https://github.com/linux-system-roles/storage/actions/runs/14463270008/job/40559799742?pr=518#step:11:7700)

> cannot remove members 'sda' from pool 'foo' in safe mode

This also smells like cleanup failure, doesn't fail in isolation. Fixed by #519.

## ✅ tests_existing_lvm_pool.yml

[failure](https://github.com/linux-system-roles/storage/actions/runs/14463270008/job/40559799742?pr=518#step:11:1160)

> cannot remove members 'sda' from pool 'foo' in safe mode

Exactly the same failure as tests_remove_mount.yml, so cleanup failure. Also passes locally in isolation.

Fixing tests_resize cleanup didn't fix the follow-ups above. Testing [run without stratis](https://github.com/martinpitt/lsr-storage/actions/runs/14470268068), and [run without resize tests](https://github.com/martinpitt/lsr-storage/actions/runs/14468522485), to see which one breaks stuff. *Update*: neither change helped at all, the failures are independent. 

Fixed by #519.
author_association: CONTRIBUTOR
user: login: martinpitt
created_at: 2025-04-15T08:30:45Z
body: OK, [this run](https://github.com/linux-system-roles/storage/actions/runs/14463270008/job/40559799742?pr=518) is down to 5 failures, from the previous 26. I.e. the "Unable to find enough unused disks" are gone with the stratis cleanup fix. This may be good enough to land now, also to avoid regressing the c9/c10 tests?
author_association: CONTRIBUTOR
user: login: vojtechtrefny
created_at: 2025-04-15T10:21:11Z
body: > ## tests_stratis
> 
> This has an "honest" failure:
> 
> > The conditional check 'storage_test_pool.name in _stratis_pool_info.pools[0]['blockdevs']['datadevs'][0]['key_description']' failed. The error was: error while evaluating conditional (storage_test_pool.name in _stratis_pool_info.pools[0]['blockdevs']['datadevs'][0]['key_description']): 'dict object' has no attribute 'key_description'
> 
> This could be related to [stratis-storage/stratisd#3805](https://github.com/stratis-storage/stratisd/issues/3805) and be due to an API change. This reproduces locally.

This is caused by the changes to Stratis metadata and encryption in Stratis 3.8.0, but the problem should be only in tests in `verify-pool-stratis`, not in the role itself (or blivet). I'll try to find a way to verify the test results that works with both old and new Stratis.
author_association: COLLABORATOR
user: login: richm
created_at: 2025-04-15T13:26:10Z
body: > OK, [this run](https://github.com/linux-system-roles/storage/actions/runs/14463270008/job/40559799742?pr=518) is down to 5 failures, from the previous 26. I.e. the "Unable to find enough unused disks" are gone with the stratis cleanup fix. This may be good enough to land now, also to avoid regressing the c9/c10 tests?

Yes.  Once you push the ansible-lint fix, we can merge this.
author_association: CONTRIBUTOR
user: login: martinpitt
created_at: 2025-04-15T13:53:05Z
body: Pushed the ansible lint fix. I was trying to make some more progress [on the other failures](https://github.com/linux-system-roles/storage/pull/518#issuecomment-2803840784), but they are fighting back well. So yeah, let's address these in follow-ups.
author_association: CONTRIBUTOR