rublk: send failure notification in case of child daemon failure #130
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: rublk Test | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
#build one Fedora image and run libublk-rs test | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 40 | |
steps: | |
- name: "install: mkosi + dependencies" | |
shell: bash | |
run: | | |
sudo apt update -o Acquire::Retries=3 | |
sudo apt install -y dnf rpm systemd-container qemu-system-x86 ovmf e2fsprogs btrfs-progs | |
rustup update stable && rustup default stable | |
wget https://github.com/systemd/mkosi/archive/refs/tags/v14.tar.gz | |
tar zxf v14.tar.gz | |
cd mkosi-14 | |
sed -i '/gpgurl\ = \urllib.parse.urljoin/c \ gpgurl\ =\ \"https://fedoraproject.org/fedora.gpg\"' ./mkosi/__init__.py | |
sed -i 's/gpgcheck = True/gpgcheck = False/g' ./mkosi/__init__.py | |
python3 -m pip install --user ./ | |
# Required for ssh'ing into VM | |
- name: "setup: environment" | |
run: | | |
sudo systemctl enable --now systemd-networkd | |
- name: "cache: os packages" | |
uses: actions/cache@v3 | |
with: | |
path: ~/mkosi.cache | |
key: fedora-cache-v1 | |
- name: "acquire: rublk" | |
uses: actions/checkout@v3 | |
- name: "build: fedora image" | |
working-directory: ci | |
run: | | |
[ -d ~/mkosi.cache ] && ln -s mkosi.cache ~/mkosi.cache | |
sudo $(which mkosi) build | |
if [ ! -d ~/mkosi.cache ]; then cp -fr ./mkosi.cache ~/; fi | |
- name: "start: boot fedora in qemu" | |
working-directory: ci | |
run: | | |
RUNNER_TRACKING_ID="" && sudo $(which mkosi) qemu -serial none -monitor none -display none -device virtio-net-pci,netdev=network0 -netdev user,id=network0,hostfwd=tcp:127.0.0.1:5555-:22 | tee ${{ github.workspace }}/qemu.log & | |
- name: "connect: check ssh connection" | |
shell: bash | |
timeout-minutes: 10 | |
working-directory: ci | |
run: | | |
until mkosi ssh uname -a; do | |
echo "Retrying..." | |
sleep 0.25 | |
done | |
- name: "test: run rublk test" | |
working-directory: ci | |
run: | | |
mkosi ssh ls -l /usr/share/rublk/target/debug/deps/basic* | |
mkosi ssh ls -l /usr/share/rublk/target/debug/ | |
mkosi ssh /usr/share/rublk/target/debug/test-basic --nocapture | |
mkosi ssh "/root/bin/rublk help" | |
mkosi ssh "/root/bin/rublk add help" | |
mkosi ssh "cd /usr/share/blktests/; export PATH=/root/bin:$PATH; ./check ublk" | |
mkosi ssh "/usr/share/rublk/ci/add_ublk_dev.sh /root/bin/rublk /usr/share/blktests/" | |
mkosi ssh "/root/bin/rublk list" | |
mkosi ssh "cat /usr/share/blktests/config" | |
mkosi ssh "cd /usr/share/blktests/; ./check -d block dm -x block/012 -x block/007 -c config" | |
mkosi ssh "cd /usr/share/blktests/; if [ -f ./zoned_config ]; then ./check -d zbd -c zoned_config; else true; fi" | |
mkosi ssh "sleep 2;/root/bin/rublk del -a" | |
- name: "cleanup" | |
if: always() | |
continue-on-error: true | |
run: | | |
cat ${{ github.workspace }}/qemu.log | |
sudo pkill -f qemu |