fix: use sparse loopback file instead of qcow2

- no nbd module in kata so can't use qemu-nbd
This commit is contained in:
Peter Šurda 2021-02-26 22:33:33 +01:00
parent 722fb00d52
commit d34ff41d97
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
2 changed files with 3 additions and 7 deletions

View File

@ -7,5 +7,4 @@ addons:
- jq - jq
- kmod - kmod
script: script:
- sudo apt -y install linux-modules-$(uname -r)
- ./test.sh - ./test.sh

View File

@ -4,12 +4,9 @@ function test_partitioning()
{ {
local img local img
img=$(mktemp -u) img=$(mktemp -u)
qemu-img create -f qcow2 "$img" 16G dd if=/dev/zero of="$img" bs=1M seek=16384 count=0
sudo modprobe nbd sudo setup_drive "$img"
sudo qemu-nbd -c /dev/nbd0 "$img" sudo parted -ms "$img" -- print
sudo setup_drive /dev/nbd0
sudo parted -ms /deb/nbd0 -- print
sudo qemu-nbd -d /dev/nbd0
rm -f "$img" rm -f "$img"
} }