Virt: re-write and refactor save_build() utility function
The save_build() has a rather specific name, but its purpose is really
general in nature: to archive a given directory (build dir) as a tarball
file somewhere (dest_dir).
This patch:
* Renames save_build() to archive_as_tarball()
* Moves it to virt_utils
* Adds more flexiblity with regards to naming the tarball
* Adds more flexiblity with regards to compression
* Avoids using external 'tar' command by using 'tarfile' module
* Adds more unittests
Signed-off-by: Cleber Rosa <crosa@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5469 592f7852-d20e-0410-864c-8624ca9c26a4