Skip to content

Commit

Permalink
GitHub workflows: foreign.yaml: run dmevents test as root
Browse files Browse the repository at this point in the history
Running the directio test doesn't work because aio is not supported
under qemu-linux-user. So dmevents is the only current test that
makes sense to run as root.

Signed-off-by: Martin Wilck <mwilck@suse.com>
  • Loading branch information
mwilck committed Jul 18, 2024
1 parent 1be2f9a commit 5cb497d
Showing 1 changed file with 56 additions and 12 deletions.
68 changes: 56 additions & 12 deletions .github/workflows/foreign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,14 @@ jobs:
- name: checkout
uses: actions/checkout@v1
- name: build
run: make -j8 -Orecurse TESTDIR=/build/tests test-progs
run: make -j8 -Orecurse test-progs
- name: create binary archive
run: >
tar cfv binaries.tar
Makefile* config.mk
libmpathcmd/*.so* libmultipath/*.so* libmpathutil/*.so*
libmultipath/checkers/*.so libmultipath/prioritizers/*.so
libmultipath/foreign/*.so
tests/lib tests/*-test tests/Makefile tests/*.so*
run: make test-progs.tar
- name: upload binary archive
uses: actions/upload-artifact@v1
with:
name: cross-${{ matrix.os }}-${{ matrix.arch }}
path: binaries.tar
path: test-progs.tar

test:
runs-on: ubuntu-22.04
Expand All @@ -71,15 +65,65 @@ jobs:
with:
name: cross-${{ matrix.os }}-${{ matrix.arch }}
- name: unpack binary archive
run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/binaries.tar
run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar
- name: enable foreign arch
uses: dbhi/qus/action@main
- name: run tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
guest-dir: /build
guest-dir: /__w/multipath-tools/multipath-tools
host-dir: ${{ github.workspace }}
command: -C tests
params: "--platform linux/${{ env.CONTAINER_ARCH }}"
params: >
--workdir /__w/multipath-tools/multipath-tools
--platform linux/${{ env.CONTAINER_ARCH }}
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"

root-test:
runs-on: ubuntu-22.04
needs: cross-build
strategy:
fail-fast: false
matrix:
os: [bookworm, sid]
arch: [ppc64le, arm64, s390x]
steps:
- name: mpath
run: sudo modprobe dm_multipath
- name: brd
run: sudo modprobe brd rd_nr=1 rd_size=65536
- name: set container arch
run: echo CONTAINER_ARCH="${{ matrix.arch }}" >> $GITHUB_ENV
if: ${{ matrix.arch != 'armhf' }}
- name: set container arch
run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV
if: ${{ matrix.arch == 'armhf' }}
- name: download binary archive
uses: actions/download-artifact@v1
with:
name: cross-${{ matrix.os }}-${{ matrix.arch }}
- name: unpack binary archive
run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar
- name: enable foreign arch
uses: dbhi/qus/action@main
- name: run tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
guest-dir: /__w/multipath-tools/multipath-tools
host-dir: ${{ github.workspace }}
command: -C tests dmevents.out
params: >
--workdir /__w/multipath-tools/multipath-tools
--platform linux/${{ env.CONTAINER_ARCH }}
--privileged
-v /dev/ram0:/dev/ram0 -e DIO_TEST_DEV=/dev/ram0
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"
id: root-test
continue-on-error: true
- name: show root test output
run: for o in tests/*.out; do echo "===== $o ====="; cat "$o"; done
- name: fail
run: /bin/false
if: ${{ steps.root-test.outcome == 'failure' }}

0 comments on commit 5cb497d

Please sign in to comment.