This patch modifies the run_autotest utility function to
allow running some very simple autotest tests under our
linux guests. It does so by changing the way the autotest
tarball is uncompressed and also, determining the autotest
destination on guest through a simple heuristic.

The patch introducing JeOS comes next. Stay tuned...

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/virt/virt_test_utils.py |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/client/virt/virt_test_utils.py b/client/virt/virt_test_utils.py
index 101cd1e..aedb173 100644
--- a/client/virt/virt_test_utils.py
+++ b/client/virt/virt_test_utils.py
@@ -493,7 +493,7 @@ def run_autotest(vm, session, control_path, timeout, 
outputdir, params):
         dirname = os.path.dirname(remote_path)
         session.cmd("cd %s" % dirname)
         session.cmd("mkdir -p %s" % os.path.dirname(dest_dir))
-        e_cmd = "tar xjvf %s -C %s" % (basename, os.path.dirname(dest_dir))
+        e_cmd = "bzcat %s | tar -C %s -xvf -" % (basename, 
os.path.dirname(dest_dir))
         output = session.cmd(e_cmd, timeout=120)
         autotest_dirname = ""
         for line in output.splitlines():
@@ -547,8 +547,19 @@ def run_autotest(vm, session, control_path, timeout, 
outputdir, params):
         mig_protocol = params.get("migration_protocol", "tcp")
 
     compressed_autotest_path = "/tmp/autotest.tar.bz2"
-    destination_autotest_path = GLOBAL_CONFIG.get_config_value('COMMON',
-                                                            
'autotest_top_path')
+    default_autotest_path = GLOBAL_CONFIG.get_config_value('COMMON',
+                                                           'autotest_top_path')
+    try:
+        session.cmd('test -e /bin/busybox')
+        busybox_system = True
+    except aexpect.ShellCmdError:
+        busybox_system = False
+
+    if busybox_system:
+        # Our embedded images have some space on /tmpfs, not so much in root
+        destination_autotest_path = '/tmp/autotest'
+    else:
+        destination_autotest_path = default_autotest_path
 
     # To avoid problems, let's make the test use the current AUTODIR
     # (autotest client path) location
-- 
1.7.7.6

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

Reply via email to