Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: client/virt/virt_installer.py

Issue 6883246: Merge autotest upstream from @5318 ~ @5336 (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/virt/virt_env_process.py ('k') | client/virt/virt_scheduler.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/virt/virt_installer.py
diff --git a/client/virt/virt_installer.py b/client/virt/virt_installer.py
new file mode 100644
index 0000000000000000000000000000000000000000..1faae5f11b2650ad28a7a0e852406ded20dbff97
--- /dev/null
+++ b/client/virt/virt_installer.py
@@ -0,0 +1,40 @@
+import os, shutil, logging
+from autotest_lib.client.bin import utils
+
+
+def check_configure_options(script_path):
+ """
+ Return the list of available options (flags) of a GNU autoconf like
+ configure build script.
+
+ @param script: Path to the configure script
+ """
+ abspath = os.path.abspath(script_path)
+ help_raw = utils.system_output('%s --help' % abspath, ignore_status=True)
+ help_output = help_raw.split("\n")
+ option_list = []
+ for line in help_output:
+ cleaned_line = line.lstrip()
+ if cleaned_line.startswith("--"):
+ option = cleaned_line.split()[0]
+ option = option.split("=")[0]
+ option_list.append(option)
+
+ return option_list
+
+
+def cpu_vendor():
+ vendor = "intel"
+ if os.system("grep vmx /proc/cpuinfo 1>/dev/null") != 0:
+ vendor = "amd"
+ logging.debug("Detected CPU vendor as '%s'", vendor)
+ return vendor
+
+
+def save_build(build_dir, dest_dir):
+ logging.debug('Saving the result of the build on %s', dest_dir)
+ base_name = os.path.basename(build_dir)
+ tarball_name = base_name + '.tar.bz2'
+ os.chdir(os.path.dirname(build_dir))
+ utils.system('tar -cjf %s %s' % (tarball_name, base_name))
+ shutil.move(tarball_name, os.path.join(dest_dir, tarball_name))
« no previous file with comments | « client/virt/virt_env_process.py ('k') | client/virt/virt_scheduler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698