ovirt-imageio
ovirt-imageio copied to clipboard
Go test infrastructure
The go tests require running imageio server serving an empty 6g image.
Currently running the Go tests requires lot of manual steps:
- Start another shell
- Build
make
- Run test server
./ovirt-imageio -c examples
- Start another shell and add a ticket
./ovirt-imageioctl add-ticket -c examples examples/nbd.json
- Create empty qcow2 image
qemu-img create -f qcow2 empty.qcow2 6g
- Run qemu-nbd serving the ticket
qemu-nbd -r -t -e8 -f qcow2 empty.qcow2 -k /tmp/nbd.sock
- Run the tests
$ go test -v ./...
? ovirt.org/ovirt-img [no test files]
=== RUN TestNbdSize
--- PASS: TestNbdSize (0.00s)
=== RUN TestNbdExtents
--- PASS: TestNbdExtents (0.00s)
PASS
ok ovirt.org/ovirt-img/nbd 0.004s
? ovirt.org/ovirt-img/qemuimg [no test files]
What we need is infrastructure like the python tests:
- running imageio server per test or per module
- easy way to add tickets - helper running ovirt-imageioctl?
- easy way to create test image, so we can test more interesting images, not only empty images
- easy way to run qemu-nbd, serving a test image, like python qemu_nbd.run()