Skip to content

Commit

Permalink
ci: use a matrix to run tests in parallel
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Sep 19, 2024
1 parent 0c61225 commit 9b4e939
Showing 1 changed file with 28 additions and 48 deletions.
76 changes: 28 additions & 48 deletions .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 9b4e939

Please sign in to comment.