Skip to contentSkip to conversation

kvm test: Move kvm functional subtests to a 'tests' directory

PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Jun 17, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm test: Move kvm functional subtests to a 'tests' directory

In order to organize better the kvm functional subtests, move them to a 'tests' subdirectory. In order to add a test, one would need to put a file 'testname.py' on 'tests', implementing a function run_testname() on that file.

This way we don't have to 'register' tests on the kvm tests subdirectory, and a predictable name schema for future functional tests.

I know I will have to split this into smaller patches, meanwhile this patch shows the work so far.

---
 client/tests/kvm/control             |    6 +-
 client/tests/kvm/kvm.py              |   50 +---
 client/tests/kvm/kvm_install.py      |  338 ------------------------
 client/tests/kvm/kvm_tests.py        |  476 ----------------------------------
 client/tests/kvm/stepmaker.py        |   17 --
 client/tests/kvm/tests/autotest.py   |  165 ++++++++++++
 client/tests/kvm/tests/boot.py       |   50 ++++
 client/tests/kvm/tests/install.py    |  338 ++++++++++++++++++++++++
 client/tests/kvm/tests/linux_s3.py   |   56 ++++
 client/tests/kvm/tests/migration.py  |   79 ++++++
 client/tests/kvm/tests/stepmaker.py  |   22 ++
 client/tests/kvm/tests/steps.py      |  215 +++++++++++++++
 client/tests/kvm/tests/yum_update.py |   65 +++++
 13 files changed, 1002 insertions(+), 875 deletions(-)
 delete mode 100755 client/tests/kvm/kvm_install.py
 delete mode 100644 client/tests/kvm/kvm_tests.py
 create mode 100644 client/tests/kvm/tests/__init__.py
 create mode 100644 client/tests/kvm/tests/autotest.py
 create mode 100644 client/tests/kvm/tests/boot.py
 create mode 100755 client/tests/kvm/tests/install.py
 create mode 100644 client/tests/kvm/tests/linux_s3.py
 create mode 100644 client/tests/kvm/tests/migration.py
 create mode 100644 client/tests/kvm/tests/stepmaker.py
 create mode 100644 client/tests/kvm/tests/steps.py
 create mode 100644 client/tests/kvm/tests/yum_update.py
client/tests/kvm/control +3 -3
index c030a14..5a2b1df 100644
@@ -88,9 +88,9 @@ link_if_not_exist(pwd, qemu_img, 'qemu-img')
 # Build and install kvm
 # ---------------------
 params = {
-    "name": "kvm_install",
-    "shortname": "kvm_install",
-    "type": "kvm_install",
+    "name": "install",
+    "shortname": "install",
+    "type": "install",
     "mode": "release",
 
     ## Install from a tarball
client/tests/kvm/kvm.py +9 -41

76 lines not on this page · raw message

client/tests/kvm/kvm_install.py deleted +0 -338

338 lines not on this page · raw message

client/tests/kvm/kvm_tests.py deleted +0 -476

476 lines not on this page · raw message

client/tests/kvm/stepmaker.py +0 -17
index 8f16ffd..6a8d86c 100644
@@ -338,20 +338,3 @@ class StepMaker(stepeditor.StepMakerWindow):
         pass
 
 
-def run_stepmaker(test, params, env):
-    vm = kvm_utils.env_get_vm(env, params.get("main_vm"))
-    if not vm:
-        raise error.TestError("VM object not found in environment")
-    if not vm.is_alive():
-        raise error.TestError("VM seems to be dead; Step Maker requires a"
-                              " living VM")
-
-    steps_filename = params.get("steps")
-    if not steps_filename:
-        raise error.TestError("Steps filename not specified")
-    steps_filename = os.path.join(test.bindir, "steps", steps_filename)
-    if os.path.exists(steps_filename):
-        raise error.TestError("Steps file %s already exists" % steps_filename)
-
-    StepMaker(vm, steps_filename, test.debugdir, params)
-    gtk.main()
client/tests/kvm/tests/__init__.py new file +0 -0
new file mode 100644
index 0000000..e69de29
client/tests/kvm/tests/autotest.py new file +165 -0

165 lines not on this page · raw message

client/tests/kvm/tests/boot.py new file +50 -0

50 lines not on this page · raw message

client/tests/kvm/tests/install.py new file +338 -0

338 lines not on this page · raw message

client/tests/kvm/tests/linux_s3.py new file +56 -0

56 lines not on this page · raw message

client/tests/kvm/tests/migration.py new file +79 -0

79 lines not on this page · raw message

client/tests/kvm/tests/stepmaker.py new file +22 -0
new file mode 100644
index 0000000..3a3a92d
@@ -0,0 +1,22 @@
+import os, gtk
+from autotest_lib.client.common_lib import error
+import kvm_utils, stepmaker
+
+
+def run_stepmaker(test, params, env):
+    vm = kvm_utils.env_get_vm(env, params.get("main_vm"))
+    if not vm:
+        raise error.TestError("VM object not found in environment")
+    if not vm.is_alive():
+        raise error.TestError("VM seems to be dead; Step Maker requires a"
+                              " living VM")
+
+    steps_filename = params.get("steps")
+    if not steps_filename:
+        raise error.TestError("Steps filename not specified")
+    steps_filename = os.path.join(test.bindir, "steps", steps_filename)
+    if os.path.exists(steps_filename):
+        raise error.TestError("Steps file %s already exists" % steps_filename)
+
+    stepmaker.StepMaker(vm, steps_filename, test.debugdir, params)
+    gtk.main()
client/tests/kvm/tests/steps.py new file +215 -0

215 lines not on this page · raw message

client/tests/kvm/tests/yum_update.py new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
1.6.2.2