Skip to content

Commit fdbd03b

Browse files
committed
Fix(ci): Correct rootfs image path handling in qemu tests
1 parent 7784d74 commit fdbd03b

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.github/workflows/test-qemu.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,22 @@ jobs:
4646
img_name="qemu-${{ matrix.arch }}"
4747
sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config"
4848
echo "Updated kernel_path in $config"
49-
done
5049
51-
- name: Download IMAGES
52-
run: |
53-
IMAGES_DIR="/tmp/axvisor/${{ matrix.vmimage_name }}"
54-
ROOTFS_IMG_PATH="${IMAGES_DIR}/rootfs.img"
50+
ROOTFS_IMG_PATH="/tmp/axvisor/$img/rootfs.img"
5551
56-
# Check if rootfs.img exists after extraction
57-
if [ -f "${ROOTFS_IMG_PATH}" ]; then
58-
echo "Found rootfs.img, patching qemu-aarch64.toml file..."
59-
sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml"
60-
echo "Rootfs setup completed"
61-
else
62-
echo "No rootfs.img found, removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..."
63-
sed -i '/-device/,/virtio-blk-device,drive=disk0/d' ".github/workflows/qemu-${{ matrix.arch }}.toml"
64-
sed -i '/-drive/,/id=disk0,if=none,format=raw,file=${workspaceFolder}\/tmp\/rootfs.img/d' ".github/workflows/qemu-${{ matrix.arch }}.toml"
65-
sed -i 's/root=\/dev\/vda rw //' ".github/workflows/qemu-${{ matrix.arch }}.toml"
66-
echo "Rootfs device configuration removed"
67-
fi
52+
# Check if rootfs.img exists after extraction
53+
if [ -f "${ROOTFS_IMG_PATH}" ]; then
54+
echo "Found rootfs.img, patching qemu-aarch64.toml file..."
55+
sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml"
56+
echo "Rootfs setup completed"
57+
else
58+
echo "No rootfs.img found, removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..."
59+
sed -i '/-device/,/virtio-blk-device,drive=disk0/d' ".github/workflows/qemu-${{ matrix.arch }}.toml"
60+
sed -i '/-drive/,/id=disk0,if=none,format=raw,file=${workspaceFolder}\/tmp\/rootfs.img/d' ".github/workflows/qemu-${{ matrix.arch }}.toml"
61+
sed -i 's/root=\/dev\/vda rw //' ".github/workflows/qemu-${{ matrix.arch }}.toml"
62+
echo "Rootfs device configuration removed"
63+
fi
64+
done
6865
6966
- name: Run tests
7067
run: |

0 commit comments

Comments
 (0)