From 9b4e93948a8cfb97e27dda31e33352a628ca9adf Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Thu, 19 Sep 2024 16:37:36 +0000 Subject: [PATCH] ci: use a matrix to run tests in parallel Signed-off-by: Vincent Fu --- .github/workflows/qemu.yml | 76 ++++++++++++++------------------------ 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/.github/workflows/qemu.yml b/.github/workflows/qemu.yml index 9ba231af23..68b488c60b 100644 --- a/.github/workflows/qemu.yml +++ b/.github/workflows/qemu.yml @@ -8,10 +8,33 @@ jobs: build-qemu-guest: runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - device: >- # basic io_uring_cmd tests + -device nvme,id=nvme0,serial=deadbeef + -drive id=nvm-0,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk + -device nvme-ns,id=nvm-0,drive=nvm-0,bus=nvme0,nsid=1 + test_cmd: "python3 t/run-fio-tests.py --nvmecdev /dev/ng0n1 --run-only 1014 1015" + - device: >- # 16-bit Guard PI tests (long!) + -device nvme,id=nvme0,serial=deadbeef + -drive id=nvm-0,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk + -device nvme-ns,id=nvm-0,drive=nvm-0,bus=nvme0,nsid=1 + test_cmd: "cd fio && python3 t/nvmept_pi.py --fio ./fio --dut /dev/ng0n1" + - device: >- # 4K+16 w/64-bit Guard PI + -device nvme,id=nvme1,serial=deadbeee + -drive id=nvm-1,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk + -device nvme-ns,id=nvm-1,drive=nvm-1,bus=nvme1,nsid=1,pif=2,ms=16,mset=1,pi=1,pil=0,logical_block_size=4096,physical_block_size=4096 + test_cmd: "python3 t/nvmept_pi.py --fio ./fio --dut /dev/ng0n1 --lbaf 6" + - device: >- + -device nvme,id=nvme2,serial=deadeeef + -drive id=nvm-2,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk + -device nvme-ns,id=nvm-2,drive=nvm-2,bus=nvme2,nsid=1,pif=2,ms=64,mset=1,pi=1,pil=0,logical_block_size=4096,physical_block_size=4096 + test_cmd: "python3 t/nvmept_pi.py --fio ./fio --dut /dev/ng0n1 --lbaf 7" + env: DISTRO: debian-12 PKGS: git,libaio-dev,libcunit1-dev,libcurl4-openssl-dev,libfl-dev,libnuma-dev,libnfs-dev,valgrind,libglusterfs-dev,libgoogle-perftools-dev,libiscsi-dev,libnbd-dev,libpmem-dev,libpmem2-dev,libprotobuf-c-dev,librbd-dev,libtcmalloc-minimal4,libibverbs-dev,librdmacm-dev,nvme-cli,pkgconf,python3-scipy,python3-sphinx,python3-statsmodels,bison,build-essential,cmake,flex,unzip,wget,zlib1g-dev,sudo - SSH_FWD_PORT: 2022 SSHCMD: ssh root@localhost -p 2022 strategy: @@ -41,62 +64,19 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: Start VM with default NVMe device settings 16-bit Guard PI + - name: Start VM uses: ./.github/actions/start-vm with: image: ${{ env.DISTRO }}.img host_key: true build_fio: true - options: >- - -device nvme,id=nvme0,serial=deadbeef - -drive id=nvm-0,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk - -device nvme-ns,id=nvm-0,drive=nvm-0,bus=nvme0,nsid=1 - - name: Show nvme device configuration - run: | - $SSHCMD "nvme id-ns /dev/ng0n1 -H" - $SSHCMD "nvme nvm-id-ns /dev/ng0n1 -v" - - name: Run basic nvme tests - run: $SSHCMD "cd fio && python3 t/run-fio-tests.py --nvmecdev /dev/ng0n1 --run-only 1014 1015" -# - name: Run PI tests w/16-bit Guard PI -# run: $SSHCMD "cd fio && python3 t/nvmept_pi.py --fio ./fio --dut /dev/ng0n1" - - name: Shut down VM and wait 5s - run: | - $SSHCMD "shutdown now" - sleep 5 - - - name: Start VM with NVMe device supporting 4K+16 w/64-bit guard PI - uses: ./.github/actions/start-vm - with: - image: ${{ env.DISTRO }}.img - options: >- - -device nvme,id=nvme1,serial=deadbeee - -drive id=nvm-1,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk - -device nvme-ns,id=nvm-1,drive=nvm-1,bus=nvme1,nsid=1,pif=2,ms=16,mset=1,pi=1,pil=0,logical_block_size=4096,physical_block_size=4096 - - name: Show nvme device configuration - run: | - $SSHCMD "nvme id-ns /dev/ng0n1 -H" - $SSHCMD "nvme nvm-id-ns /dev/ng0n1 -v" - - name: Run PI tests on 4K+16 w/64-bit Guard PI - run: $SSHCMD "cd fio && python3 t/nvmept_pi.py --fio ./fio --dut /dev/ng0n1 --lbaf 6" - - name: Shut down VM and wait 5s - run: | - $SSHCMD "shutdown now" - sleep 5 - - - name: Start VM with NVMe device supporting 4K+64 w/64-bit guard PI - uses: ./.github/actions/start-vm - with: - image: ${{ env.DISTRO }}.img - options: >- - -device nvme,id=nvme2,serial=deadeeef - -drive id=nvm-2,file=nvme0.img,format=raw,if=none,discard=unmap,media=disk - -device nvme-ns,id=nvm-2,drive=nvm-2,bus=nvme2,nsid=1,pif=2,ms=64,mset=1,pi=1,pil=0,logical_block_size=4096,physical_block_size=4096 + options: ${{ matrix.device }} - name: Show nvme device configuration run: | $SSHCMD "nvme id-ns /dev/ng0n1 -H" $SSHCMD "nvme nvm-id-ns /dev/ng0n1 -v" - - name: Run PI tests on 4K+64 w/64-bit Guard PI - run: $SSHCMD "cd fio && python3 t/nvmept_pi.py --fio ./fio --dut /dev/ng0n1 --lbaf 7" + - name: Run test + run: $SSHCMD "cd fio && ${{ matrix.test_cmd }}" - name: Shut down VM and wait 5s run: | $SSHCMD "shutdown now"