Skip to contentSkip to conversation

Incorrect tar command used in 'virt_test_utils.py'

PATCH New Lukas Doktor 2 participants 3 messages Jul 8, 2011 KVM

lore
Share & tools
lore
#0 lore raw

Hi,

the tar command must use relative path to strip the leading '/' directories. Without this patch the kvm autotest's autotest test extracts autotest on guest into the original location of the autotest on the host. The location might not correspond with the test location and the test might fail.

Regards,
Lukáš
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

#1 lore raw

PATCH 1/1 * 'tar' needs relative paths to strip the leading '/'

---
 client/virt/virt_test_utils.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
client/virt/virt_test_utils.py +2 -2
index 2636352..1ef4f69 100644
@@ -524,11 +524,11 @@ def run_autotest(vm, session, control_path, timeout, outputdir, params):
         mig_timeout = float(params.get("mig_timeout", "3600"))
         mig_protocol = params.get("migration_protocol", "tcp")
 
-    compressed_autotest_path = "/tmp/autotest.tar.bz2"
+    compressed_autotest_path = os.path.relpath("/tmp/autotest.tar.bz2")
 
     # To avoid problems, let's make the test use the current AUTODIR
     # (autotest client path) location
-    autotest_path = os.environ['AUTODIR']
+    autotest_path = os.path.relpath(os.environ['AUTODIR'])
 
     # tar the contents of bindir/autotest
     cmd = "tar cvjf %s %s/*" % (compressed_autotest_path, autotest_path)
Signature · 1 line
1.7.6