I tried to launch spread tests for certain project using the spread snap but there is a problem with qemu backend. Seems that virtualized environments are not accesible due to confinement. I’ve tested confining snap as classic and that works perfectly. I wonder if we should release it as classic. In that case, paths to search for images maybe shouldn’t be hardcoded to $HOME/.spread but checking if we are in a snap and search for it at $SNAP_USER_DATA/.spread instead. I don’t know if makes sense also having the option of an env var to search for the images. Thoughts?
I’ve just read your reply.
Sorry I didn’t propose my tested code before. I don’t want you to redo things I’ve done before. I got the first version of the snap now present in the store, and I changed confinement to classic. That along with hardcoded paths to find the image for Qemu is what is included in this PR https://github.com/snapcore/spread/pull/30
Maybe that’s not covering all the backend virtualized cases, but it is a start.
I saw it was added to the repo a strict confined version of the snap. However, when testing using a kvm/qemu backend I saw it is not possible as there is no access to it. Initially it was complaining about the need of having kvm available for the snap. I added kvm-qemu as stage package and then I saw this output when launching spread tests in a project:
Cannot connect to qemu:ubuntu-core-16: dial tcp 127.0.0.1:59377: getsockopt: connection refused
Using snappy-debug, this was the complain reported:
We have builtin interface(kvm) to support this. Adding a kvm plug in the spread snapcraft.yaml file could remedy this situation.
But it didn’t land it in 2.27.6 yet. I am not sure when it’s going to happen.
Probably, @mvo knows something about it.
I finally completed qemu-kvm backend support in current strict confined spread snap. @mvo, @zyga-snapd or @niemeyer, please take a look at it here when you find some time.
There is one limitation: The project to test must be in a path accessible by spread snap in order to work. I’ve tested simply by copying that project to its $SNAP_USER_DATA, but maybe content interface can also be used (I’ve not tested). Or maybe you can think on another better and more confortable solution.
Note that there are users/customers that validate their core images using spread (even here in the forum), we might end up needing two spread packages or a qemu interface that spread could use…
Edit: oops, missed the above post about that interface…