public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install
@ 2009-05-08 18:55 Mike Burns
  2009-05-11 13:49 ` Eduardo Habkost
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Burns @ 2009-05-08 18:55 UTC (permalink / raw)
  To: kvm; +Cc: ulublin, Michael Burns

From: Michael Burns <mburns@redhat.com>


Signed-off-by: Michael Burns <mburns@redhat.com>
---
 client/tests/kvm_runtest_2/control        |   14 +++++++++++++-
 client/tests/kvm_runtest_2/kvm_install.py |   11 +++++++++++
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control
index fd68e94..c28dc67 100644
--- a/client/tests/kvm_runtest_2/control
+++ b/client/tests/kvm_runtest_2/control
@@ -41,6 +41,15 @@ link_if_not_exist(pwd, qemu_img, 'qemu-img')
 
 # ---------------------
 # Build and install kvm
+#
+# Details of Install options
+#   Mode: custom
+#   Description:  install from custom install script
+#   Parameters needed:
+#     install_script: 
+#       location of script relative to the 
+#       kvm-autotest/client directory
+#
 # ---------------------
 params = {
     "name": "kvm_install",
@@ -57,7 +66,10 @@ params = {
 
     ## Install from git
     "git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git',
-    "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git'
+    "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git',
+    
+    ## Custom install
+    "install_script": 'tests/kvm_runtest/custom_kvm_install.sh'
 }
 
 # Comment the job.run_test line if you do not want to install kvm on the host.
diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py
index 8be5a93..0e077ae 100755
--- a/client/tests/kvm_runtest_2/kvm_install.py
+++ b/client/tests/kvm_runtest_2/kvm_install.py
@@ -77,6 +77,17 @@ def run_kvm_install(test, params, env):
     elif install_mode == "localsrc":
         __install_kvm(test, srcdir)
 
+    # install from custom script
+    elif install_mode == "custom":
+        install_script = params.get("install_script")
+        script = os.path.join(os.environ['AUTODIR'],install_script)
+        if not install_script:
+            message = "Custom script filename not specified"
+            kvm_log.error(message)
+            raise error.TestError, message
+	kvm_log.info("Running " + script + " to install kvm")
+        os.system(script)
+
     # invalid installation mode
     else:
         message = "Invalid installation mode: '%s'" % install_mode
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install
@ 2009-05-11 15:51 Mike Burns
  2009-05-11 18:52 ` Lucas Meneghel Rodrigues
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Burns @ 2009-05-11 15:51 UTC (permalink / raw)
  To: kvm; +Cc: ulublin, Michael Burns

From: Michael Burns <mburns@redhat.com>


Signed-off-by: Michael Burns <mburns@redhat.com>
---
 client/tests/kvm_runtest_2/control        |   17 ++++++++++++++++-
 client/tests/kvm_runtest_2/kvm_install.py |   13 +++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control
index fd68e94..5d022b5 100644
--- a/client/tests/kvm_runtest_2/control
+++ b/client/tests/kvm_runtest_2/control
@@ -41,6 +41,18 @@ link_if_not_exist(pwd, qemu_img, 'qemu-img')
 
 # ---------------------
 # Build and install kvm
+#
+# Details of Install options
+#   Mode: custom
+#   Description:  install from custom install script
+#   Parameters needed:
+#     install_script: 
+#       location of script relative to the 
+#       kvm-autotest/client directory
+#   Note:  For custom parameters for your script, define them as params below.
+#       They will be available as KVM_INSTALL_<name> in the OS environment
+#       Example: install_script will be available as KVM_INSTALL_install_script
+#
 # ---------------------
 params = {
     "name": "kvm_install",
@@ -57,7 +69,10 @@ params = {
 
     ## Install from git
     "git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git',
-    "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git'
+    "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git',
+    
+    ## Custom install
+    "install_script": 'tests/kvm_runtest_2/custom_kvm_install.sh'
 }
 
 # Comment the job.run_test line if you do not want to install kvm on the host.
diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py
index 8be5a93..bb664b3 100755
--- a/client/tests/kvm_runtest_2/kvm_install.py
+++ b/client/tests/kvm_runtest_2/kvm_install.py
@@ -77,6 +77,19 @@ def run_kvm_install(test, params, env):
     elif install_mode == "localsrc":
         __install_kvm(test, srcdir)
 
+    # install from custom script
+    elif install_mode == "custom":
+        install_script = params.get("install_script")
+        script = os.path.join(os.environ['AUTODIR'],install_script)
+        if not install_script:
+            message = "Custom script filename not specified"
+            kvm_log.error(message)
+            raise error.TestError, message
+        for k in params.keys():
+          os.putenv("KVM_INSTALL_%s" % (k), str(params[k]))
+	kvm_log.info("Running " + script + " to install kvm")
+        os.system(script)
+
     # invalid installation mode
     else:
         message = "Invalid installation mode: '%s'" % install_mode
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 17+ messages in thread
[parent not found: <1254147621.368741242063155059.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>]
[parent not found: <471764781.379441242067968821.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>]
* [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install
@ 2009-05-12 15:34 Mike Burns
  2009-06-01 15:46 ` Uri Lublin
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Burns @ 2009-05-12 15:34 UTC (permalink / raw)
  To: kvm; +Cc: ulublin, Michael Burns

From: Michael Burns <mburns@redhat.com>


Signed-off-by: Michael Burns <mburns@redhat.com>
---
 client/tests/kvm_runtest_2/control        |   18 +++++++++++++++++-
 client/tests/kvm_runtest_2/kvm_install.py |   15 +++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm_runtest_2/control b/client/tests/kvm_runtest_2/control
index fd68e94..d6e26bc 100644
--- a/client/tests/kvm_runtest_2/control
+++ b/client/tests/kvm_runtest_2/control
@@ -41,6 +41,19 @@ link_if_not_exist(pwd, qemu_img, 'qemu-img')
 
 # ---------------------
 # Build and install kvm
+#
+# Details of Install options
+#   Mode: custom
+#   Description:  install from custom install script
+#   Parameters needed:
+#     install_script: 
+#       location of script relative to the kvm-runtest_2 directory.
+#       Script will be executed from test.bindir (generally kvm_runtest_2)
+#       parameters for the script can be passed either as environment variables
+#       in the params array below or in the definition of install_script.
+#       If they are passed as part of params, then they will be accessible as
+#       KVM_INSTALL_<s> in the OS Environment when your script runs.  
+#
 # ---------------------
 params = {
     "name": "kvm_install",
@@ -57,7 +70,10 @@ params = {
 
     ## Install from git
     "git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git',
-    "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git'
+    "user_git_repo": 'git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm-userspace.git',
+    
+    ## Custom install
+    "install_script": 'custom_kvm_install.sh param1'
 }
 
 # Comment the job.run_test line if you do not want to install kvm on the host.
diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py
index 8be5a93..234c77a 100755
--- a/client/tests/kvm_runtest_2/kvm_install.py
+++ b/client/tests/kvm_runtest_2/kvm_install.py
@@ -77,6 +77,21 @@ def run_kvm_install(test, params, env):
     elif install_mode == "localsrc":
         __install_kvm(test, srcdir)
 
+    # install from custom script
+    elif install_mode == "custom":
+        install_script = params.get("install_script")
+        script = os.path.join(test.bindir,install_script)
+        if not install_script:
+            message = "Custom script filename not specified"
+            kvm_log.error(message)
+            raise error.TestError, message
+        for k in params.keys():
+	  kvm_log.info("Adding KVM_INSTALL_%s to Environment" % (k))
+          os.putenv("KVM_INSTALL_%s" % (k), str(params[k]))
+	kvm_log.info("Running " + script + " to install kvm")
+        os.system("cd %s; %s" % (test.bindir, script))
+	kvm_log.info("Completed %s" % (script))
+
     # invalid installation mode
     else:
         message = "Invalid installation mode: '%s'" % install_mode
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-06-01 18:25 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-08 18:55 [PATCH][KVM-AUTOTEST] Add custom install option for kvm_install Mike Burns
2009-05-11 13:49 ` Eduardo Habkost
2009-05-11 15:06   ` Mike Burns
  -- strict thread matches above, loose matches on Subject: below --
2009-05-11 15:51 Mike Burns
2009-05-11 18:52 ` Lucas Meneghel Rodrigues
     [not found] <1254147621.368741242063155059.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-05-11 17:36 ` Michael Goldish
2009-05-11 17:52   ` Mike Burns
2009-05-11 18:34     ` Eduardo Habkost
2009-05-11 18:43       ` Mike Burns
2009-05-11 18:30   ` Eduardo Habkost
     [not found] <471764781.379441242067968821.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-05-11 19:00 ` Michael Goldish
2009-05-11 19:19   ` Eduardo Pereira Habkost
2009-05-12 15:28     ` Mike Burns
2009-05-13  7:12   ` Avi Kivity
2009-05-12 15:34 Mike Burns
2009-06-01 15:46 ` Uri Lublin
2009-06-01 18:25   ` Mike Burns

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox