PR 1282 remake

This is a remake of PR #1282, the parts actually relevant to virt-test. We're still considering to move some of the libraries to the test provider, but for now this is a good start.