autotest/virt-test — pull request #405 by ldoktor (2013-05-15 09:41:21+00:00)
Title: virttest.storage: Some fixes plus feature request

First two commits are more-less styling changes. The last commit is a proposal for speedup intrusive tests (tests, which on failure corrupts the image and require backup+restore).

With this patch backup won't overwrite the previous backup file, which saves time when those-kind-of-test are executed multiple times on the same host machine.

Also it could be quicker to not use execute `restore_image_after_testing` all the time, but rather use `restore_image_after_testing_on_error` and cleanup the machine when the test passes.

This modification is tailored for this: https://github.com/autotest/virt-test/pull/401 test, where preparation takes 60s, test 30+17s and restore another 60s. With this patch + simple cleanup decreases the time from 60+30+17+60=167s to 0+30+17+2=49s.